Spring boot ActiveMQ JMS shows Resource does not exist: ServletContext resource [/xsd/product.xsd]
up vote
0
down vote
favorite
Following is my JMSConfig.java
@Configuration
public class JMSConfig
private static final Logger logger = LoggerFactory.getLogger(JMSConfig.class);
@Bean
public MarshallingMessageConverter createMarshallingMessageConverter(final Jaxb2Marshaller jaxb2Marshaller)
return new MarshallingMessageConverter(jaxb2Marshaller);
@Bean
public Jaxb2Marshaller createJaxb2Marshaller(@Value("$context.path") final String contextPath,
@Value("$schema.location") final Resource schemaResource)
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setContextPath(contextPath);
try
jaxb2Marshaller.setSchema(schemaResource);
catch(Exception e)
logger.error("Error occurred while getting xsd resource for jaxbsMarshaller. Reason :"+e);
Map<String, Object> properties = new HashMap<>();
properties.put(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxb2Marshaller.setMarshallerProperties(properties);
return jaxb2Marshaller;
Following is my consumer schema file:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.admin.com/product"
xmlns:tns="http://www.example.org/product"
elementFormDefault="qualified">
<element name="product">
<complexType>
<sequence>
<element name="productName" type="string"></element>
</sequence>
<attribute name="productId" type="string" use="required"></attribute>
</complexType>
</element>
</schema>
Following is my application.properties
# ===============================
# = ACTIVEMQ & JMS
# ===============================
spring.activemq.broker-url=tcp://localhost:61616
outbound.endpoint=ORDER.PROCESSING.D
context.path=com.admin.product
schema.location=xsd/product.xsd
Following is my pom.xml :
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId>
<version>5.1.0.RELEASE</version>
</dependency>
<!-- These two dependency is for JMS messeging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
Any suggestions on how to remove this error?
When I run my publisher spring boot app I see an error of resource not found which according to is uts not able to locate the schema file which is product.xsd.
Also I have added the consumers depeendency in my publishers pom.xml :
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
java spring spring-boot jms activemq
add a comment |
up vote
0
down vote
favorite
Following is my JMSConfig.java
@Configuration
public class JMSConfig
private static final Logger logger = LoggerFactory.getLogger(JMSConfig.class);
@Bean
public MarshallingMessageConverter createMarshallingMessageConverter(final Jaxb2Marshaller jaxb2Marshaller)
return new MarshallingMessageConverter(jaxb2Marshaller);
@Bean
public Jaxb2Marshaller createJaxb2Marshaller(@Value("$context.path") final String contextPath,
@Value("$schema.location") final Resource schemaResource)
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setContextPath(contextPath);
try
jaxb2Marshaller.setSchema(schemaResource);
catch(Exception e)
logger.error("Error occurred while getting xsd resource for jaxbsMarshaller. Reason :"+e);
Map<String, Object> properties = new HashMap<>();
properties.put(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxb2Marshaller.setMarshallerProperties(properties);
return jaxb2Marshaller;
Following is my consumer schema file:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.admin.com/product"
xmlns:tns="http://www.example.org/product"
elementFormDefault="qualified">
<element name="product">
<complexType>
<sequence>
<element name="productName" type="string"></element>
</sequence>
<attribute name="productId" type="string" use="required"></attribute>
</complexType>
</element>
</schema>
Following is my application.properties
# ===============================
# = ACTIVEMQ & JMS
# ===============================
spring.activemq.broker-url=tcp://localhost:61616
outbound.endpoint=ORDER.PROCESSING.D
context.path=com.admin.product
schema.location=xsd/product.xsd
Following is my pom.xml :
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId>
<version>5.1.0.RELEASE</version>
</dependency>
<!-- These two dependency is for JMS messeging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
Any suggestions on how to remove this error?
When I run my publisher spring boot app I see an error of resource not found which according to is uts not able to locate the schema file which is product.xsd.
Also I have added the consumers depeendency in my publishers pom.xml :
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
java spring spring-boot jms activemq
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Following is my JMSConfig.java
@Configuration
public class JMSConfig
private static final Logger logger = LoggerFactory.getLogger(JMSConfig.class);
@Bean
public MarshallingMessageConverter createMarshallingMessageConverter(final Jaxb2Marshaller jaxb2Marshaller)
return new MarshallingMessageConverter(jaxb2Marshaller);
@Bean
public Jaxb2Marshaller createJaxb2Marshaller(@Value("$context.path") final String contextPath,
@Value("$schema.location") final Resource schemaResource)
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setContextPath(contextPath);
try
jaxb2Marshaller.setSchema(schemaResource);
catch(Exception e)
logger.error("Error occurred while getting xsd resource for jaxbsMarshaller. Reason :"+e);
Map<String, Object> properties = new HashMap<>();
properties.put(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxb2Marshaller.setMarshallerProperties(properties);
return jaxb2Marshaller;
Following is my consumer schema file:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.admin.com/product"
xmlns:tns="http://www.example.org/product"
elementFormDefault="qualified">
<element name="product">
<complexType>
<sequence>
<element name="productName" type="string"></element>
</sequence>
<attribute name="productId" type="string" use="required"></attribute>
</complexType>
</element>
</schema>
Following is my application.properties
# ===============================
# = ACTIVEMQ & JMS
# ===============================
spring.activemq.broker-url=tcp://localhost:61616
outbound.endpoint=ORDER.PROCESSING.D
context.path=com.admin.product
schema.location=xsd/product.xsd
Following is my pom.xml :
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId>
<version>5.1.0.RELEASE</version>
</dependency>
<!-- These two dependency is for JMS messeging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
Any suggestions on how to remove this error?
When I run my publisher spring boot app I see an error of resource not found which according to is uts not able to locate the schema file which is product.xsd.
Also I have added the consumers depeendency in my publishers pom.xml :
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
java spring spring-boot jms activemq
Following is my JMSConfig.java
@Configuration
public class JMSConfig
private static final Logger logger = LoggerFactory.getLogger(JMSConfig.class);
@Bean
public MarshallingMessageConverter createMarshallingMessageConverter(final Jaxb2Marshaller jaxb2Marshaller)
return new MarshallingMessageConverter(jaxb2Marshaller);
@Bean
public Jaxb2Marshaller createJaxb2Marshaller(@Value("$context.path") final String contextPath,
@Value("$schema.location") final Resource schemaResource)
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setContextPath(contextPath);
try
jaxb2Marshaller.setSchema(schemaResource);
catch(Exception e)
logger.error("Error occurred while getting xsd resource for jaxbsMarshaller. Reason :"+e);
Map<String, Object> properties = new HashMap<>();
properties.put(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxb2Marshaller.setMarshallerProperties(properties);
return jaxb2Marshaller;
Following is my consumer schema file:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.admin.com/product"
xmlns:tns="http://www.example.org/product"
elementFormDefault="qualified">
<element name="product">
<complexType>
<sequence>
<element name="productName" type="string"></element>
</sequence>
<attribute name="productId" type="string" use="required"></attribute>
</complexType>
</element>
</schema>
Following is my application.properties
# ===============================
# = ACTIVEMQ & JMS
# ===============================
spring.activemq.broker-url=tcp://localhost:61616
outbound.endpoint=ORDER.PROCESSING.D
context.path=com.admin.product
schema.location=xsd/product.xsd
Following is my pom.xml :
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId>
<version>5.1.0.RELEASE</version>
</dependency>
<!-- These two dependency is for JMS messeging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
Any suggestions on how to remove this error?
When I run my publisher spring boot app I see an error of resource not found which according to is uts not able to locate the schema file which is product.xsd.
Also I have added the consumers depeendency in my publishers pom.xml :
<dependency>
<groupId>com.admin</groupId>
<artifactId>admin1.5.7</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
java spring spring-boot jms activemq
java spring spring-boot jms activemq
asked Nov 11 at 7:21
Varun Singh
247
247
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246662%2fspring-boot-activemq-jms-shows-resource-does-not-exist-servletcontext-resource%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown