Announcement Announcement Module
Collapse
No announcement yet.
Problem uploading ".zip" files using struts+hibernate+spring. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem uploading ".zip" files using struts+hibernate+spring.

    Hi everybody,

    I Have a problem in uploading archive files like ".zip" ".ear" ".jar" (every other file type works just fine). I'm using the org.apache.struts.upload.FormFile class.

    I'm able to open any file type (exists in my c: drive for example) including archive from my FileResourceAction and use "my" save method to save it to orcle DB. so the problem is somewhere between struts and the action.


    action form code :

    Code:
    public class FileResourceForm extends BaseForm {
    
        private FormFile theFile;
    
        public FormFile getTheFile() {
            return theFile;
        }
    
        public void setTheFile(FormFile theFile) {
            this.theFile = theFile;
        }
    }
    The full error is attached

    some of the error generated :

    [15:57:10:053 IDT 03/09/07] 00000038 SystemErr R org.springframework.dao.DataIntegrityViolationExce ption: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
    Caused by: org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:71)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(Ab stractBatcher.java:253)
    at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:235)
    at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:139)
    at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:298)
    at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:27)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:1000)
    at org.springframework.orm.hibernate3.HibernateTempla te$27.doInHibernate(HibernateTemplate.java:811)
    at org.springframework.orm.hibernate3.HibernateTempla te.execute(HibernateTemplate.java:372)
    at org.springframework.orm.hibernate3.HibernateTempla te.flush(HibernateTemplate.java:809)
    at il.co.cis.common.dao.impl.hibernate.EntityDAOHiber nate.saveEntity(EntityDAOHibernate.java:68)
    at il.co.cis.common.service.impl.EntityManagerImpl.sa veModelEntity(EntityManagerImpl.java:142)
    at il.co.cis.commons.fileresource.manager.imp.FileRes ourceManagerImp.saveEntity(FileResourceManagerImp. java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java(Compiled Code))
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java(Compiled Code))
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java(Compiled Code))
    at java.lang.reflect.Method.invoke(Method.java(Compil ed Code))
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:304)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:172)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :139)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:107)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :161)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy35.saveEntity(Unknown Source)
    at il.co.cis.commons.fileresource.service.FileResourc eServiceImp.save(FileResourceServiceImp.java:111)
    at il.co.cis.vms.app.web.action.FileResourceAction.sa ve(FileResourceAction.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java(Compiled Code))
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java(Compiled Code))
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java(Compiled Code))
    at java.lang.reflect.Method.invoke(Method.java(Compil ed Code))
    at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:269)
    at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:170)
    at org.apache.struts.actions.MappingDispatchAction.ex ecute(MappingDispatchAction.java:166)
    at il.co.cis.common.web.action.BaseAction.process(Bas eAction.java:250)
    at il.co.cis.common.web.action.BaseAction.execute(Bas eAction.java:78)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:425)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:228)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1913)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:462)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    [/error]


    If you have any idea why I'm getting this error, I will appreciate it.
    Thanks.
    Last edited by eitanbaron; Sep 3rd, 2007, 08:39 AM.

  • #2
    Originally posted by eitanbaron View Post
    I'm able to open any file type (exists in my c: drive for example) including archive from my FileResourceAction and use "my" save method to save it to orcle DB. so the problem is somewhere between struts and the action.
    Try to track down your error to a minimum. Your error is happening somewhere between the web interface and the database - which means it can happen in ANY layer of your application. Whom do you expect being able to help you with that complexity without knowing your application or sitting in front of it? You won't get any help here for nearly sure without having done your homework - not because nobody wants to help you, but just because it's nearly impossible.

    Joerg

    Comment

    Working...
    X