8 Replies Latest reply on Jan 9, 2012 9:25 AM by ropalka

    Web services not deployed while migrating from Jboss 5 to Jboss 7

    zemunk

      Hi,

       

      I am trying to migrate a project to Jboss 7 but encountered a problem while deployment. The ear is deployed and the database mapping seems to work but the web services are not deployed.

       

      On Jboss 5 the ear structure was the following:

      entities.jar
      services.jar
      META-INF/
      META-INF/application.xml
      lib/
      lib/iText-2.1.7.jar
      lib/jsch-20091230.jar
      

       

      and the application.xml:

      <?xml version="1.0" encoding="ASCII"?>
      <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" version="5">
        <display-name>webshop</display-name>
        
        <!-- Database mapping of the  POJO-Datacontainer -->
        <module>
          <java>entities.jar</java>
        </module>
        
        <!-- 
            Business logic of webshop, 
            SOAP-Webservices
        -->
        <module>
          <ejb>services.jar</ejb>
        </module>
      </application>
      

       

      In jboss 7 the change is that I moved the entities.jar in the ear's lib directory and deleted the module from application.xml.

       

      Thank you for your help!

        • 1. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
          ropalka
          1 of 1 people found this helpful
          • 2. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
            zemunk

            Thank you for your answer!

             

            Unfortunately the info I got was:

             

            {
                "outcome" => "success",
                "result" => {
                    "content" => [{
                        "path" => "deployments/webshop.ear",
                        "relative-to" => "jboss.server.base.dir",
                        "archive" => true
                    }],
                    "enabled" => true,
                    "name" => "webshop.ear",
                    "persistent" => false,
                    "runtime-name" => "webshop.ear",
                    "subsystem" => undefined,
                    "subdeployment" => {"services.jar" => {
                        "subdeployment" => undefined,
                        "subsystem" => undefined
                    }}
                }
            }
            
            • 3. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
              ropalka

              Do you use JAXWS or JAXRPC EJB endpoints?

              Can you show us your (or part of your) code?

               

              The usecase you described should work.

              • 4. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
                zemunk

                JAXWS is used.

                I cannot reveal the details but here's an example of a webservice implementation:

                 

                package webservices;
                
                import java.util.List;
                
                import javax.annotation.security.RolesAllowed;
                import javax.ejb.Stateless;
                import javax.jws.WebMethod;
                import javax.jws.WebParam;
                import javax.jws.WebResult;
                import javax.jws.WebService;
                import javax.persistence.EntityManager;
                import javax.persistence.PersistenceContext;
                import javax.persistence.Query;
                
                import org.jboss.security.annotation.SecurityDomain;
                import org.jboss.ws.api.annotation.WebContext;
                
                import interfaces.ISample;
                import entity.Map1;
                
                @Stateless
                @WebService
                @WebContext(authMethod="BASIC", secureWSDLAccess=false)
                @SecurityDomain("dom")
                @RolesAllowed({"webshop"})
                public class Samplemgmt implements ISample {
                
                    @PersistenceContext(unitName="my_pu")
                    private EntityManager em;
                
                
                    @SuppressWarnings("unchecked")
                    @Override
                    @WebMethod
                    @WebResult(name="my_map1")
                    public List<Map1> getMap1(@WebParam(name="par1")boolean par1) {
                        Query query;
                        if(par1)
                            query = em.createQuery(...);
                        else
                            query = em.createQuery(...);
                        return query.getResultList();
                    }
                }
                
                • 5. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
                  ropalka

                  Can U add

                   

                  <logger category="org.jboss.as.webservices">

                     <level name="TRACE"/>

                  </logger>

                   

                  to standalone/configuration/standalone.xml (or whichever config are you using)

                  and change console-handler level from INFO to TRACE?

                  Then restart the server, deploy your application and send us all the console logs U can see?

                  • 6. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
                    zemunk

                    Here is the log:

                     

                    12:57:09,495 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "webshop.ear"

                    12:57:09,681 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "services.jar"

                    12:57:09,686 INFO  [org.jboss.jpa] (MSC service thread 1-3) read persistence.xml for my_pu

                    12:57:09,688 INFO  [org.jboss.jpa] (MSC service thread 1-3) read persistence.xml for my_pu2

                    12:57:09,689 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to webshop.ear

                    12:57:09,689 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added (default provider) org.hibernate dependency to application deployment (since 2 PU(s) didn't specify jboss.as.jpa.providerModule)

                    12:57:09,690 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added org.hibernate dependency to application deployment

                    12:57:09,690 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to services.jar

                    12:57:09,691 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added (default provider) org.hibernate dependency to application deployment (since 1 PU(s) didn't specify jboss.as.jpa.providerModule)

                    12:57:09,691 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added org.hibernate dependency to application deployment

                     

                    12:57:09,738 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named Foomgmt in deployment unit subdeployment "services.jar" of deployment "webshop.ear" are as follows:
                    
                        java:global/webshop/services/Foomgmt!interfaces.IFoomgmt
                        java:app/services/Foomgmt!interfaces.IFoomgmt
                        java:module/Foomgmt!de.r_kom.intern.interfaces.IFoomgmt
                        java:global/webshop/services/Foomgmt
                        java:app/services/Foomgmt
                        java:module/Foomgmt
                    
                      ------ Continues like that ------
                    

                     

                    12:57:09,746 INFO  [org.jboss.jpa] (MSC service thread 1-4) starting Persistence Unit Service 'webshop.ear#my_pu'

                    12:57:09,747 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-4) HHH00204:Processing PersistenceUnitInfo [

                        name: my_pu

                        ...]

                    12:57:09,943 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-4) HHH00130:Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

                    12:57:09,972 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-4) HHH00400:Using dialect: org.hibernate.dialect.PostgreSQLDialect

                    12:57:09,995 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-4) HHH00424:Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

                    12:57:09,996 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-4) HHH00268:Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

                    12:57:09,996 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-4) HHH00397:Using ASTQueryTranslatorFactory

                    12:57:10,043 INFO  [org.jboss.jpa] (MSC service thread 1-1) starting Persistence Unit Service 'webshop.ear/services.jar#zfa_pu'

                    12:57:10,053 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-1) HHH00204:Processing PersistenceUnitInfo [

                        name: my_pu2

                        ...]

                     

                    12:57:10,078 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-1) HHH00130:Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

                    12:57:10,155 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-1) HHH00400:Using dialect: org.hibernate.dialect.PostgreSQLDialect

                    12:57:10,156 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-1) HHH00424:Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

                    12:57:10,161 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-1) HHH00268:Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

                    12:57:10,162 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-1) HHH00397:Using ASTQueryTranslatorFactory

                    12:57:10,504 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH00228:Running hbm2ddl schema update

                    12:57:10,504 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH00102:Fetching database metadata

                    12:57:10,505 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH00396:Updating schema

                     

                    12:57:10,536 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-4) HHH00261:Table found: ***
                    12:57:10,536 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-4) HHH00037:Columns: [***]
                    12:57:10,536 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-4) HHH00108:Foreign keys: [***]
                    12:57:10,536 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-4) HHH00126:Indexes: [r***]
                    
                      ------ Continues like that ------
                    

                     

                    12:57:12,194 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH00388:Unsuccessful: alter table ****  not null

                    12:57:12,194 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH00388:Unsuccessful: alter table **** add constraint **** foreign key (****) references ****

                    12:57:12,195 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH00232:Schema update complete

                    12:57:12,230 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Replaced deployment "webshop.ear" with deployment "webshop.ear"

                     

                    Notes: the project is inherited from a developer that already left and I have no previous experience with jboss so newbie mistakes are also likely... Please bear with me.

                    • 7. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
                      zemunk

                      The module org.jboss.as.webservices was not included in the standalone.xml config file.

                       

                      I did it using the steps presented in http://jbossws.blogspot.com/2011/07/jboss-as-7-webservices-features.html.

                       

                      I am going to send the error log tomorrow.

                      • 8. Re: Web services not deployed while migrating from Jboss 5 to Jboss 7
                        ropalka

                        Make sure you have WS extension available & enabled in your config.