Class defined in war files are in a different scope from classes defined elsewhere. Thus any attempt to instantiate class in a war from anywhere other than inside the war will fail.
P.S. Use the code tags when posting XML content - select the content and click the Code button.
thanks for your help.
If I move the class package.Foo to foo.par entity module, the common.jar under server/default/lib can instantiate the class.
But the package.Foo class needs to access classes defined in the web module, and throws
Is there a way for entity module to access war module? or can I configure some classloader to make it work?
how to package a lib jar into enitty par module and session ejb3 module?
The class scoping is according to the spec - as far as I know there is no way around it (though the scoping does appear to be broken in 5.0 beta4, but I would not rely on that - it should be fixed by GA).
In general the scoping is such that all classes in server/xxx/lib and server/xxx/deploy (other than those in war files) can see each other, but all classes within war files are in their own scopes (though they can see the classes in lib and deploy, but not in other war files). There is an option to limit the scope of classes within containers within the deploy directory (for example, limit the scope of the classes within an ear, specifically so that you can package in the ear different versions of classes that appear elsewhere).