[Design of the JBoss EJB Container] - Exploded deployment EJB problem
by tamilsmani
Hi anyone,
I am trying to deploy an application an exploded format. I have created 3 different projects EAR, JAR (EJB) and WAR. I have configured all 3 different projects in application.xml in EAR project and I referenced in JBOSS server.
The application.xml file entry as follows:
<display-name>VPS_EAR</display-name>
../../../../../../VPS_WORKSPACE\VPS_EJB\classes.jar // The location where my EJB project is exist
<web-uri>/../../../../../VPS_WORKSPACE\VPS_WEB\WebContent</web-uri> // The location where my WEB project is exist
<context-root>/VPS</context-root>
The above configuration is absolutely fine. No issues with that.
I am getting a problem when I started the server and server finds ejb project and start compiling an ejb. The problem was:
12:40:11,884 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.2.2.GA/server/default/deploy/VPS.ear/
12:40:12,650 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=classes.jar
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseArray(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
at org.jboss.aop.annotation.AnnotationElement.getVisibleAnnotation(AnnotationElement.java:88)
Thanx in advance.
Regards
Tamil Selvan.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179416#4179416
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179416
16 years, 2 months
[Design of POJO Server] - Re: JBAS-5895; Processing too many classes
by alesj
"alesj" wrote :
| Looks like ear's lib (or whatever user defines as 'lib')
| should be always strictly excluded in annotation scanning visitor?
I've hacked something of the following,
which I think should/could do the trick:
| public class EarLibExcludeDeployer extends AbstractSimpleVFSRealDeployer<JBossAppMetaData>
| {
| public EarLibExcludeDeployer()
| {
| super(JBossAppMetaData.class);
| setStage(DeploymentStages.POST_CLASSLOADER);
| setOutputs(ResourceFilter.class + ".recurse");
| }
|
| public void deploy(VFSDeploymentUnit unit, JBossAppMetaData jBossAppMetaData) throws DeploymentException
| {
| if (unit.isTopLevel() == false)
| return;
|
| try
| {
| VirtualFile root = unit.getRoot();
| String libDir = jBossAppMetaData.getLibraryDirectory();
| if (libDir == null || libDir.length() == 0) // take 'lib' even on empty
| libDir = "lib";
| VirtualFile lib = root.getChild(libDir);
| if (lib != null)
| {
| ResourceFilter recurseFilter = new UrlExcludeResourceFilter(lib.toURL());
| unit.addAttachment(ResourceFilter.class + ".recurse", recurseFilter, ResourceFilter.class);
| }
| }
| catch (Exception e)
| {
| throw DeploymentException.rethrowAsDeploymentException("Cannot exclude ear's lib.", e);
| }
| }
|
| /**
| * Do exclude based on url.
| */
| private class UrlExcludeResourceFilter implements ResourceFilter
| {
| private URL url;
|
| private UrlExcludeResourceFilter(URL url)
| {
| if (url == null)
| throw new IllegalArgumentException("Null url");
| this.url = url;
| }
|
| public boolean accepts(ResourceContext rc)
| {
| return url.equals(rc.getUrl()) == false;
| }
| }
| }
|
Where this recurse ResourceFilter would
then later on be picked up by FilteredAnnotationEnvironmentDeployer.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179413#4179413
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179413
16 years, 2 months