Search code examples
javaspringspring-bootclassloaderjboss6.x

How to use custom module.xml and deploy after custom module of JBOSS EAP6.4 with Spring Boot Application


We are using artesia 3rd party product for our project and it is deployed in JBOSS EAP6.4, I want to use spring boot in our project and when I write sample REST webservices I am able to access the REST web service via URL.

As per the documentation of our product if we need to customize the project we need to write our custom war by specifying below two JBOSS files inside META-INF folder

jboss-all.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss umlns="urn:jboss:1.0">
    <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
        <dependency name="artesia.ear" />
    </jboss-deployment-dependencies>
</jboss>

so our custom logic should begin after successful start of artesia.ear.

our jboss-deployment-structure.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <sub-deployment>
        <dependencies>
            <module name="deploy" />
        </dependencies>
    </sub-deployment>
</jboss-deployment-structure>

Above deploy module contains all jars necessary for the project to run.

When I follow the same and created the war without spring in it, it was successful and there are no issues, we are able to use to customize war.

Now I want to do the same in Spring-boot 1.4.1 application, where my spring boot app should start after artesia.ear starts successfully and apart from spring jars my spring-boot app should use jars from module.xml.

I have placed the above two xml's inside META-INF of spring boot application but it is failing when deployed in JBOSS EAP6.4

Below is the error that I get jboss-server.log

What I need to do to use same for my spring-boot app

EDIT 1:

I tried by placing both jboss files under WEB-INF folder of spring-boot application but still the facing the same issue


Solution

  • We need to make sure that META-INF and WEB-INF folders are lying side by side instead of keeping META-INF folder inside classes folder of WEB-INF which is where default spring-boot META-INF folder resides.