-
1. Re: Jboss EAP 6.1 classloader
jaikiran Sep 10, 2013 8:23 AM (in response to surendrand001)What exactly are you trying to do?
-
2. Re: Jboss EAP 6.1 classloader
luan.cestari Sep 10, 2013 9:08 AM (in response to surendrand001)By default, all modules (WAR,EJBs,etc) can see each other. Probably this can solve your problem =)
-
3. Re: Jboss EAP 6.1 classloader
wdfink Sep 10, 2013 2:48 PM (in response to surendrand001)Does the Classloading documentation help?
-
4. Re: Jboss EAP 6.1 classloader
surendrand001 Sep 10, 2013 3:14 PM (in response to jaikiran)I am migrating our application from jboss eap 4 to eap 6.
got stuck with the problem java.lang.IllegalAccessError Jboss EAP 6.1
where we have 2 ejb jars inside an ear. with same package names but protected method's
Since the class loaders are different for each ear, I got IllegalAccessError.
<ear-subdeployments-isolated>false</ear-subdeployments-isolated> doesnot help as this issue occurs due to classloading not because of dependancy. Also I cannot cannot change my protected to public due to design constraints in my project.
Now looking to deploy my EAR in Jboss EAP 6.1 so that a single classloader loads all my EJB jar from my EAR.
-
5. Re: Jboss EAP 6.1 classloader
sfcoy Sep 11, 2013 2:50 AM (in response to surendrand001)Did you try Java7 as I suggested in the other thread?
-
6. Re: Jboss EAP 6.1 classloader
surendrand001 Sep 11, 2013 3:16 AM (in response to sfcoy)I tried with Java 7 and still ran into the same exception.
-
7. Re: Jboss EAP 6.1 classloader
jaikiran Sep 11, 2013 3:36 AM (in response to surendrand001)Surendran Duraisamy wrote:
I am migrating our application from jboss eap 4 to eap 6.
got stuck with the problem java.lang.IllegalAccessError Jboss EAP 6.1
where we have 2 ejb jars inside an ear. with same package names but protected method's
Are those classes EJB components or some plain Java classes used by the EJBs? If it's the latter then you could create a JBoss module and include 2 jars containing those classes as the resource roots of that module. Finally, you can then include that module as a dependency in your application deployment.
-
8. Re: Jboss EAP 6.1 classloader
jaikiran Sep 11, 2013 3:38 AM (in response to jaikiran)Infact, you could even create those 2 jars containing the same named package classes and place those jars in the .ear/lib folder.
-
9. Re: Jboss EAP 6.1 classloader
sfcoy Sep 11, 2013 4:55 AM (in response to surendrand001)surendrand001 wrote:
...
Also I cannot cannot change my protected to public due to design constraints in my project.
...
The design constraints are based upon a faulty premise. Unless someone else comes up with another workable solution, you're going to have to bite the bullet and:
- Merge the two EJB jars into a single jar
or
- Change the declarations from protected to public
If the particular classes that have the problem are *not* EJBs, then the suggestion by jaikiran is the way to go, because all jars in the EAR/lib directory share the same classloader.
-
10. Re: Jboss EAP 6.1 classloader
surendrand001 Sep 11, 2013 5:20 AM (in response to sfcoy)I my case both jar files are EJB's. Session bean on jar1 calling entity bean on jar2.
Unfortunately I cannot pack them into a single jar also (due to another internal constraint occurred while packing into a single jar ).
Is it possible to override the existing jboss behavior(each EJB jar loaded in separate class loader) and modify so that a single classloader loads all my EJB jars. Is it possible achieve this single class loader behavior in Jboss EAP 6, either through any configuration / writing our own classloaders
-
11. Re: Jboss EAP 6.1 classloader
jaikiran Sep 11, 2013 6:03 AM (in response to surendrand001)Surendran Duraisamy wrote:
Is it possible to override the existing jboss behavior(each EJB jar loaded in separate class loader) and modify so that a single classloader loads all my EJB jars.
No, not unless you repackage them.
Surendran Duraisamy wrote:
Is it possible achieve this single class loader behavior in Jboss EAP 6, either through any configuration / writing our own classloaders
I think, along with your team, you might have to review the design/packaging decisions that have been done. Writing custom classloaders or trying to think of other hacky ways to fix this is, is an unnecessarily complicated way to solve this, IMO.
-
12. Re: Jboss EAP 6.1 classloader
dvrajitha Sep 9, 2016 4:57 AM (in response to sfcoy)During my migration i came across following error, What could be the issue?
: java.lang.IllegalAccessError: tried to access class org.jboss.seam.log.LogImpl from class org.jboss.seam.log.Logging