-
1. Re: Cant load class from one EAR to another
thanz Jan 13, 2009 6:08 AM (in response to thanz)Nobody has a idea ?
-
2. Re: Cant load class from one EAR to another
alesj Jan 13, 2009 6:16 AM (in response to thanz)"thanz@gmx.at" wrote:
Nobody has a idea ?
It's been 3.5h since your initial post.
I guess this is what you need: http://www.jboss.com/services/index
A super golden premium support. ;-) -
3. Re: Cant load class from one EAR to another
vmath Jan 14, 2009 11:17 AM (in response to thanz)In JBoss 5 ear are deployed in isolation by default (see release notes)
in deployers/ear-deployer-jboss-beans.xml<property name="callByValue">true</property> <property name="isolated">true</property>
in 4.0.5 isolated = false, it is probably related
Vincent -
4. Re: Cant load class from one EAR to another
alesj Jan 14, 2009 11:40 AM (in response to thanz)"vmath" wrote:
In JBoss 5 ear are deployed in isolation by default (see release notes)
in deployers/ear-deployer-jboss-beans.xml<property name="callByValue">true</property> <property name="isolated">true</property>
in 4.0.5 isolated = false, it is probably related
That's only true for standard server config,
default still has the same configuration as 4.x - both false. -
5. Re: Cant load class from one EAR to another
alesj Jan 20, 2009 10:05 AM (in response to thanz)I did a mock of your example and I have no NCDFE problems.
But I do get other strange behavior - more about this at the bottom.
My mock's structure:
a.ear
* consumer.jar
** Consumer (@Service)@Service public class Consumer implements ConsumerMBean { @PostConstruct public void create() { System.out.println(consume("Ales")); } public String consume(String name) { return Helper.provide(name); } }
b.ear
* provider.jar
** Helper.class
When I deploy both at the same time:15:57:01,281 INFO [STDOUT] Hello, Ales!
So, consumer knows about Helper, although it's in diff ear.
But what is strange is this - duplicate Consumer initialization.15:57:01,031 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31452591{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:01,031 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31452591{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:01,046 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31452591{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:01,046 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31452591{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:01,046 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29466827{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/b.ear/provider.jar/} 15:57:01,046 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29466827{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/b.ear/provider.jar/} 15:57:01,046 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29466827{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/b.ear/provider.jar/} 15:57:01,093 INFO [JBossASKernel] Created KernelDeployment for: consumer.jar 15:57:01,093 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=a.ear,jar=consumer.jar,name=Consumer,service=EJB3 15:57:01,093 INFO [JBossASKernel] with dependencies: 15:57:01,093 INFO [JBossASKernel] and demands: 15:57:01,093 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService; Required: Described 15:57:01,109 INFO [JBossASKernel] and supplies: 15:57:01,109 INFO [JBossASKernel] Class:org.jboss.acme.consumer.ConsumerMBean 15:57:01,109 INFO [JBossASKernel] jndi:a/Consumer/remote 15:57:01,109 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=a.ear,jar=consumer.jar,name=Consumer,service=EJB3) to KernelDeployment of: consumer.jar 15:57:01,281 INFO [STDOUT] Hello, Ales! 15:57:01,281 INFO [EJBContainer] STARTED EJB: org.jboss.acme.consumer.Consumer ejbName: Consumer 15:57:01,296 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI: 15:57:06,500 INFO [EJBContainer] STOPPED EJB: org.jboss.acme.consumer.Consumer ejbName: Consumer 15:57:06,750 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@19593740{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:06,750 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@19593740{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:06,750 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@19593740{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:06,750 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@19593740{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/a.ear/consumer.jar/} 15:57:06,750 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@22474837{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/b.ear/provider.jar/} 15:57:06,765 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@22474837{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/b.ear/provider.jar/} 15:57:06,765 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@22474837{vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-6.0.0.Alpha1/server/default/deploy/b.ear/provider.jar/} 15:57:06,796 INFO [JBossASKernel] Created KernelDeployment for: consumer.jar 15:57:06,796 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=a.ear,jar=consumer.jar,name=Consumer,service=EJB3 15:57:06,796 INFO [JBossASKernel] with dependencies: 15:57:06,796 INFO [JBossASKernel] and demands: 15:57:06,796 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService; Required: Described 15:57:06,796 INFO [JBossASKernel] and supplies: 15:57:06,812 INFO [JBossASKernel] Class:org.jboss.acme.consumer.ConsumerMBean 15:57:06,812 INFO [JBossASKernel] jndi:a/Consumer/remote 15:57:06,812 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=a.ear,jar=consumer.jar,name=Consumer,service=EJB3) to KernelDeployment of: consumer.jar 15:57:06,843 INFO [STDOUT] Hello, Ales! 15:57:06,843 INFO [EJBContainer] STARTED EJB: org.jboss.acme.consumer.Consumer ejbName: Consumer 15:57:06,859 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
Carlo, ALR, Jaikiran, I doubt this is expected? ;-) -
6. Re: Cant load class from one EAR to another
alrubinger Jan 20, 2009 10:27 AM (in response to thanz)I'll have a look. First impression is that you've got a lifecycle start() on the MBean (one call) and @PostConstruct (2nd call) defined.
What I need to understand is why JBossASKernel is going through the install mechanism twice.
S,
ALR -
7. Re: Cant load class from one EAR to another
alrubinger Jan 20, 2009 10:33 AM (in response to thanz)BTW @PostConstruct isn't spec'd by the docs for @Service.
http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html
S,
ALR -
8. Re: Cant load class from one EAR to another
alesj Jan 20, 2009 10:35 AM (in response to thanz)"ALRubinger" wrote:
I'll have a look. First impression is that you've got a lifecycle start() on the MBean (one call) and @PostConstruct (2nd call) defined.
Yeah, that's sort of it.
If I remove the @PostConstruct, I only get single "Hello".
But if I rename the method, I don't get any.
Does this mean I need @Management?
(not that I really care, since the subject here is classloading, which works :-) -
9. Re: Cant load class from one EAR to another
alrubinger Jan 20, 2009 10:54 AM (in response to thanz)Ales can look at the ClassLoading, but I want to know about this double call to JBossASKernel. That's a big problem, especially since I just fixed a whole bunch of stuff in ServiceContainer/JBossASKernel to ensure that @Service start() is not re-entrant (resulting in double-callbacks).
ie. http://fisheye.jboss.org/changelog/JBossAS/?cs=82684, and the commits that followed it for EJBTHREE-655.
I've run Ales' example here on AS trunk r83097, and only get one call to JBossASKernel install (as expected). So I need a good failing example, unless its possible that something's out of whack with the build on whatever the log below was run.
S,
ALR