0 Replies Latest reply on Sep 11, 2012 9:21 AM by take-a-cookie

    migrating from AS5 to AS7: .ear gets deployed, but won´t work

    take-a-cookie

      Hi,

      I am new to Jboss AS 7 (+gate-in) and servers in general and asking a community. I am trying to migrate a “.ear” file form AS5 to AS7.1. I rebuild my file according to the description in a tutorial. Just the ejb und the war file are in “root”, the rest of the application is in a “lib” folder. The log-file is telling me that my file is deployed, but I cannot call the service ("There is no any resources matched to request path /integrationServices"). I am using the GateIn-3.3.0-GA-jbossas7.1 as Server.

       

      text --> solved by deploying the datasource as a module

       

      The original 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_5.xsd" id="Application_ID" version="5">

       

      <display-name>FSIntegration</display-name>

      <module>

          <web>

      <web-uri>PresentationPortlet.war</web-uri>

      <context-root>PresentationPortlet</context-root>

          </web>

        </module>

        <module>

          <java>RestService.jar</java>

        </module>

        <module>

      <ejb>TransformationService.jar</ejb>

        </module>

      <library-directory>shared</library-directory>

      </application>

       

      Original file structure:

       

           FSInteration.ear

           |_> META-INF

           |_> PresentationPortlet.war

           |_> shared

                  |_>Shared.jar

                  |_> jsoup-1.6.1.jar

           |_> TransforamtionService.jar

           |_> FSIntegration.ear

           |_> RestService.jar

       

      The new application.xml:

       

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

      <application xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      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_5.xsd"

      id="Application_ID"

      version="5">

       

        <display-name>FSIntegration</display-name> 

        <module>

      <ejb>TransformationService.jar</ejb>

        </module>

        <module>

          <web>

            <web-uri>PresentationPortlet.war</web-uri>

      <context-root>PresentationPortlet</context-root>

          </web>

        </module>

      <library-directory>lib</library-directory>

      </application>

       

      New file structure: 

       

           FSInteration.ear

           |_> META-INF

           |_> PresentationPortlet.war

           |_> lib

                 |_> jsoup-1.6.1.jar

                 |_>RestService.jar

                 |_>Shared.jar

           |_> TransforamtionService.jar

       

       

       

      I get the following errors and warnings:

       

      11:58:15,071 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.jdbc-driver.hsqldb-2_2_8_jar (missing) dependents: [service jboss.data-source.java:/fsMigrationDB]

      ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.0.Final "Thunder" started (with errors) in 5120ms - Started 139 of 213 services (2 services failed or missing dependencies, 70 services are passive or on-demand)

      11:33:10,956 INFO  [exo.jcr.component.ext.NodeRepresentationService] (MSC service thread 1-5) NodeRepresentationFactory added nt:resource org.exoplatform.services.jcr.ext.resource.representation.NtResourceNodeRepresentationFactory

      11:33:11,396 WARN [org.exoplatform.services.resources] (MSC service thread 1-5) Cannot load and merge the bundle: Resource

      11:33:17,958 INFO [exo.jcr.component.ext.NodeRepresentationService] (MSC service thread 1-5) NodeRepresentationFactory added nt:resource org.exoplatform.services.jcr.ext.resource.representation.NtResourceNodeRepresentationFactory

      11:33:18,068 WARN [org.exoplatform.services.resources] (MSC service thread 1-5) Cannot load and merge the bundle: Resource

      Last output:

       

      11:58:44,296 INFO  [exo.kernel.container.ExoContainer] (MSC service thread 1-2) The portal container 'portal' has been created successfully

      11:58:44,515 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "hsqldb-2.2.8.jar"

      11:58:44,516 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "gatein.ear"

      11:58:44,517 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "gatein-sample-skin.war"

      11:58:44,520 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "gatein-sample-portal.ear"

      11:58:44,521 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "gatein-sample-extension.ear"

      11:58:44,522 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "FSIntegration.ear"

      11:58:44,524 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014776:    Newly corrected services:

            service jboss.jdbc-driver.hsqldb-2_2_8_jar (no longer required)

       

      Hi, again =)

       

      after adding ...

       

      <subsystem xmlns="urn:jboss:domain:gatein:1.0">

      <deployment-archives>

      <archive name="gatein.ear" main="true" />

      ...

       

      <archive name="FSIntegration.ear" />

      </deployment-archives>

      ...

      </subsystem>


      to the standalone.xml I got my first real ERROR after trying to call my service.

       

      10:44:49,262 ERROR [com.berg.integration.fs.service.rest.IntegrationServices] (http--127.0.0.1-8080-1) null Import could not be finished.: javax.naming.NameNotFoundException: Name 'fsMigrationDB' not found in context ''

          at org.gatein.naming.util.NamingUtils.nameNotFoundException(NamingUtils.java:109) [gatein-naming-1.0.0.Final.jar:1.0.0.Final]

          at org.gatein.naming.InMemoryNamingStore$NodeTraversingVisitor.visit(InMemoryNamingStore.java:348) [gatein-naming-1.0.0.Final.jar:1.0.0.Final]

          at org.gatein.naming.InMemoryNamingStore$ContextNode.accept(InMemoryNamingStore.java:287) [gatein-naming-1.0.0.Final.jar:1.0.0.Final]

          at org.gatein.naming.InMemoryNamingStore.lookup(InMemoryNamingStore.java:151) [gatein-naming-1.0.0.Final.jar:1.0.0.Final]

          at org.gatein.naming.NamingContext.lookup(NamingContext.java:170) [gatein-naming-1.0.0.Final.jar:1.0.0.Final]

          at org.gatein.naming.NamingContext.lookup(NamingContext.java:204) [gatein-naming-1.0.0.Final.jar:1.0.0.Final]

          at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_26]

          at com.berg.integration.fs.service.rest.IntegrationServices.importData(IntegrationServices.java:142) [RestService.jar:]

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

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]

          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]

          at org.exoplatform.services.rest.impl.method.DefaultMethodInvoker$1.run(DefaultMethodInvoker.java:194) [exo.ws.rest.core-2.2.6-GA.jar:2.2.6-GA]

          ...

       

      the code used at (IntegrationServices.java:142): DataSource dataSource = (DataSource) new InitialContext().lookup("java:/fsMigrationDB");

      I successfully tested the datasource connection with the Administration Console.

       

      In a attempt to fix the problem I deployed my datasource as a module:

       

      <subsystem xmlns="urn:jboss:domain:datasources:1.0">

                      <datasource jndi-name="java:/fsMigrationDB" pool-name="fsMigrationDB" enabled="true" use-java-context="true" use-ccm="true">

                          <connection-url>jdbc:hsqldb:file:D:\FS_JBoss_PI\module\0.2\portal\GI3.3JB7\standalone\data\fs</connection-url>

                          <driver-class>org.hsqldb.jdbcDriver</driver-class>

                          <driver>fsMigrationDB</driver>

                          <pool>

                              <min-pool-size>5</min-pool-size>

                              <max-pool-size>20</max-pool-size>

                          </pool>

                          <security>

                              <user-name>sa</user-name>

                          </security>

                          <statement>

                              <prepared-statement-cache-size>32</prepared-statement-cache-size>

                              <share-prepared-statements>true</share-prepared-statements>

                          </statement>

                      </datasource>

                      <drivers>

                          <driver name="fsMigrationDB" module="org.hsqldb">

                              <xa-datasource-class>org.hsqldb.jdbcDriver</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>

              </subsystem>

       

      This took care of most of the WARN and ERROR messages initially mentioned. (text), but the "new" Error still occures.

      I would be happy about any advice. Thanks

       

      It might be a BUG!  CHECK ----->   http://stackoverflow.com/questions/10717454/jndi-datasource-in-gatein-portlet-on-jboss-7-1

       

      Nachricht geändert durch take-a-cookie