[EJB 3.0] - Exploded jar containing persistence.xml with jar-file elemen
by jaikiran
I have deployed a sample ear file containing 2 jars file. The EAR file is exploded and even the jar files are in exploded format.
| EJB3Persistence.ear
| |
| |--- META-INF
| | |
| | |--- application.xml
| |
| |
| |
| |--- myapp_ejb3.jar (this is exploded too)
| | |
| | |--- META-INF
| | | |
| | | |--- persistence.xml
| | | |
| | |
| | |--- <some annotated persistent entities>
| |
| |
| |
| |--- myapp2_ejb3.jar (this too is exploded)
| | |
| | |--- META-INF
| | |
| | |--- <some more annotated persistent entities>
|
|
|
|
|
|
|
My persistent (annotated) entities are present in both myapp_ejb3.jar and myapp2_ejb3.jar. My persistence.xml file is present in the META-INF folder of myapp_ejb3.jar and looks like this :
| <?xml version="1.0" encoding="UTF-8"?>
|
| <persistence xmlns="http://java.sun.com/xml/ns/persistence">
|
| <persistence-unit name="EJB3Persistence">
| <jta-data-source>java:/EJB3PersistenceDS</jta-data-source>
| <!-- <class>org.myapp.entity.User</class>
| <class>org.myapp.entity.Account</class> -->
| <!-- The current jar is by default scanned for entities, so just mention the other jar -->
| <jar-file>../myapp2_ejb3.jar</jar-file>
| </persistence-unit>
| </persistence>
When i deploy this EAR on 4.2.2 version of JBoss, i get this deployment error:
| 15:41:48,844 WARN [ServiceController] Problem starting service persistence.units:ear=EJB3Persistence.ear,jar=myapp_ejb3.jar,unitName=EJB3Persistence
| java.lang.RuntimeException: error trying to scan <jar-file>: file:/D:/JBoss_4_2/server/default/deploy/EJB3Persistence.ear/myapp_ejb3.jar/myapp2_ejb3.jar
| at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:619)
| at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:338)
| at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
| at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at org.jboss.system.ServiceController.start(ServiceController.java:435)
| at org.jboss.system.ServiceController.start(ServiceController.java:435)
| at org.jboss.system.ServiceController.start(ServiceController.java:435)
| at org.jboss.system.ServiceController.start(ServiceController.java:435)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy42.start(Unknown Source)
| at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:508)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.RuntimeException: java.util.zip.ZipException: The system cannot find the file specified
| at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:74)
| at org.jboss.util.file.FileProtocolArchiveBrowserFactory.create(FileProtocolArchiveBrowserFactory.java:48)
| at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:57)
| at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:610)
| ... 119 more
| Caused by: java.util.zip.ZipException: The system cannot find the file specified
| at java.util.zip.ZipFile.open(Native Method)
| at java.util.zip.ZipFile.<init>(ZipFile.java:203)
| at java.util.jar.JarFile.<init>(JarFile.java:132)
| at java.util.jar.JarFile.<init>(JarFile.java:97)
| at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:69)
| ... 122 more
As seen in the stacktrace, the relative URL ../myapp2_ejb3.jar is parsed incorrectly which leads to this exception. This problem seems to happen only if the jar file is in exploded format (as a directory). If i zip the jar files as an archive an deploy the same EAR, everything works fine.
Should i open a JIRA with a simple deployable application?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139921#4139921
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139921
16 years, 9 months
[EJB 3.0] - Performance Issues with Entity Beans in EJB 3.0
by the666pack
Hello,
so my application uses ejb 3.0 persistent entities. i am doing some simple performance studies of different application servers and realized that jboss is performing bad, when it is about to write/delete persistent entities.
I believe it is a configuration issue and as far as i can see, the bottleneck is the persistent entity pooling and caching. so my question is how can i tune the cache and pool used for 3.0 entity beans to make my jboss server perform better?
according to the documentation i can change these settings:
#
Container-managed persistence entity version 2.0 = Standard CMP 2.x EntityBean
#
Container-managed persistence entity version 1.1 = Standard CMP EntityBean
#
Bean-managed persistence entity = Standard BMP EntityBean
but i did not find a setting for ejb 3.0 beans. By the way i am using JBoss 4.2.1.
any help is appreciated, thanks a lot!
greetings,
mario
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139908#4139908
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139908
16 years, 9 months
[JBoss Getting Started Documentation] - Can't build using ant
by leonidMir
Hi all,
I am new to Jboss.
I am trying to build Jboss 5 beta 4 using ant.
I followed the installation documentation but still getting the following errors after running ant from the build dir:
anonymous wrote : compile-classes:
| [javac] Compiling 137 source files to C:\jboss-5.0.0.Beta4-src\j2se\output\classes
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\loading\support\Trivial.java:27: cannot find symbol
| symbol: class TrivialMBean
| public class Trivial implements TrivialMBean
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\loading\support\Trivial2.java:27: cannot find symbol
| symbol: class Trivial2MBean
| public class Trivial2 implements Trivial2MBean
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\metadata\support\Trivial.java:24: cannot find symbol
| symbol: class TrivialMBean
| public class Trivial implements TrivialMBean
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:48: package org.jboss.test.jmx.compliance.monitor.support does not exist
| import org.jboss.test.jmx.compliance.monitor.support.CounterSupport;
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:49: package org.jboss.test.jmx.compliance.monitor.support does not exist
| import org.jboss.test.jmx.compliance.monitor.support.GaugeSupport;
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:50: package org.jboss.test.jmx.compliance.monitor.support does not exist
| import org.jboss.test.jmx.compliance.monitor.support.MonitorSupport;
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:51: package org.jboss.test.jmx.compliance.monitor.support does not exist
| import org.jboss.test.jmx.compliance.monitor.support.StringSupport;
| ^
| C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:89: cannot find symbol
| symbol : class MonitorSupport
| location: class org.jboss.test.jmx.compliance.monitor.MonitorTestCase
| MonitorSupport monitored;
| .
| .
| .
| .
| .
|
| Note: Some input files use unchecked or unsafe operations.
| Note: Recompile with -Xlint:unchecked for details.
| 100 errors
| 12 warnings
|
| BUILD FAILED
|
| C:\jboss-5.0.0.Beta4-src\j2se\build.xml:143: Compile failed; see the compiler error output for details.
| at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:999)
| at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:820)
| at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
| at org.apache.tools.ant.Task.perform(Task.java:348)
| at org.apache.tools.ant.Target.execute(Target.java:357)
| at org.apache.tools.ant.Target.performTasks(Target.java:385)
| at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
| at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
| at org.jboss.tools.buildmagic.task.CallTarget.execute(CallTarget.java:141)
| at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
| at org.apache.tools.ant.Task.perform(Task.java:348)
| at org.apache.tools.ant.Target.execute(Target.java:357)
| at org.apache.tools.ant.Target.performTasks(Target.java:385)
| at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
| at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
| at org.jboss.tools.buildmagic.task.Ant.execute(Ant.java:261)
| at org.jboss.tools.buildmagic.task.module.ExecuteModules$1.run(ExecuteModules.java:361)
| at org.jboss.tools.buildmagic.task.module.ExecuteModules.executeModule(ExecuteModules.java:376)
| at org.jboss.tools.buildmagic.task.module.ExecuteModules.execute(ExecuteModules.java:241)
| at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
| at org.apache.tools.ant.Task.perform(Task.java:348)
| at org.apache.tools.ant.Target.execute(Target.java:357)
| at org.apache.tools.ant.Target.performTasks(Target.java:385)
| at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
| at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
| at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
| at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
| at org.apache.tools.ant.Main.runBuild(Main.java:698)
| at org.apache.tools.ant.Main.startAnt(Main.java:199)
| at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
| at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Someone familiar with that error?
Regards,
Leonid M.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139907#4139907
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139907
16 years, 9 months