2 Replies Latest reply on Jan 29, 2013 2:32 PM by anton123

    Unresolved compilation problems

    anton123 Newbie

      Hi community,

      I am facing a problem, when calling a deployed ear with a client.

       

      jar -tf TestEAR.ear returns

       

      META-INF

      META-INF/application.xml

      META-INF/jboss-deployment-structure.xml

      TestEarEjb.jar

       

      Also I have a test.jar under the following structure:

       

      modules/de/jbosstest/main with a module file. and a test.jar.

       

      application.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" id="Application_ID" version="6">

        <display-name>TestEAR</display-name>

        <module>

          <ejb>TestEarEjb.jar</ejb>

        </module>

      </application>

       

      jboss-deployment-structure.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

          <deployment>

              <dependencies>

                    <module name="de.jbosstest" slot="main" export="true"/>

              </dependencies>

          </deployment>

      <!--       <sub-deployment name="TestEarEjb.jar">

              <dependencies>

                    <module name="de.jbosstest" slot="main" />

              </dependencies>

            </sub-deployment>

      --></jboss-deployment-structure>

       

      module.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.1" name="de.jbosstest">

          <resources>

              <resource-root path="test.jar"/>

          </resources>

      </module>

       

      the problem is, that I am able to deploy my ear without any problems and I can invoke the remote method with my client if I add

      test.jar under a lib folder in my ear. But what I need is that I can load it dynamically from the module path.

       

      Here is the complete stacktrace of the Jboss Server:

       

      22:13:48,722 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

      22:13:49,034 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

      22:13:49,112 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

      22:13:50,407 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)

      22:13:50,407 INFO  [org.xnio] XNIO Version 3.0.3.GA

      22:13:50,422 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA

      22:13:50,454 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA

      22:13:50,501 INFO  [org.jboss.as.configadmin] JBAS016200: Activating ConfigAdmin Subsystem

      22:13:50,517 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

      22:13:50,532 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

      22:13:50,532 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100: Current PicketBox version=4.0.7.Final

      22:13:50,579 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem

      22:13:50,688 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

      22:13:50,735 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

      22:13:50,751 INFO  [org.jboss.as.connector] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

      22:13:50,860 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

      22:13:51,047 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      22:13:51,156 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service

      22:13:51,359 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.2.GA

      22:13:51,375 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]

      22:13:51,624 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory D:\jboss-as-7.1.1.Final\standalone\deployments

      22:13:51,624 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found TestEAR.ear in deployment directory. To trigger deployment create a file called TestEAR.ear.dodeploy

      22:13:51,750 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on localhost/127.0.0.1:4447

      22:13:51,766 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999

      22:13:51,766 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080

      22:13:51,984 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      22:13:52,031 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "TestEAR.ear"

      22:13:52,093 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "TestEarEjb.jar"

      22:13:52,359 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named MyTest in deployment unit subdeployment "TestEarEjb.jar" of deployment "TestEAR.ear" are as follows:

       

          java:global/TestEAR/TestEarEjb/MyTest!de.mein.test.MyTestRemote

          java:app/TestEarEjb/MyTest!de.mein.test.MyTestRemote

          java:module/MyTest!de.mein.test.MyTestRemote

          java:jboss/exported/TestEAR/TestEarEjb/MyTest!de.mein.test.MyTestRemote

          java:global/TestEAR/TestEarEjb/MyTest

          java:app/TestEarEjb/MyTest

          java:module/MyTest

       

      22:13:52,655 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990

      22:13:52,655 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 4339ms - Started 186 of 265 services (78 services are passive or on-demand)

      22:13:52,859 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "TestEAR.ear"

      22:14:03,389 ERROR [org.jboss.ejb3.invocation] (EJB default - 1) JBAS014134: EJB Invocation failed on component MyTest for method public abstract void de.mein.test.MyTestRemote.print(): javax.ejb.EJBException: Unexpected Error

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:163) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:80) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:302) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$200(MethodInvocationMessageHandler.java:64) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:196) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.6.0_33]

          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [rt.jar:1.6.0_33]

          at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.6.0_33]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_33]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]

          at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: java.lang.Error: Unresolved compilation problems:

          de.jbosstest cannot be resolved to a type

          de.jbosstest cannot be resolved to a type

       

          at de.mein.test.MyTest.print(MyTest.java:24) [TestEarEjb.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_33]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33]

          at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_33]

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          ... 27 more

       

      I can provide additional info, if needed.

       

      Thank you.

        • 1. Re: Unresolved compilation problems
          jaikiran pai Master

          Anton, welcome to the forums.

           

          Like the logs say:

           

          Caused by: java.lang.Error: Unresolved compilation problems:

              de.jbosstest cannot be resolved to a type

              de.jbosstest cannot be resolved to a type

           

              at de.mein.test.MyTest.print(MyTest.java:24) [TestEarEjb.jar:]

          There's a compilation error in your MyTest class, which you need to fix and rebuild the application and deploy it.

          • 2. Re: Unresolved compilation problems
            anton123 Newbie

            Hi jaikiran,

            thank you for answering.

            The problem is clear to me, but I don`t know how to solve it. If I have the test.jar in my lib folder within my ear the de.jbosstest.Test is resolved. I am able to deploy it and everything works fine.

            Now I want to use the new module concept and put the test.jar file into a folder under modules as described above and the Exception Stacktrace arises. I really had an extensive look in the forums and tried several combinations with manifest or jboss-deployment-structure.xml but nothing worked.

            I am working with Eclipse and the error is shown in my eclipse environment that the de.jbosstest.Test cannot be resolved. But isn`t the test.jar file under modules loaded dynamically from JBoss?

             

            I tried the same with a web project (war in ear) to avoid that I am to stupid to load the jar over the modules way and there it worked, although Eclipse shows also that de.jbosstest.Test is not resolved.