9 Replies Latest reply on Jan 12, 2016 3:13 AM by ramandeep

    Issue in SwitchYard project build and deployment on JBoss EAP Linux environment

    ramandeep

      I have developed a SwitchYard project on JBoss Developer studio integrated with JBoss EAP. Its running fine when I launch the project from Studio i.e by right clicking on project and run as on server.

      Now, I need to deploy the same project on Linux environment. JBoss EAP is already setup, we dont have maven on linux.

      So my question is how can I take the JAR/WAR/EAR file from Jboss Developer Studio to deploy on separate JBoss EAP linux environment.

       

      I have already tried using JAR file from runtime of JBOSS EAP of Developer studio and deploying that on JBoss eap of linux. But no luck. Its giving errors as shown below

       

      02:32:33,065 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."POC.jar".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."POC.jar".WeldStartService: Failed to start service
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_75]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_75]
              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]
      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [ConsumeInvoicedetails] with qualifiers [@Reference] at injection point [[field] @Inject @Reference private com.example.switchyard.POC.GetInvoiceDetailsBean.restService]
              at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
              at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
              at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
              at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
              at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
              at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
              at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
              at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
              ... 3 more
      
      

      * I am not using anything such as WELD.

       

       

       

      Can you guys please help me in finding out how can I achieve this deployment ?

       

      Thanks

      Raman

        • 1. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
          rick_wagner

          Hi Raman,

          Your methodology is sound-- you should be able to take the .jar and deploy it as you would any other application in EAP.  You might try two steps:
          1)  Validate your SwitchYard installation.  This can be done by building one of the 'quickstarts' from the command line, then deploying it to EAP in the same way.  If this test fails, you know your problem lies in the way SwitchYard has been installed.  If this step succeeds, you know the problem is in the POC application.

          2)  You might also try to build your POC application from the command line (using 'mvn clean package'), then deploy the resulting JAR.  Sometimes JBDS makes something unpalatable.

          Good luck, success is probably a short distance away!

          Rick

          • 2. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
            tcunning

            Raman,

             

            What version of EAP and what version of SwitchYard are you using on Linux?

            • 3. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
              ramandeep

              Tom,

               

              EAP version is JBoss EAP 6.1 and switchyard is switchyard-installer-eap-2.0.0.Final

              • 4. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
                ramandeep

                Rick,

                I tried building quick start application using maven it did not work for me .I tried the one present here .jbdevstudio\runtimes\jboss-eap\quickstarts\demos\orders but it didnt work .

                 

                 

                [ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.3.1 or one of it
                s dependencies could not be resolved: Failed to read artifact descriptor for org
                .apache.maven.plugins:maven-enforcer-plugin:jar:1.3.1: Could not transfer artifa
                ct org.apache.maven.plugins:maven-enforcer-plugin:pom:1.3.1 from/to central (htt
                ps://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.mav
                en.apache.org -> [Help 1]
                [ERROR]
                [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
                ch.
                [ERROR] Re-run Maven using the -X switch to enable full debug logging.
                [ERROR]
                [ERROR] For more information about the errors and possible solutions, please rea
                d the following articles:
                [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
                onException
                
                
                
                
                

                 

                However I tried building another project with maven and deployed it on linux as well but  It gave me the same error exception which was raised when I deployed jar

                • 5. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
                  rick_wagner

                  Hi Raman,

                   

                  I think Tom's question was relevant.  You may need to install EAP 6.4  (it's the version that SwitchYard 2 was built against).  The older EAP 6.1 may not work.

                  You might try it on EAP 6.4, you'll probably have better results.

                  Good luck,

                  Rick

                  P.S.  If you can install Maven on your Linux machine, you'll be able to build and run on the same machine.  That may make things easier, also.

                  • 6. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
                    ramandeep

                    Hi Rick ,

                    Thanks for the suggestion but looks like it might not work .The same version combination is there on my local windows environment and things are running . On Windows JBOSS EAP is intergrated with the JBDS .However on linux environment environment I have standalone EAP server . So can this cause Issue in Linux ?

                    • 7. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
                      ramandeep

                      Hi Rick/Tom

                       

                      I narrowed down the Issue , it is the Issue due to missing dependencies in the jar file created  by maven

                      So I added a plugin in pom.xml to include all dependencies in final jar

                       

                      <plugin>
                              <artifactId>maven-assembly-plugin</artifactId>
                              <executions>
                                <execution>
                                  <phase>package</phase>
                                  <goals>
                                    <goal>single</goal>
                                  </goals>
                                </execution>
                              </executions>
                              <configuration>
                                <descriptorRefs>
                                  <descriptorRef>jar-with-dependencies</descriptorRef>
                                </descriptorRefs>
                              </configuration>
                            </plugin>
                      

                       

                      However after building again by using command mvn clean install  I see lot of missing no class def found errors. e.g one of them was

                      Caused by: java.lang.NoClassDefFoundError: org/jdom2/Content

                       

                      Now this class is present in jdom.jar which is present in Jboss developer studio plugins

                      Since I donot have JBDS on linux machine where only a stanalone EAP is running . How do I include all the required dependencies in the final maven jar .

                       

                      Below is my pom .xml

                      <?xml version="1.0" encoding="UTF-8"?>
                      <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <modelVersion>4.0.0</modelVersion>
                        <groupId>com.example.switchyard</groupId>
                        <artifactId>Kenan-POC</artifactId>
                        <version>0.0.1-SNAPSHOT</version>
                        <name>com.example.switchyard:Kenan-POC</name>
                        <properties>
                          <switchyard.version>2.0.0.Final</switchyard.version>
                          <maven.compiler.source>1.6</maven.compiler.source>
                          <maven.compiler.target>1.6</maven.compiler.target>
                        </properties>
                        <dependencyManagement>
                          <dependencies>
                            <dependency>
                              <groupId>org.switchyard</groupId>
                              <artifactId>switchyard-bom</artifactId>
                              <version>${switchyard.version}</version>
                              <type>pom</type>
                              <scope>import</scope>
                            </dependency>
                          </dependencies>
                        </dependencyManagement>
                        <dependencies>
                          <dependency>
                            <groupId>org.switchyard.components</groupId>
                            <artifactId>switchyard-component-bean</artifactId>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard.components</groupId>
                            <artifactId>switchyard-component-camel</artifactId>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard.components</groupId>
                            <artifactId>switchyard-component-resteasy</artifactId>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard</groupId>
                            <artifactId>switchyard-api</artifactId>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard</groupId>
                            <artifactId>switchyard-transform</artifactId>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard</groupId>
                            <artifactId>switchyard-validate</artifactId>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard</groupId>
                            <artifactId>switchyard-test</artifactId>
                            <scope>test</scope>
                          </dependency>
                          <dependency>
                            <groupId>org.switchyard.components</groupId>
                            <artifactId>switchyard-component-test-mixin-cdi</artifactId>
                            <scope>test</scope>
                          </dependency>
                          <dependency>
                              <groupId>org.codehaus.jettison</groupId>
                              <artifactId>jettison</artifactId>
                              <version>1.3.7</version>
                          </dependency>
                          <dependency>
                                  <groupId>org.jboss.weld.servlet</groupId>
                                  <artifactId>weld-servlet-core</artifactId>
                          </dependency>
                        </dependencies>
                        <build>
                          <plugins>
                            <plugin>
                              <groupId>org.switchyard</groupId>
                              <artifactId>switchyard-plugin</artifactId>
                              <version>${switchyard.version}</version>
                              <executions>
                                <execution>
                                  <goals>
                                    <goal>configure</goal>
                                  </goals>
                                </execution>
                              </executions>
                              <configuration>
                                <scannerClassNames>
                                  <param>org.switchyard.transform.config.model.TransformSwitchYardScanner</param>
                                </scannerClassNames>
                              </configuration>
                            </plugin>
                            <plugin>
                              <artifactId>maven-assembly-plugin</artifactId>
                              <executions>
                                <execution>
                                  <phase>package</phase>
                                  <goals>
                                    <goal>single</goal>
                                  </goals>
                                </execution>
                              </executions>
                              <configuration>
                                <descriptorRefs>
                                  <descriptorRef>jar-with-dependencies</descriptorRef>
                                </descriptorRefs>
                              </configuration>
                            </plugin>
                          </plugins>
                        </build>
                      </project>
                      
                      

                       

                      Also including setting.xml from .m2 directory

                      <settings>
                          <profiles>
                              <profile>
                                  <id>jboss-public-repository-group</id>
                                  <activation>
                                      <activeByDefault>true</activeByDefault>
                                  </activation>
                                  <repositories>
                                      <repository>
                                          <id>jboss-public-repository-group</id>
                                          <name>JBoss Public Repository Group</name>
                                          <url>http://repository.jboss.org/nexus/content/groups/public/</url>
                                          <layout>default</layout>
                                          <releases>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </releases>
                                          <snapshots>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </snapshots>
                                      </repository>
                                      <repository>
                                          <id>jboss-enterprise-repository-group</id>
                                          <name>JBoss Enterprise Maven Repository Group</name>
                                          <url>http://maven.repository.redhat.com/techpreview/all/</url>
                                          <layout>default</layout>
                                          <releases>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </releases>
                                          <snapshots>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </snapshots>
                                      </repository>
                                      <repository>
                                          <id>fusesource-public-release-repository-group</id>
                                          <url>https://repository.jboss.org/nexus/content/repositories/fs-releases</url>
                                          <releases>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </releases>
                                          <snapshots>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </snapshots>
                                      </repository>
                                  </repositories>
                                  <pluginRepositories>
                                      <pluginRepository>
                                          <id>jboss-public-repository-group</id>
                                          <name>JBoss Public Maven Repository Group</name>
                                          <url>https://repository.jboss.org/nexus/content/groups/public/</url>
                                          <layout>default</layout>
                                          <releases>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </releases>
                                          <snapshots>
                                              <enabled>true</enabled>
                                              <updatePolicy>never</updatePolicy>
                                          </snapshots>
                                      </pluginRepository>
                                  </pluginRepositories>
                              </profile>
                          </profiles>
                      </settings>
                      

                       

                      Any help would be highly appreciated

                      • 8. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
                        tcunning

                        Raman kalra wrote:

                         

                        Hi Rick ,

                        Thanks for the suggestion but looks like it might not work .The same version combination is there on my local windows environment and things are running . On Windows JBOSS EAP is intergrated with the JBDS .However on linux environment environment I have standalone EAP server . So can this cause Issue in Linux ?


                        Raman, the issue here is that I think you're using incompatible versions of EAP and SwitchYard.     SwitchYard 2.0.0.Final should be used with EAP 6.4 (https://developer.jboss.org/en/switchyard/blog/2015/06/04/switchyard-200final-now-available).    I'm not sure why it would work on your Windows machine and not your linux machine (I'd double and triple check that you have the same versions there). I'd try the correct combo (2.0.0.Final + EAP 6.4) and see if that works on Linux though.

                        • 9. Re: Issue in SwitchYard project build and deployment on JBoss EAP Linux environment
                          ramandeep

                          Thanks Guys, I copied the working environment from Windows to Linux which worked..

                           

                           

                          Silvi