5 Replies Latest reply on Sep 7, 2008 2:48 AM by jaikiran pai

    Error in entitymanager

    calvin design Newbie

      Dear all,

      In my code, i have

      private EntityManagerFactory emf = Persistence.createEntityManagerFactory("myDBUnit", new HashMap());

      however, this line cause an error in jboss AS, it saids that IllegalArgumentException, unable to read JAR....illegal character at line 18.... Any clue on this ?

      thanks.

        • 1. Re: Error in entitymanager
          Peter Johnson Master

          Post the full stack trace please.

          • 2. Re: Error in entitymanager
            calvin design Newbie

            15:32:16,049 ERROR [[action]] Servlet.service() for servlet action threw excepti

            on

            java.lang.IllegalArgumentException: Unable to visit JAR file:/C:/Documents and S

            ettings/kelvin/Desktop/desktop/jboss-4.2.2.GA/server/default/tmp/deploy/tmp1652

            5myApp.ear-contents/myApp.jar. Cause: Illegal character in path at i

            ndex 18: file:/C:/Documents and Settings/kelvin/Desktop/desktop/jboss-4.2.2.GA/

            server/default/tmp/deploy/tmp16525myApp.ear-contents/myApp.jar

            at org.hibernate.ejb.packaging.JarVisitor.getVisitor(JarVisitor.java:100

            )

            at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:

            226)

            at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(Hib

            ernatePersistence.java:120)

            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.

            java:51)

            at com.mas.mes.dao.HelloDao.(HelloDao.java:20)

            at com.mas.mes.ejb.session.HelloBean.hello(HelloBean.java:26)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

            java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

            sorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:112)

            at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo

            ntextImpl.java:166)

            at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int

            erceptorsInterceptor.java:63)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok

            e(TransactionScopedEntityManagerInterceptor.java:54)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI

            nterceptor.java:47)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)

            at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java

            :191)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt

            erceptor.java:95)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles

            sInstanceInterceptor.java:62)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic

            ationInterceptor.java:77)

            at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth

            enticationInterceptor.java:110)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce

            ptor.java:46)

            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.

            java:101)

            • 3. Re: Error in entitymanager
              Peter Johnson Master

              Did you read the error message:

              Cause: Illegal character in path at index 18: file:/C:/Documents and Settings/...

              Did you count the letters to see what is at index 18?

              Many Java libraries balk at spaces in path names. You should move JBossAS out of "Documents and Settings". I have mine at d:/opt/jboss/jboss-4.2.2.GA.

              • 4. Re: Error in entitymanager
                calvin design Newbie

                yea.. i knew is the space problem. So is there anyway can overcome this problem ? other than move the JBoss AS folder. thanks

                • 5. Re: Error in entitymanager
                  jaikiran pai Master

                   

                  So is there anyway can overcome this problem ? other than move the JBoss AS folder


                  No there is no other option in the current version of JBoss. For JBoss-5, this is being tracked through https://jira.jboss.org/jira/browse/JBAS-5796.