5 Replies Latest reply on Jan 28, 2009 4:10 PM by garfield168

    Migrate J2EE Project EJB 2 from Websphere to JBoss

    garfield168

      Hello,

      We are currently migrating from WebSphere to JBoss. The EAR contains 64 EJB 2.1 projects. We don´t want migrate to EJB3 in the next time. Anyway, do we have to make JAVA code changes (annotations) although we use EJB2.1?

      At the Jboss server start I run into this error:
      10:39:04,000 ERROR [StandardContext] Context [/sw] startup failed due to previous errors

      java.lang.RuntimeException: mapped-name is required for jdbc/myDatasource of deployment myWeb.war
      ...

      But mapped names are only for EJB3, right?

      Please help

      Thanks!

        • 1. Re: Migrate J2EE Project EJB 2 from Websphere to JBoss
          peterj

          It sounds like you are also declaring a data source in a *-ds.xml file. Try this. Bring up JBoss AS without anything deployed. Once it is running (wait for the "started in xxx seconds" message), deploy the *-ds.xml file. If that is nor successful, post the console log entries after "started in" entry.

          If that is successful, deploy your EAR files one at a time, each time waiting for the deployment to complete. The first exception stack trace you hit, post the console log entries that correspond to the deployment of that EAR file, including the stack trace.

          • 2. Re: Migrate J2EE Project EJB 2 from Websphere to JBoss
            garfield168

            Hello,

            thanks for your answer. I found out that I have problems with the workmanager. In WebSphere you must define a workmanager in the administration console. In JBoss I found the file jca-jboss-beans.xml
            but I found nothing in the web about it. I am new to the "annotation thing". Must I define annotations to the java code for JBoss? Can someone give me an example or a documentation link?

            Thanks

            • 3. Re: Migrate J2EE Project EJB 2 from Websphere to JBoss
              peterj

              What is a "workmanager"? There is no such term in JBoss AS (the concept might be there, but under a different name - it is always a good idea to define terms specific to other app servers) I am not sure why you want to modify jca-jboss-beans, other than the fact that it contains the text "workmanager". I doubt that this is the same concept as the "workmanager" in WebSphere.

              You do not need annotations when using EJB 2.x.

              Please go back to what I posted in my previous response, perform the tasks I asked, and post the results that I asked for.

              And it was nice of you to hint that you are using JBoss AS 5.0.

              • 4. Re: Migrate J2EE Project EJB 2 from Websphere to JBoss
                garfield168

                Yes, we try JBoss AS 5 at the moment and we migrate from WebSphere 6.1.

                We use a WorkManager in WebSphere to do background work.

                WorkManager: javax.resource.spi.work.WorkManager;

                In ejb-jar.xml:

                <resource-ref>
                <res-ref-name>wm/MainWorkManager</res-ref-name> <res-type>javax.resource.spi.work.WorkManager</res-type>
                <res-auth>Container</res-auth>
                <res-sharing-scope>Shareable</res-sharing-scope>
                </resource-ref>
                


                We can access the WorkManager in the JAVA code via a JNDI lookup. But with JBoss this seems to be not possible. Anyway, we need a way to
                implement background working in JBoss. I found this:
                http://batrapankaj.wordpress.com/2007/04/27/using-workmanager-in-jboss/
                but I think it is only for JBoss AS 4.

                Error Message when I try to deploy a project with a WorkManager:

                00:33:46,265 WARN [StatelessSessionContainer] No resource manager found for wm/MainWorkManager
                00:33:46,265 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:jndiName=seaw/ScEntry,service=EJB state=Create mode=Manual requiredState=Installed
                java.lang.NullPointerException
                 at org.jboss.ejb.Container.setupEnvironment(Container.java:1325)
                 at org.jboss.ejb.Container.startService(Container.java:901)
                 at org.jboss.ejb.SessionContainer.startService(SessionContainer.java:396)
                 at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
                 at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
                 at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                 at java.lang.reflect.Method.invoke(Unknown Source)
                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                 at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
                 at $Proxy36.start(Unknown Source)


                • 5. Re: Migrate J2EE Project EJB 2 from Websphere to JBoss
                  garfield168

                  Solved: It was not an exception caused by the workmanager but an error in a jboss.xml. In the jboss.xml was a resource reference defined but not in the ejb-jar.xml.