Avatar billede fredand Forsker
08. marts 2015 - 21:28 Der er 3 kommentarer

Problems with classloading in JBoss 5.2

Hello Guys!

We are migrating a system from Jboss 5.0 to JBoss 5.2. Our JBoss 5.0 has been running under JRE 1.6 and our JBoss 5.2 is now running under JRE 1.7

Our system consists of:
company-app.ear
- company-app.jar
- company-interface.jar

company-web.war
- company-web.jar
- company-interface.jar

Both files are deployed in the deploy-folder.

The company-web.war calls methods, in company-app.ear through JNDI, that returns object from the common jar-file company-interface.jar.

But when the objects arrives at the company-web.war I get: ClassCastException: my.company.Object cannot be cast to my.company.Object

I guess there is some problem with the classloading.

We did not experience this problem with JBoss 5.0.

Do you guys see what might be the problemo?

Best regards
Fredrik
Avatar billede arne_v Ekspert
08. marts 2015 - 22:18 #1
Is it an option do package it like:

company-app.ear
- company-app.jar
- company-interface.jar
- company-web.war
-- company-web.jar

?

I would expect that to work on both 5.0 and 5.2!
Avatar billede arne_v Ekspert
08. marts 2015 - 22:21 #2
The extremely dirty hack is:

company-app.ear
- company-app.jar

company-web.war
- company-web.jar

and company-interface.jar in an app server dir
Avatar billede fredand Forsker
09. marts 2015 - 07:48 #3
Hello Arne!
Thanks for your reply!

Unfortenately I can not pack them all in one ear, because the server and the web got there own lifecycle. They can often get delivered at different times.

I also thought of the server-lib solution. But for the same reson as above and because of that we also got this problem for serveral shared interface-lib between the server and clients. That would give us too many "deliverables". But Perhaps this is the only way.

How ever I think it is strange that we do not got this problem in 5.0. To me it Sounds like some server-config, but I have not find anything that configure this behavior.
Best regards
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester