This content has been marked as final. Show 4 replies
This is only happened when I tried to use faceMessages in the EJB. seems the JBoss5.1 classloader has different behaviours than JBoss4.2.x?
Really need helps.
I have tested JBoss4.2.3GA, JBoss5.0.1GA, JBoss5.1.0GA, JBoss6.0M1, if put the messages_*.properties in the .war/WEB-INF/classes/ folder, it only works with JBoss4.2.
It seems the JBoss class loader caused the problem, basicly JBoss5 up, the war class loader is different with ejb's class loader (event if you put in the jboss-app.xml and tell it to use the same class loader).
So here is a work around:
split the messages into 2 parts, all the messages that will be used in the EJB has to packaged in a jar file (in my case, called app-shared-messages.jar, and put the messages in the root of that jars), put the jars into your .ear/lib folder.
now add the resources file into the components.xml (suppose your message file name is application-ejb-messages_en.properties):
It's ugly, but it works on all the server, no need any tricks.
<I'm sure next time if I hit the wall it will be harder>
Why don't you just put messages_en.properties into either jar or ear file?
I think you're supposed to use StatusMessages now.