5 Replies Latest reply: Feb 28, 2012 6:31 AM by Heikki Rauhala RSS

jboss-common-core, transitive dependency of test-scoped profile service, gets into war

John Franey Novice

FYI:

 

I have a war project that is packaged into an ear.  I am using maven for my builds.  My war project has arquillian unit tests and has a test-scoped dependency on org.jboss.jbossas:jboss-as-profileservice-client.

 

If I don't exclude org.jboss:jboss-common-core, it is bundled into the target production war, which is a mistake.  It would otherwise not be deployed as part of a seam application.  When the ear is deployed, and app is accessed, we get a failed jndi lookup on the entity manager factory, and consequently an NPE.

 

Ouch.

 

I don't know why maven is packaging jboss-common-core, a transitive dependency on a test-scoped direct dependency into my war.  I wish I did know.  I think it is a secret held tightly by the maven war plugin.  I'm posting here as FYI.  I don't think this the right forum to expect an answer.  But of course, the thread is open to anyone that may have resolved this in a different way.

 

 

 

arquillian 1.0.0.CR4.

 

 

 

Here is the stack trace:

 

14:27:25,137 WARN  [org.jboss.seam.security.jaas.SeamLoginModule] Error invoking login method: javax.el.ELException: java.lang.NullPointerException

          at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339) [:1.0_02.CR5]

          at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348) [:1.0_02.CR5]

          at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) [:1.0_02.CR5]

          at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) [:1.0_02.CR5]

....

     at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]

Caused by: java.lang.NullPointerException

          at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:79) [:2.2.2.Final]

          at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:108) [:2.2.2.Final]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]

          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [:2.2.2.Final]

          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [:2.2.2.Final]

          at org.jboss.seam.Component.callComponentMethod(Component.java:2275) [:2.2.2.Final]

          at org.jboss.seam.Component.unwrap(Component.java:2301) [:2.2.2.Final]

          at org.jboss.seam.Component.getInstance(Component.java:2044) [:2.2.2.Final]

          at org.jboss.seam.Component.getInstance(Component.java:1986) [:2.2.2.Final]

          at org.jboss.seam.Component.getInstance(Component.java:1980) [:2.2.2.Final]

          at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2375) [:2.2.2.Final]

          at org.jboss.seam.Component.getValueToInject(Component.java:2327) [:2.2.2.Final]

          at org.jboss.seam.Component.injectAttributes(Component.java:1739) [:2.2.2.Final]

          at org.jboss.seam.Component.inject(Component.java:1557) [:2.2.2.Final]

......