6 Replies Latest reply on May 30, 2013 8:39 AM by Gerhard Visagie

    Switchyard Packaging options

    Gerhard Visagie Newbie

      I have formally started a project now with switchyard, and the first step was to seperate some of the supporting code I need into another project and include it with maven in the switchyard project. No problem there.

      However the default POM for switchyard in eclipse generates a JAR, which wont include my seperated jar file.

       

      If I change the POM to generate an EAR I get a classnotfound for NettyLoggerConfigurator

       

      11:13:38,772 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-15) MSC00001: Failed to start service jboss.pojo."org.jboss.netty.internal.Logge

      rConfigurator".DESCRIBED: org.jboss.msc.service.StartException in service jboss.pojo."org.jboss.netty.internal.LoggerConfigurator".DESCRIBED: java.lan

      g.ClassNotFoundException: org.jboss.netty.container.microcontainer.NettyLoggerConfigurator from [Module "deployment.MPowaPOSToGateway-0.0.1-SNAPSHOT.e

      ar:main" from Service Module Loader]

              at org.jboss.as.pojo.service.DescribedPojoPhase.start(DescribedPojoPhase.java:73)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

      Caused by: java.lang.ClassNotFoundException: org.jboss.netty.container.microcontainer.NettyLoggerConfigurator from [Module "deployment.MPowaPOSToGatew

      ay-0.0.1-SNAPSHOT.ear:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

              at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_21]

              at java.lang.Class.forName(Class.java:266) [rt.jar:1.7.0_21]

              at org.jboss.as.pojo.service.DescribedPojoPhase.start(DescribedPojoPhase.java:69)

              ... 5 more

        • 1. Re: Switchyard Packaging options
          Keith Babo Master

          The tooling does not directly support packaging as an EAR at this stage.  I recommend you build the application as a JAR using the tooling and then separately package that JAR inside of an EAR with the other dependencies you want to include.  Another option would be to deploy your supporting code separately (as a deployment or an AS 7 module) and then declare a dependency on that from your SY application.

          1 of 1 people found this helpful
          • 2. Re: Switchyard Packaging options
            Gerhard Visagie Newbie

            Thanks Keith;

             

            I tried the ear route, however the RESTeasy interfaces I have is not being deployed. In fact I have the distinct feeling the contents of the ear is not being deployed either. Here is the output from the log:

             

            13:12:16,579 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 39) JBAS011800: Activating Naming Subsystem

            13:12:16,589 INFO  [org.switchyard] (ServerService Thread Pool -- 51) Activating SwitchYard Extension

            13:12:16,589 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 27) JBAS016200: Activating ConfigAdmin Subsystem

            13:12:16,597 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013101: Activating Security Subsystem

            13:12:16,599 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.

            13:12:16,613 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 40) JBAS011940: Activating OSGi Subsystem

            13:12:16,616 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 49) JBAS015537: Activating WebServices Extension

            13:12:16,616 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final

            13:12:16,642 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service

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

            13:12:16,654 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-13) JBAS015400: Bound mail session [java:jboss/mail/Default]

            13:12:16,775 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

            13:12:16,803 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA

            13:12:16,933 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-16) Starting Coyote HTTP/1.1 on http--10.202.15.39-8080

            13:12:17,037 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015876: Starting deployment of "switchyard-quickstart-remote-invoker.jar"

            13:12:17,041 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on /10.202.15.39:4447

            13:12:17,041 INFO  [org.jboss.as.remoting] (MSC service thread 1-10) JBAS017100: Listening on /10.202.15.39:9999

            13:12:17,049 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-16) JBAS015012: Started FileSystemDeploymentService for directory D:\servers\switchyard-as7-0.8\standalone\deployments

            13:12:17,065 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/jbpmDS]

            13:12:17,065 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

            13:12:17,127 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016002: Processing weld deployment switchyard-quickstart-remote-invoker.jar

            13:12:17,165 INFO  [org.jboss.weld.deployer] (MSC service thread 1-16) JBAS016005: Starting Services for CDI deployment: switchyard-quickstart-remote-invoker.jar

            13:12:17,208 INFO  [org.jboss.weld.Version] (MSC service thread 1-16) WELD-000900 1.1.6 (Final)

            13:12:17,221 INFO  [org.switchyard] (MSC service thread 1-16) Deploying SwitchYard application 'switchyard-quickstart-remote-invoker.jar'

            13:12:17,226 INFO  [org.jboss.weld.deployer] (MSC service thread 1-14) JBAS016008: Starting weld service for deployment switchyard-quickstart-remote-invoker.jar

            13:12:17,491 INFO  [org.switchyard] (MSC service thread 1-3) Starting SwitchYard service

            13:12:17,637 INFO  [org.apache.camel.management.ManagementStrategyFactory] (MSC service thread 1-3) JMX enabled.

            13:12:17,650 INFO  [org.switchyard.security.SecurityProvider] (MSC service thread 1-3) Using SecurityProvider implementation: org.switchyard.security.jboss.JBossJaasSecurityProvider

            13:12:17,652 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Apache Camel 0.8.0.Final (CamelContext: camel-1) is starting

            13:12:17,653 INFO  [org.apache.camel.management.DefaultManagementLifecycleStrategy] (MSC service thread 1-3) StatisticsLevel at All so enabling load performance statistics

            13:12:17,730 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-3) Loaded 179 type converters

            13:12:17,741 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Total 0 routes, of which 0 is started.

            13:12:17,742 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Apache Camel 0.8.0.Final (CamelContext: camel-1) started in 0.089 seconds

            13:12:17,754 INFO  [org.switchyard.component.sca.deploy.SCAActivator] (MSC service thread 1-3) Unable to resolve cache-container cluster.  clustering for <binding.sca> will not be available for services and references.

            13:12:17,999 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-3) Loaded 179 type converters

            13:12:18,344 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Route: direct:{urn:com.example.switchyard:switchyard-quickstart-remote-invoker:1.0}CreditCheck started and consuming from: Endpoint[direct://%7Burn:com.example.switchyard:switchyard-quickstart-remote-invoker:1.0%7DCreditCheck]

            13:12:19,256 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Route: direct:{urn:com.example.switchyard:switchyard-quickstart-remote-invoker:1.0}Dealer started and consuming from: Endpoint[direct://%7Burn:com.example.switchyard:switchyard-quickstart-remote-invoker:1.0%7DDealer]

            13:12:19,348 INFO  [org.switchyard.as7.extension.cluster.RemoteEndpointListener] (MSC service thread 1-3) Published Remote Service Endpoint /switchyard-remote

            13:12:19,355 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "switchyard-quickstart-remote-invoker.jar"

            13:12:19,362 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015876: Starting deployment of "MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear"

            13:12:20,311 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jaxb-api.jar in "/D:/servers/switchyard-as7-0.8/bin/content/MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear/lib/jaxb-impl-2.2.4.jar"  does not point to a valid jar for a Class-Path reference.

            13:12:20,313 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry activation.jar in "/D:/servers/switchyard-as7-0.8/bin/content/MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear/lib/jaxb-impl-2.2.4.jar"  does not point to a valid jar for a Class-Path reference.

            13:12:20,315 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jsr173_1.0_api.jar in "/D:/servers/switchyard-as7-0.8/bin/content/MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear/lib/jaxb-impl-2.2.4.jar"  does not point to a valid jar for a Class-Path reference.

            13:12:20,319 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jaxb1-impl.jar in "/D:/servers/switchyard-as7-0.8/bin/content/MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear/lib/jaxb-impl-2.2.4.jar"  does not point to a valid jar for a Class-Path reference.

            13:12:20,330 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015893: Encountered invalid class name 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'

            13:12:20,333 INFO  [org.jboss.as.pojo] (MSC service thread 1-15) JBAS017000: Found legacy bean/pojo namespace: urn:jboss:bean-deployer:2.0 - might be missing some xml features (potential exceptions).

            13:12:20,462 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear

            13:12:20,475 INFO  [org.jboss.weld.deployer] (MSC service thread 1-10) JBAS016005: Starting Services for CDI deployment: MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear

            13:12:20,479 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starting weld service for deployment MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear

            13:12:20,700 INFO  [org.jboss.as] (MSC service thread 1-15) JBAS015951: Admin console listening on http://10.202.15.39:9990

            13:12:20,701 INFO  [org.jboss.as] (MSC service thread 1-15) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 5123ms - Started 211 of 292 services (79 services are passive or on-demand)

            13:12:20,746 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "MPowaPOSToGatewayEAR-0.0.1-SNAPSHOT.ear"

            • 3. Re: Switchyard Packaging options
              Keith Babo Master

              Can you attach the EAR or provide a listing of its content?  Are the RESTEasy interfaces part of the SY app (via REST gateway) or are they distinct JAX-RS endpoints?

              • 4. Re: Switchyard Packaging options
                Gerhard Visagie Newbie

                Yes, its part of the SY app. I attched the the ear to the original post I made here.

                • 5. Re: Switchyard Packaging options
                  Keith Babo Master

                  I was referring to the EAR you created following my instructions to construct the EAR separately and add the SY app to it.  The EAR you attached in the original post contains the complete dependency chain of your app in lib/ including the switchyard modules.  These are already in the SY runtime as AS modules.  Here are the steps:

                   

                  1) build your app as a jar

                  2) create a separate project/folder somewhere else for the EAR

                  3) add the switchyard jar to the root of the ear

                  4) add any extra dependencies you have (not jars which are already present in the runtime) to lib/

                  5) define an application.xml which contains a module entry for the switchyard jar in (3)

                  • 6. Re: Switchyard Packaging options
                    Gerhard Visagie Newbie

                    Bah, thanks for picking that up. I used a generated a ear project in eclipse using maven and just included everything in there. My assumption was that it would just be right. Never bothered to check the EAR.