5 Replies Latest reply on Mar 18, 2015 5:42 PM by SANJAY GAUTAM

    Migrating the Spring Application to Wildfly 8.2.0-Final from Jboss 4.2.3 which has EAR, two jars outside ear and appcontext outside ear/war

    James Edler Newbie

      Hi Community Members,

       

      I have this application which is kind of weird configuration but that's what it use to work in JBoss 4.2.3 all fine. but I am unable to configure and deploy the application in the similar way .

       

      Question is

      I want to keep the applicationContext-myapp.xml **(1)** externally rather than embedded inside the ear , when I embed it in Ear/war as shown below it works fine.

      applicationContext-myapp.xml has references to application-context-myapp-api.xml ,   application-context-myapp-svc.xml so framework uses applicationContext-myapp.xml file to wire

      Ear ,  War , Svc , Api all together.


      In JBoss 4.2.3 The Loading of the applicationContext-myapp.xml is used to happen , when the war's application context will import the files with all file starting from file:../conf/applicationContext-*.xml  but I am trying to do the same in the Wildfly 8.2.0 Final and putting configuration it is not working rather it is not importing the spring beans file

       

      Old Deployment Details JBoss 4.2.3 Below Works Fine

      Folder structure and deployment details.

      Jboss4.2.3 --> server --> myapp-framework--> conf

                                                                                          * all properties files were placed here

                                                                                          * applicationContext-myapp.xml    <-- this was the key file which we use to place and whole application will get wired ( Spring Beans File ) **(1)**

                                                                                      (this file refers to application-context-myapp-api.xml ,application-context-myapp-svc.xml )

                                                                                    --> deploy

                                                                                                          * myapp-framework.ear  --> META-INF

                                                                                                                                                      --> lib  --> some dependencies

                                                                                                                                                      --> myapp-framework-ejb.jar

                                                                                                                                                      --> myapp-framework.war - WEB_INF/classes/com.myapp/applicationContext-framework-myapp.xml

                                                                                                                                                                                                            jboss-web.xml

                                                                                                                                                                                                            web.xml

                                                                                                                                                                                                            applicationContext-myapp-war.xml ( spring config file)  

                                                                                                                                                                                                                  (contains references to applicationContext-framework-myapp.xml 

                                                                                                                                                                                                                                <import resource="classpath:/com/caiso/config/applicationContext-framework-myapp.xml"/>

                                                                                                                                                                                                                                <import resource="file:../conf/applicationContext-*.xml"/>    <=  this line was loading the file which was in **(1)** above

                                                                                                                                                                                                                        )

                                                                                    --> lib  -->  myapp-api.jar ( spring application apis )

                                                                                                                  application-context-myapp-api.xml

                                                                                                  --> myapp-svc.jar

                                                                                                                    application-context-myapp-svc.xml

      Loading Sequences in Jboss 4.2.3

      <skipped other details>

      1. applicationContext-myapp-war.xml

      2. applicationContext-framework-myapp.xml

      3. applicationContext-myapp.xml ( Desire is to keep this file external to ear )

      4. application-context-myapp-api.xml

      5. application-context-myapp-svc.xml


      Application used to successfully work on JBOSS4.2.3.

       

       

      New Deployment for WildFly 8.2.0-Final Below Configuration/Deployment Does not Works it is just I want to externalize the applicationContext-myapp.xml  Spring Config File


      Widlfly 8.2.0 Final  --> myapp-framework-server --> configurations

                                                                                                                    standalone.xml

                                                                                                                    other files.

                                                                                                                    applicationContext-myapp.xml

                                                                                              --> deployments

                                                                                                                    * myapp-framework.ear  --> META-INF

                                                                                                                                                                --> lib  --> some dependencies

                                                                                                                                                                --> myapp-framework-ejb.jar

                                                                                                                                                                --> myapp-framework.war - WEB_INF/classes/com.myapp/applicationContext-framework-myapp.xml

                                                                                                                                                                                                                                                      applicationContext-myapp.xml

                                                                                                                                                                                                                      jboss-web.xml

                                                                                                                                                                                                                      web.xml

                                                                                                                                                                                                                      applicationContext-myapp-war.xml ( spring config file) 

                                                                                                                                                                                                                            (this file refers this file -->  applicationContext-framework-myapp.xml , applicationContext-myapp.xml )

                                                                                                                                                                                                                             

                                                                                                                                                                                                                              (contains references to applicationContext-framework-myapp.xml 

                                                                                                                                                                                                                                <import resource="classpath:/com/caiso/config/applicationContext-framework-myapp.xml"/>

                                                                                                                                                                                                                                <import resource="file:../configuration/applicationContext-*.xml"/>    <=  this line was loading the file which was in **(1)** above

                                                                                                                                                                                                                        )

                   

                                                                                              --> modules

                                                                                                              com/myapp/main                                                           

                                                                                                                                  -->  myapp-api.jar ( spring application apis )

                                                                                                                                                application-context-myapp-api.xml

                                                                                                                                  --> myapp-svc.jar

                                                                                                                                                  application-context-myapp-svc.xml


      The above configuration for wildfly works if i move the file into the myapp-framework.war - WEB_INF/classes/com.myapp/applicationContext-myapp.xml  and add the reference to the but desire is to keep the applicationContext-myapp.xml  file EXTERNAL to the ear.

       

      It is little complicated probably , but would appreciate anyone sharing 2 cents on it above application is mainly webservice api , webservice serivice , some ejbs , and soap based webservices. wired by spring framework.

       

      thanks

      James .