11 Replies Latest reply on Nov 18, 2008 4:55 AM by Ales Justin

    help on jboss spring integration

    Matthieu Labour Newbie

      Hi

      I have browsed the mailing list and spend some time experimenting unsuccesfully with jboss spring integration.

      At this point I would greatly appreciate some help

      I want to create a non-web / headless application that would run in jboss but whose logic is in POJOS using Spring. I am trying to get Jboss to bootstrap my Spring application context. I know how to do that in the case of a Web application. But In this particular case, there is no WAR file. There are only methods that I want to expose via EJB for other components to call them and methods I want to expose via JMX.

      My project looks like the following:

      myproject-jar
      ------- src / main / java / com / mycompany /..../ blabla.java
      ------- src / main / resources / myspringContext.xml ---> where I declare the wiring of my POJOS and the methods I export using org.springframework.jmx.export.MBeanExporter

      myproject-ejb
      here i use the Spring AutowiringInterceptor to expose the interface of myproject.jar so that they can be called remotely via EJB

      myproject-ear packages myproject-ejb

      I use Jboss-4.2.2.GA and Spring 2.5.6 and maven to compile & package

      But when I copy the EAR in jboss, I don't see the JMX methods and understand that the spring context has not been loaded. I was hoping that the AutoWiring would load the Spring context...

      Then I came accross the Spring - Jboss Integration wiki

      I downloaded jboss-spring-jdk5-2.5.jar from sourceforge (It seems that 3.1 is only for jboss5 and i use jboss 4.2.2)

      I created a directory jboss-spring-jdk5.deployer in jboss-4.2.2.GA/server/messaging
      /deploy and copied jboss-spring-jdk5-2.5.jar into jboss-spring-jdk5.deployer directory

      Then I added jboss-spring.xml to myproject-jar / src / main / resources / META-INF

      In jboss-spring.xml, I just import myspringContext.xml

      when i deploy the EAR to jboss I see the following error:

      2008-11-13 20:37:30,743 3342 ERROR [org.jboss.deployment.MainDeployer] (main:) Could not initialise deployment: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/jboss-spring-jdk5.deployer/
      org.jboss.deployment.DeploymentException: Failed to find META-INF/jboss-service.xml for archive jboss-spring-jdk5.deployer
      at org.jboss.deployment.SARDeployer.parseDocument(SARDeployer.java:616)
      at org.jboss.deployment.SARDeployer.init(SARDeployer.java:181)

      I would really appreciate some help

      Thank you

        • 1. Re: help on jboss spring integration
          Ales Justin Master

          Read what the error msg says. ;-)

          Copy jboss-service.xml from one of
          complete deployer releases.
          Or check JBossAS 4.x branches.

          • 2. Re: help on jboss spring integration
            Matthieu Labour Newbie

            Thank you for the tip. It helped

            I downloaded jboss-spring-version4.zip from source forge
            and replaced jboss-spring-jdk5.jar with jboss-spring-jdk5-2.5.jar found on sourceforge as well
            and deployed everything in deploy / jboss-spring-jdk5.deployer

            and it works (Jboss starts properly)

            But when i deploy my EAR, it does not seem that the spring context is bootstaped
            Yet I have jboss-spring.xml in META-INF

            I would appreciate another tip

            Right now, jboss-spring.xml is packaged with the EAR. Shall i put it as part of the MYPROJECT-JAR ?
            Shall I rename MYPROJECT.JAR into MYPROJECT.spring ?


            Here is my EAR

            created: META-INF/
            inflated: META-INF/MANIFEST.MF
            created: lib/
            inflated: META-INF/application.xml
            inflated: META-INF/jboss-spring.xml
            inflated: META-INF/jboss-app.xml
            inflated: lib/joda-time-hibernate-1.0.jar
            inflated: lib/datecalc-common-1.1.0.jar
            inflated: lib/MYPROJECT-API-JAR-1.0.jar
            inflated: lib/aspectjweaver-1.5.4.jar
            inflated: lib/datecalc-joda-1.1.0.jar
            inflated: lib/spring-2.5.6.jar
            inflated: lib/MYPROJECT-IMPL-JAR-1.0.jar
            inflated: lib/otfeed-driver-0.1.3.jar
            inflated: lib/joda-time-1.5.2.jar
            inflated: lib/aspectjrt-1.5.4.jar
            inflated: lib/MYPROJECT-COMMONS-JAR-1.0.jar
            inflated: lib/MYPROJECT-PERSISTENCE-JAR-1.0.jar
            inflated: lib/quartz-1.5.0.jar
            inflated: MYPROJECT-EJB-JAR-1.0.jar
            created: META-INF/maven/
            created: META-INF/maven/com.strateer.mktdataengine/
            created: META-INF/maven/com.strateer.mktdataengineMYPROJECT-EAR/
            inflated: META-INF/maven/com.strateer.mktdataengine/MYPROJECT-EAR/pom.xml
            inflated: META-INF/maven/com.strateer.mktdataengine/MYPROJECT-EAR/pom.properties

            • 3. Re: help on jboss spring integration
              Ales Justin Master

              Yeah, you should have a .spring deployment in your ear:
              - my.ear
              -- some-beans.spring
              --- META-INF
              ---- jboss-spring.xml
              --- com/acme/beans/...

              ps: this is a lot simpler in JBoss5 ;-)

              • 4. Re: help on jboss spring integration
                Matthieu Labour Newbie

                Unfortunately I can't upgrade to Jboss5 and need to get it done with Jboss4

                Thank you again for your reply and again I 'll ask for a little bit more help:

                How to get the EAR to package the .spring ?

                Here is what I did:

                I modified MYPROJECT-IMPL-JAR so that it generates a .spring artefact. In order to do that, I added the following to the POM of MYPROJECT-IMPL-JAR

                <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>jboss-packaging-maven-plugin</artifactId>
                 <!-- Enable packaging types and lifecycle bindings. -->
                 <extensions>true</extensions>
                 <configuration>
                 <archiveName>MYPROJECT-IMPL-JAR</archiveName>
                 <deploymentDescriptorFile>src/main/resources/META-INF/jboss-spring.xml</deploymentDescriptorFile>
                 </configuration>
                 <executions>
                 <execution>
                 <phase>package</phase>
                 <goals>
                 <goal>spring</goal>
                 </goals>
                 </execution>
                 </executions>
                 </plugin>
                


                But I am not sure how to declare the module & dependency into the EAR

                I did the following to the POM of MYPROJECT-EAR

                <build>
                 <finalName>MYPROJECT-EAR-1.0</finalName>
                 <defaultGoal>package</defaultGoal>
                 <!-- resources>
                 <resource>
                 <directory>../src/main/resources/META-INF</directory>
                 <targetPath>META-INF</targetPath>
                 <filtering>true</filtering>
                 <includes>
                 <include>jboss-spring.xml</include>
                 </includes>
                 </resource>
                 </resources -->
                 <plugins>
                 <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-ear-plugin</artifactId>
                 <version>2.3.1</version>
                 <configuration>
                 <jboss>
                 <version>4.2</version>
                 <loader-repository>
                 com.strateer.repositoryloader:loader=myproject-ear
                 </loader-repository>
                 </jboss>
                
                 <defaultLibBundleDir>lib</defaultLibBundleDir>
                 <modules>
                 <ejbModule>
                 <groupId>com.strateer.myproject</groupId>
                 <artifactId>MYPROJECT-EJB-JAR</artifactId>
                 </ejbModule>
                 </modules>
                 </configuration>
                 </plugin>
                 </plugins>
                 </build>
                
                 <dependencies>
                
                 <dependency>
                 <groupId>com.strateer.myproject</groupId>
                 <artifactId>MYPROJECT-EJB-JAR</artifactId>
                 <version>${applicationVersion}</version>
                 <type>ejb</type>
                 </dependency>
                
                 <dependency>
                 <groupId>com.strateer.myproject</groupId>
                 <artifactId>MYPROJECT-IMPL-JAR</artifactId>
                 <version>${applicationVersion}</version>
                 <type>spring</type>
                 </dependency>
                
                 </dependencies>
                


                but compilation throws an error Unknown artifact type[spring]

                Here is the trace

                [INFO] Trace
                org.apache.maven.lifecycle.LifecycleExecutionException: Failed to initialize ear modules
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to initialize ear modules
                at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:210)
                at org.apache.maven.plugin.ear.GenerateApplicationXmlMojo.execute(GenerateApplicationXmlMojo.java:96)
                at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
                ... 16 more
                Caused by: org.apache.maven.plugin.ear.UnknownArtifactTypeException: Unknown artifact type[spring]
                at org.apache.maven.plugin.ear.util.ArtifactTypeMappingService.getStandardType(ArtifactTypeMappingService.java:159)
                at org.apache.maven.plugin.ear.EarModuleFactory.newEarModule(EarModuleFactory.java:65)
                at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:203)


                • 5. Re: help on jboss spring integration
                  Ales Justin Master

                   

                  "mattlf" wrote:

                  How to get the EAR to package the .spring ?

                  Unfortunately I'm not a Maven expert. :-(

                  Try asking this on maven forum.
                  Or perhaps our 'Build system' forum.

                  But I would expect it's a simple config detail you need to setup.

                  • 6. Re: help on jboss spring integration
                    Matthieu Labour Newbie

                    Hi Ales

                    Thanks again for your response

                    I feel I am close

                    The maven2 config is the following:

                    Add

                    <artifacttypemappings>
                     <artifacttypemapping type="spring" mapping="jar"/>
                    </artifacttypemappings>
                    


                    to configuration in pom of EAR

                    I now see the following when copying the ear into deploy. But I still don't see the Spring JMX that i declared in the jmx console. So the spring context is not bootstraped

                    2008-11-17 13:59:48,372 15543 DEBUG [org.jboss.deployment.MainDeployer] (main:) Copying file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deployMYPROJECT-EAR-1.0.ear -> /home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp3996MYPROJECT-EAR-1.0.ear
                    2008-11-17 13:59:48,416 15587 DEBUG [org.jboss.deployment.MainDeployer] (main:) using deployer org.jboss.deployment.EARDeployer@b31a7c
                    2008-11-17 13:59:48,416 15587 INFO [org.jboss.deployment.EARDeployer] (main:) Init J2EE application: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                    2008-11-17 13:59:48,428 15599 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/MANIFEST.MF
                    2008-11-17 13:59:48,428 15599 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/application.xml
                    2008-11-17 13:59:48,428 15599 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/jboss-spring.xml
                    2008-11-17 13:59:48,429 15600 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/jboss-app.xml
                    2008-11-17 13:59:48,429 15600 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/joda-time-hibernate-1.0.jar
                    2008-11-17 13:59:48,430 15601 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/datecalc-common-1.1.0.jar
                    2008-11-17 13:59:48,430 15601 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/STRATEER-MKTDATAENGINE-API-JAR-1.0.jar
                    2008-11-17 13:59:48,457 15628 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/aspectjweaver-1.5.4.jar
                    2008-11-17 13:59:48,457 15628 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/datecalc-joda-1.1.0.jar
                    2008-11-17 13:59:48,509 15680 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/spring-2.5.6.jar
                    2008-11-17 13:59:48,513 15684 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/otfeed-driver-0.1.3.jar
                    2008-11-17 13:59:48,521 15692 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/joda-time-1.5.2.jar
                    2008-11-17 13:59:48,523 15694 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/aspectjrt-1.5.4.jar
                    2008-11-17 13:59:48,552 15723 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/MYPROJECT-IMPL-JAR.spring
                    2008-11-17 13:59:48,554 15725 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/MYPROJECT-JAR-COMMONS-1.0.jar
                    2008-11-17 13:59:48,555 15726 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/MYPROJECT-JAR-PERSISTENCE-1.0.jar
                    2008-11-17 13:59:48,561 15732 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/quartz-1.5.0.jar
                    2008-11-17 13:59:48,562 15733 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted deployable content: MYPROJECT-EJB-JAR-1.0.jar
                    2008-11-17 13:59:48,562 15733 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/maven/com.strateer.mktdataengine/MYPROJECT-EAR/pom.xml
                    2008-11-17 13:59:48,563 15734 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/maven/com.strateer.mktdataengine/MYPROJECT-EAR/pom.properties
                    2008-11-17 13:59:48,563 15734 DEBUG [org.jboss.deployment.EARDeployer] (main:) Deployment Info: org.jboss.deployment.DeploymentInfo@6761bd25 { url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp3996MYPROJECT-EAR-1.0.ear-contents/MYPROJECT-EJB-JAR-1.0.jar }
                     deployer: null
                     status: null
                     state: CONSTRUCTED
                     watch: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp3996MYPROJECT-EAR-1.0.ear-contents/MYPROJECT-EJB-JAR-1.0.jar
                     altDD: null
                     lastDeployed: 0
                     lastModified: 0
                     mbeans:
                    , isDirectory: false
                    


                    I wonder if all JAR dependencies to MYPROJECT-IMPL.spring should also be named as .spring ?

                    I am going to try

                    • 7. Re: help on jboss spring integration
                      Ales Justin Master

                       

                      "mattlf" wrote:

                      I wonder if all JAR dependencies to MYPROJECT-IMPL.spring should also be named as .spring ?

                      No, only the one's where you have jboss-spring.xml file in META-INF.

                      • 8. Re: help on jboss spring integration
                        Matthieu Labour Newbie

                        For some reasons I can not get it working
                        I trimed down a small project to the bare minimum
                        and here is the trace in jboss (doesn't see to bootstrap)
                        i am running out of ideas

                        2008-11-17 17:43:45,552 14979 DEBUG [org.jboss.deployment.MainDeployer] (main:) Starting deployment of package: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:45,552 14979 DEBUG [org.jboss.deployment.MainDeployer] (main:) Starting deployment (init step) of package at: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:45,552 14979 DEBUG [org.jboss.deployment.MainDeployer] (main:) Copying file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear -> /home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:45,577 15004 DEBUG [org.jboss.deployment.MainDeployer] (main:) using deployer org.jboss.deployment.EARDeployer@b9b618
                        2008-11-17 17:43:45,577 15004 INFO [org.jboss.deployment.EARDeployer] (main:) Init J2EE application: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:45,631 15058 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/MANIFEST.MF
                        2008-11-17 17:43:45,632 15059 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/application.xml
                        2008-11-17 17:43:45,632 15059 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/jboss-spring.xml
                        2008-11-17 17:43:45,632 15059 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/jboss-app.xml
                        2008-11-17 17:43:45,633 15060 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/datecalc-common-1.1.0.jar
                        2008-11-17 17:43:45,634 15061 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/datecalc-joda-1.1.0.jar
                        2008-11-17 17:43:45,683 15110 DEBUG [org.jboss.jms.server.security.SecurityMetadataStore] (listenerContainer-1:) No SecurityMetadadata was available for D, using default security config
                        2008-11-17 17:43:45,685 15112 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/spring-2.5.6.jar
                        2008-11-17 17:43:45,689 15116 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/otfeed-driver-0.1.3.jar
                        2008-11-17 17:43:45,697 15124 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/joda-time-1.5.2.jar
                        2008-11-17 17:43:45,718 15145 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/MYPROJECT-JAR-1.0.spring
                        2008-11-17 17:43:45,725 15152 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/quartz-1.5.0.jar
                        2008-11-17 17:43:45,726 15153 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/pom.xml
                        2008-11-17 17:43:45,726 15153 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/pom.properties
                        2008-11-17 17:43:45,727 15154 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@22ed4b, cl=org.jboss.mx.loading.UnifiedClassLoader3@1090c56{ url=null ,addedOrder=0}
                        2008-11-17 17:43:45,728 15155 DEBUG [org.jboss.deployment.DeploymentInfo] (main:) createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: com.strateer.repositoryloader:loader=myproject-ear, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: null, repositoryConfig: null)
                        2008-11-17 17:43:45,728 15155 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@22ed4b, cl=org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=0}
                        2008-11-17 17:43:45,728 15155 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@22ed4b, cl=org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=0}
                        2008-11-17 17:43:45,728 15155 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] (main:) Adding org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=0}
                        2008-11-17 17:43:45,850 15277 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/datecalc-common-1.1.0.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:45,852 15279 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/datecalc-joda-1.1.0.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:46,008 15435 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/spring-2.5.6.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:46,023 15450 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/otfeed-driver-0.1.3.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:46,053 15480 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/joda-time-1.5.2.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:46,153 15580 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/MYPROJECT-JAR-1.0.spring, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:46,172 15599 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) Added url: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear-contents/lib/quartz-1.5.0.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@109099d{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp59855MYPROJECT-EAR-1.0.ear ,addedOrder=40}
                        2008-11-17 17:43:46,172 15599 DEBUG [org.jboss.deployment.MainDeployer] (main:) found 0 subpackages of file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:46,172 15599 DEBUG [org.jboss.deployment.MainDeployer] (main:) Watching new file: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:46,172 15599 DEBUG [org.jboss.deployment.MainDeployer] (main:) create step for deployment file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:46,174 15601 DEBUG [org.jboss.system.ServiceController] (main:) Creating service jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                        2008-11-17 17:43:46,174 15601 DEBUG [org.jboss.deployment.EARDeployment] (main:) Creating jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                        2008-11-17 17:43:46,174 15601 DEBUG [org.jboss.deployment.EARDeployment] (main:) Created jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                        2008-11-17 17:43:46,175 15602 DEBUG [org.jboss.system.ServiceController] (main:) Creating dependent components for: jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear' dependents are: []
                        2008-11-17 17:43:46,175 15602 DEBUG [org.jboss.deployment.MainDeployer] (main:) Done with create step of deploying MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:46,175 15602 DEBUG [org.jboss.deployment.MainDeployer] (main:) Begin deployment start file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                        2008-11-17 17:43:46,179 15606 DEBUG [org.jboss.system.ServiceController] (main:) starting service jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'


                        • 9. Re: help on jboss spring integration
                          Ales Justin Master

                           

                          "mattlf" wrote:

                          2008-11-17 17:43:45,552 14979 DEBUG 2008-11-17 17:43:45,632 15059 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/jboss-spring.xml
                          


                          Why is this still in ear/META-INF?

                          "mattlf" wrote:

                          2008-11-17 17:43:45,718 15145 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: lib/MYPROJECT-JAR-1.0.spring
                          

                          This should be a deployable unit, not part of 'helpers' classpath.

                          See my structure I posted previously:
                          - my.ear
                          -- some-beans.spring
                          --- META-INF
                          ---- jboss-spring.xml
                          --- com/acme/beans/...
                          

                          No lib. ;-)

                          • 10. Re: help on jboss spring integration
                            Matthieu Labour Newbie

                            Still it doesn't work. I must be doing something wrong. Maybe there should not be a dot in the version number MYPROJECT-JAR-1.0.spring ?

                            Here is the exploded EAR and .spring

                            mattlf@dell-desktop:~/strateer-dev/branches/1.0/MYPROJECT-EAR/target/test$ jar -xvf MYPROJECT-EAR-1.0.ear
                             created: META-INF/
                             inflated: META-INF/MANIFEST.MF
                             inflated: datecalc-common-1.1.0.jar
                             inflated: datecalc-joda-1.1.0.jar
                             inflated: spring-2.5.6.jar
                             inflated: otfeed-driver-0.1.3.jar
                             inflated: joda-time-1.5.2.jar
                             inflated: MYPROJECT-JAR-1.0.spring
                             inflated: META-INF/application.xml
                             inflated: META-INF/jboss-app.xml
                             inflated: quartz-1.5.0.jar
                             created: META-INF/maven/
                             created: META-INF/maven/com.strateer.myproject/
                             created: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/
                             inflated: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/pom.xml
                             inflated: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/pom.properties
                            mattlf@dell-desktop:~/strateer-dev/branches/1.0/MYPROJECT-EAR/target/test$ ls
                            datecalc-common-1.1.0.jar datecalc-joda-1.1.0.jar joda-time-1.5.2.jar META-INF MYPROJECT-EAR-1.0.ear MYPROJECT-JAR-1.0.spring otfeed-driver-0.1.3.jar quartz-1.5.0.jar spring-2.5.6.jar
                            mattlf@dell-desktop:~/strateer-dev/branches/1.0/MYPROJECT-EAR/target/test$ jar -xvf MYPROJECT-JAR-1.0.spring
                             created: META-INF/
                             inflated: META-INF/MANIFEST.MF
                             created: com/
                             created: com/strateer/
                             created: com/strateer/myproject/
                             created: com/strateer/myproject/impl/
                             created: com/strateer/myproject/api/
                             created: lib/
                             inflated: beanRefContext.xml
                             inflated: com/strateer/myproject/impl/TestServiceImpl.class
                             inflated: com/strateer/myproject/api/TestService.class
                             inflated: myprojectBeans.xml
                             inflated: META-INF/jboss-spring.xml
                             inflated: lib/datecalc-common-1.1.0.jar
                             inflated: lib/datecalc-joda-1.1.0.jar
                             inflated: lib/spring-2.5.6.jar
                             inflated: lib/otfeed-driver-0.1.3.jar
                             inflated: lib/joda-time-1.5.2.jar
                             inflated: lib/quartz-1.5.0.jar
                             inflated: mktdataEngineOpentic.properties
                             created: META-INF/maven/
                             created: META-INF/maven/com.strateer.myproject/
                             created: META-INF/maven/com.strateer.myproject/MYPROJECT-JAR/
                             inflated: META-INF/maven/com.strateer.myproject/MYPROJECT-JAR/pom.xml
                             inflated: META-INF/maven/com.strateer.myproject/MYPROJECT-JAR/pom.properties
                            mattlf@dell-desktop:~/strateer-dev/branches/1.0/MYPROJECT-EAR/target/test$
                            



                            Here is the jboss-spring.xml

                            <beans xmlns="http://www.springframework.org/schema/beans"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xmlns:context="http://www.springframework.org/schema/context"
                             xmlns:util="http://www.springframework.org/schema/util"
                             xmlns:tx="http://www.springframework.org/schema/tx"
                             xmlns:aop="http://www.springframework.org/schema/aop"
                             xmlns:jee="http://www.springframework.org/schema/jee"
                             xsi:schemaLocation="http://www.springframework.org/schema/beans
                             http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                             http://www.springframework.org/schema/context
                             http://www.springframework.org/schema/context/spring-context-2.5.xsd
                             http://www.springframework.org/schema/util
                             http://www.springframework.org/schema/util/spring-util-2.5.xsd
                             http://www.springframework.org/schema/aop
                             http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
                             http://www.springframework.org/schema/tx
                             http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
                             http://www.springframework.org/schema/jee
                             http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
                            
                            
                             <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
                            
                             <bean id="mktPropertyConfigurer"
                             class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
                             <property name="location" value="classpath:mktdataEngineOpentic.properties"/>
                             <property name="placeholderPrefix" value="$mktdataengine{"/>
                             <property name="placeholderSuffix" value="}"/>
                             </bean>
                            
                             <bean id="testService" class="com.strateer.myproject.impl.TestServiceImpl" init-method="init">
                             </bean>
                            
                            
                             <bean class="org.springframework.jmx.export.MBeanExporter">
                             <property name="beans">
                             <map>
                             <entry key="com.strateer.myproject.impl.TestServiceImpl:name=jmx,type=spring"
                             value-ref="testService"/>
                             </map>
                             </property>
                             <property name="assembler" ref="assembler4ScheduleJob"/>
                             </bean>
                            
                             <bean id="assembler4ScheduleJob"
                             class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
                             <property name="managedInterfaces">
                             <list>
                             <value>
                             com.strateer.myproject.api.TestService
                             </value>
                             </list>
                             </property>
                             </bean>
                            
                            </beans>


                            and here is the jboss trace

                            2008-11-18 01:52:32,582 14885 INFO [org.jboss.deployment.EARDeployer] (main:) Init J2EE application: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,594 14897 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/MANIFEST.MF
                            2008-11-18 01:52:32,594 14897 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: datecalc-common-1.1.0.jar
                            2008-11-18 01:52:32,595 14898 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: datecalc-joda-1.1.0.jar
                            2008-11-18 01:52:32,641 14944 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: spring-2.5.6.jar
                            2008-11-18 01:52:32,645 14948 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: otfeed-driver-0.1.3.jar
                            2008-11-18 01:52:32,653 14956 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: joda-time-1.5.2.jar
                            2008-11-18 01:52:32,673 14976 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: MYPROJECT-JAR-1.0.spring
                            2008-11-18 01:52:32,673 14976 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/application.xml
                            2008-11-18 01:52:32,673 14976 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/jboss-app.xml
                            2008-11-18 01:52:32,678 14981 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: quartz-1.5.0.jar
                            2008-11-18 01:52:32,679 14982 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/pom.xml
                            2008-11-18 01:52:32,679 14982 DEBUG [org.jboss.deployment.EARDeployer] (main:) Extracted non-deployable content: META-INF/maven/com.strateer.myproject/MYPROJECT-EAR/pom.properties
                            2008-11-18 01:52:32,680 14983 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a64642, cl=org.jboss.mx.loading.UnifiedClassLoader3@4e9b7d{ url=null ,addedOrder=0}
                            2008-11-18 01:52:32,681 14984 DEBUG [org.jboss.deployment.DeploymentInfo] (main:) createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: com.strateer.repositoryloader:loader=myproject-ear, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: null, repositoryConfig: null)
                            2008-11-18 01:52:32,681 14984 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a64642, cl=org.jboss.mx.loading.UnifiedClassLoader3@c25ae3{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp28309MYPROJECT-EAR-1.0.ear ,addedOrder=0}
                            2008-11-18 01:52:32,681 14984 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] (main:) setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a64642, cl=org.jboss.mx.loading.UnifiedClassLoader3@c25ae3{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp28309MYPROJECT-EAR-1.0.ear ,addedOrder=0}
                            2008-11-18 01:52:32,681 14984 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] (main:) Adding org.jboss.mx.loading.UnifiedClassLoader3@c25ae3{ url=file:/home/mattlf/jboss-4.2.2.GA/server/messaging/tmp/deploy/tmp28309MYPROJECT-EAR-1.0.ear ,addedOrder=0}
                            2008-11-18 01:52:32,817 15120 DEBUG [org.jboss.deployment.MainDeployer] (main:) found 0 subpackages of file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,817 15120 DEBUG [org.jboss.deployment.MainDeployer] (main:) Watching new file: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,817 15120 DEBUG [org.jboss.deployment.MainDeployer] (main:) create step for deployment file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,818 15121 DEBUG [org.jboss.system.ServiceController] (main:) Creating service jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                            2008-11-18 01:52:32,819 15122 DEBUG [org.jboss.deployment.EARDeployment] (main:) Creating jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                            2008-11-18 01:52:32,819 15122 DEBUG [org.jboss.deployment.EARDeployment] (main:) Created jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                            2008-11-18 01:52:32,819 15122 DEBUG [org.jboss.system.ServiceController] (main:) Creating dependent components for: jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear' dependents are: []
                            2008-11-18 01:52:32,819 15122 DEBUG [org.jboss.deployment.MainDeployer] (main:) Done with create step of deploying MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,819 15122 DEBUG [org.jboss.deployment.MainDeployer] (main:) Begin deployment start file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.system.ServiceController] (main:) starting service jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.deployment.EARDeployment] (main:) Starting jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.deployment.EARDeployment] (main:) Started jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear'
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.system.ServiceController] (main:) Starting dependent components for: jboss.j2ee:service=EARDeployment,url='MYPROJECT-EAR-1.0.ear' dependent components: []
                            2008-11-18 01:52:32,823 15126 INFO [org.jboss.deployment.EARDeployer] (main:) Started J2EE application: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.deployment.MainDeployer] (main:) End deployment start on package: MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.deployment.MainDeployer] (main:) Deployed package: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,823 15126 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] (main:) Watch URL for: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear -> file:/home/mattlf/jboss-4.2.2.GA/server/messaging/deploy/MYPROJECT-EAR-1.0.ear
                            2008-11-18 01:52:32,824 15127 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] (main:) Notified that enabled: true
                            2008-11-18 01:52:32,824 15127 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] (main:) Started jboss.deployment:type=DeploymentScanner,flavor=URL
                            2008-11-18 01:52:32,824 15127 DEBUG [org.jboss.system.ServiceController] (main:) Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
                            2008-11-18 01:52:32,885 15188 DEBUG [org.jboss.deployment.MainDeployer] (main:) End deployment start on package: jboss-service.xml
                            2008-11-18 01:52:32,886 15189 DEBUG [org.jboss.deployment.MainDeployer] (main:) Deployed package: file:/home/mattlf/jboss-4.2.2.GA/server/messaging/conf/jboss-service.xml
                            2008-11-18 01:52:32,887 15190 DEBUG [org.jboss.web.tomcat.service.JBossWeb] (main:) Saw org.jboss.system.server.started notification, starting connectors
                            2008-11-18 01:52:32,905 15208 INFO [org.apache.coyote.http11.Http11Protocol] (main:) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
                            2008-11-18 01:52:32,927 15230 INFO [org.apache.coyote.ajp.AjpProtocol] (main:) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
                            2008-11-18 01:52:32,935 15238 INFO [org.jboss.system.server.Server] (main:) JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 15s:221ms


                            I would really appreciate some help


                            • 11. Re: help on jboss spring integration
                              Ales Justin Master

                               

                              "mattlf" wrote:
                              Maybe there should not be a dot in the version number MYPROJECT-JAR-1.0.spring ?

                              I doubt that dot is the cause.

                              How does your application.xml look like?
                              Perhaps you need to declare .spring jar as apps module:
                              (pseudo code, as it's been a while since I've done some real .ear)
                              <app>
                               <module>
                               <jar>MYPROJECT-JAR-1.0.spring</jar>
                               </module>
                              </app>
                              


                              And you don't need to package spring jar with your app,
                              it's already part of SpringDeployer.

                              btw: try testing SpringDeployer, by deploying simple jboss-spring.xml
                              directly into deploy directory.