ActiveMQ Artemis REST Interface configuration - rest

I'm attempting to add ActiveMQ Artemis' REST interface to my Docker container, and for that I have been following the official guide. I generate a artemis-rest.war file and move it into my /opt/artemis/web folder. Now when I navigate to http://localhost:8161/artemis-rest/queues/queue_name, I get a 404. When I try to navigate to other resources listed in the /opt/artemis/web like /console/ or /artemis-plugin/ I get at least some sort of a response.
My folder structure looks like this:
|-- pom.xml
`-- src
`-- main
`-- webapp
`-- WEB-INF
`-- web.xml
`-- resources
`-- rest.xml
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.somebody</groupId>
<artifactId>artemis-rest</artifactId>
<packaging>war</packaging>
<name>ActiveMQ Artemis REST</name>
<version>2.17.0</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq.rest</groupId>
<artifactId>artemis-rest</artifactId>
<version>2.17.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logmanager</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
rest.xml:
<rest-messaging>
<server-in-vm-id>0</server-in-vm-id> <!-- deprecated, use "url" -->
<use-link-headers>false</use-link-headers>
<default-durable-send>false</default-durable-send>
<dups-ok>true</dups-ok>
<topic-push-store-dir>topic-push-store</topic-push-store-dir>
<queue-push-store-dir>queue-push-store</queue-push-store-dir>
<producer-time-to-live>0</producer-time-to-live>
<producer-session-pool-size>10</producer-session-pool-size>
<session-timeout-task-interval>1</session-timeout-task-interval>
<consumer-session-timeout-seconds>300</consumer-session-timeout-seconds>
<consumer-window-size>-1</consumer-window-size> <!-- deprecated, use "url" -->
<url>vm://0</url>
</rest-messaging>
web.xml:
<web-app>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<listener>
<listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class>
</listener>
<filter>
<filter-name>Rest-Messaging</filter-name>
<filter-class>org.jboss.resteasy.plugins.server.servlet.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>Rest-Messaging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>rest.messaging.config.file</param-name>
<param-value>rest.xml</param-value>
</context-param>
</web-app>
Have I missed something? Do I need to still need to configure something?
I would have though that that including the .war file would be enough, to at least get an error of some kind.

You need to deploy artemis-rest.war in etc/bootstrap.xml, e.g.:
<web bind="http://localhost:8161" path="web">
...
<app url="artemis-rest" war="artemis-rest.war"/>
</web>
The embedded web server won't automatically deploy artemis-rest.war just because you put it into the web directory.

Related

ActiveMQ Artemis REST integration throwing exception

I am trying to REST interface to the ActiveMQ Artemis 2.13.0 by building integrated REST war file and copying the war file to "apache-artemis-2.13.0\web" and starting service.
To configure I have followed this documentation.
Getting exception
2020-12-07 16:47:11,894 INFO [org.apache.activemq.artemis.core.server] AMQ221013: Using NIO Journal
2020-12-07 16:47:11,933 INFO [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 477,364,224
2020-12-07 16:47:11,952 ERROR [org.apache.activemq.artemis.core.server] AMQ224097: Failed to start server: java.util.ServiceConfigurationError: org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory: org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManagerFactory not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:590) [java.base:]
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237)
and
2020-12-07 16:47:12,077 WARN [org.apache.activemq.artemis.rest] AMQ182004: REST configuration parameter consumer-window-size' is deprecated. Use 'url' instead.
2020-12-07 16:47:12,409 WARN [org.eclipse.jetty.webapp.WebAppContext] Failed startup of context o.e.j.w.WebAppContext#6b9c42bd{/artemis-rest-1.0,file:///D:/ABroker2.13.0/tmp/jetty-localhost-8161-artemis-rest-1_0_war-_artemis-rest-1_0-any-9922358792097605704.dir/webapp/,UNAVAILABLE}{D:\apache-artemis-2.13.0-bin\apache-artemis-2.13.0\web\artemis-rest-1.0.war}: java.lang.RuntimeException: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219007: Cannot connect to server(s). Tried with all available servers.]
at org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener.contextInitialized(RestMessagingBootstrapListener.java:54) [artemis-rest-2.13.0.jar:2.13.0]
I have referred old post regarding the similar issue, but didn't resolve my issue.
My pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.jdanekrh</groupId>
<artifactId>artemis-rest</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.19.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>3.0.19.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>3.0.19.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>tjws</artifactId>
<version>3.0.19.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-commons</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq.rest</groupId>
<artifactId>artemis-rest</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</project>
And web.xml:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>rest.messaging.config.file</param-name>
<param-value>rest.xml</param-value>
</context-param>
<listener>
<listener-class>
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
</listener-class>
</listener>
<!-- this commented out section is the only difference from the embedded config -->
<!--<listener>-->
<!--<listener-class>-->
<!--org.apache.activemq.artemis.rest.integration.ActiveMQBootstrapListener-->
<!--</listener-class>-->
<!--</listener>-->
<listener>
<listener-class>
org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener
</listener-class>
</listener>
<filter>
<filter-name>Rest-Messaging</filter-name>
<filter-class>
org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>Rest-Messaging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Can some one help me if I am missing anything?
You wrote about setting at web.xml
<param-value>rest.xml</param-value>
Make sure that your integrated REST war file really includes /WEB-IBF/classes/rest.xml
Make sure that it contains setting
<rest-messaging>
...
<url>tcp://localhost:61616</url>
</rest-messaging>
Documentation specifies vm://0 instead, but in my view this does not work or demands some custom (non-default) configuration for emdedded broker.

REST interface on ActiveMQ Artemis

I'm trying to add REST interface to ActiveMQ Artemis by building .war file with Maven following Artemis REST interface documentation.
After .war file is generated I move it in /opt/artemis/apache-artemis-2.13.0/web/ directory and start ActiveMQ Artemis.
I'm getting next exception when starting ActiveMQ Artemis:
WARN [org.eclipse.jetty.webapp.WebAppContext] Failed startup of context o.e.j.w.WebAppContext#4cb702ce{/artemis-rest,file:///var/lib/test-broker/tmp/jetty-0_0_0_0-8161-artemis-rest_war-_artemis-rest-any-15304647904836420970.dir/webapp/,UNAVAILABLE}{/opt/artemis/apache-artemis-2.13.0/web/artemis-rest.war}: java.lang.RuntimeException: You must install RESTEasy as a Bootstrap Listener and it must be listed before this class
at org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener.contextInitialized(RestMessagingBootstrapListener.java:39) [artemis-rest-2.13.0.jar:2.13.0]
Also, getting 503 on HTTP request http://192.168.0.50:8161/artemis-rest/queues/test:
HTTP ERROR 503 Service Unavailable
URI: /artemis-rest/queues/test
STATUS: 503
MESSAGE: Service Unavailable
SERVLET: -
I don't have RESTeasy installed because I can't find out how to, so I've downloaded jar file for RESTeasy jaxrs version 3.13.0.Final and put it in WEB-INF/lib directory and also included dependency for it in pom.xml.
Let me show you my configuration:
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.somebody</groupId>
<artifactId>artemis-rest</artifactId>
<packaging>war</packaging>
<name>My App</name>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.13.0.Final</version>
</dependency>
<dependency>
<groupId>org.apache.activemq.rest</groupId>
<artifactId>artemis-rest</artifactId>
<version>2.13.0</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html -->
<web-app>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<listener>
<listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class>
</listener>
<filter>
<filter-name>Rest-Messaging</filter-name>
<filter-class>org.jboss.resteasy.plugins.server.servlet.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>Rest-Messaging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>rest.messaging.config.file</param-name>
<param-value>file:///WEB-INF/rest-messaging.xml</param-value>
</context-param>
</web-app>
rest-messaging.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html -->
<rest-messaging>
<server-in-vm-id>0</server-in-vm-id> <!-- deprecated, use "url" -->
<use-link-headers>false</use-link-headers>
<default-durable-send>false</default-durable-send>
<dups-ok>true</dups-ok>
<topic-push-store-dir>topic-push-store</topic-push-store-dir>
<queue-push-store-dir>queue-push-store</queue-push-store-dir>
<producer-time-to-live>0</producer-time-to-live>
<producer-session-pool-size>10</producer-session-pool-size>
<session-timeout-task-interval>1</session-timeout-task-interval>
<consumer-session-timeout-seconds>300</consumer-session-timeout-seconds>
<consumer-window-size>-1</consumer-window-size> <!-- deprecated, use "url" -->
<url>vm://0</url>
</rest-messaging>
If needed I can also attach broker.xml, jolokia-access.xml and bootstrap.xml files, but they seems OK to me. I found older question about this here, but it didn't help to resolve this.
In case you know some other approaches for adding REST interface to ActiveMQ Artemis please inform me.
Unfortunately the REST documentation for ActiveMQ Artemis hasn't been validated or updated in awhile.
You can get everything you need in the war file and exclude most of what you don't need using this pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.somebody</groupId>
<artifactId>artemis-rest</artifactId>
<packaging>war</packaging>
<name>My App</name>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq.rest</groupId>
<artifactId>artemis-rest</artifactId>
<version>2.13.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logmanager</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Be sure to add an in-vm acceptor to your broker.xml, e.g.:
<acceptors>
...
<acceptor name="invm">vm://0</acceptor>
</acceptors>
Also, you can automatically include the REST configuration XML if you structure your project like this:
|-- pom.xml
`-- src
`-- main
`-- webapp
`-- WEB-INF
`-- web.xml
`-- resources
`-- rest.xml
Then you can reference it in your web.xml like this:
<context-param>
<param-name>rest.messaging.config.file</param-name>
<param-value>rest.xml</param-value>
</context-param>
In general I would recommend against using the ActiveMQ Artemis REST interface for 2 main reasons:
Your code will not be portable because the ActiveMQ Artemis REST interface is a custom (i.e. not standardized) interface.
The STOMP protocol is ubiquitous, simple, standarized, and can be used in almost every circumstance and environment where REST might be used.
I recommend you use STOMP in lieu of the ActiveMQ Artemis REST interface.

use jersey 2.x with CDI without declare service into AbstractBinder

I have a simple webapp work well with jersey 2.6, jboss 5.0.0.
The approach of declaring all my inject class ( services) into a AbstractBinder isn't elegancy.
So I want use CDI injection to manage all the life cycle bean management. I've seen it's possible with use #manageBean instead #ScopeResquest. I tried it with this error :
> javax.servlet.ServletException: A MultiException has 3 exceptions.
> They are:
> 1. org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at
> Injectee(requiredType=ServiceExemple,parent=RestService,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,2072559159)
> 2. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of fr.xx.xx.rest.RestService errors were
> found
> 3. java.lang.IllegalStateException: Unable to perform operation: resolve on fr.xx.xx.rest.RestService
>
> org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:392)
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:219)
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
My config pom :
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.6</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<artifactId>jaxb-impl</artifactId>
<groupId>com.sun.xml.bind</groupId>
</exclusion>
<exclusion>
<artifactId>jettison</artifactId>
<groupId>org.codehaus.jettison</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.1.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-bean-validation</artifactId>
<version>${jersey.version}</version>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>jersey-weld2-se</artifactId>
<version>2.25</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>jersey-cdi1x</artifactId>
<version>2.25</version>
</dependency>
</dependencies>
<build>
<finalName>RESTfulExample</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
My web.xml:
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Restful Web Application</display-name>
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<!-- <init-param> -->
<!-- <param-name>jersey.config.server.provider.packages</param-name> -->
<!-- <param-value>fr.xx.xx.rest</param-value> -->
<!-- </init-param> -->
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>fr.xx.xx.ApplicationRest</param-value>
</init-param>
<init-param>
<param-name>jersey.config.beanValidation.disable.validateOnExecutableCheck.server</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>jersey.config.beanValidation.enableOutputValidationErrorEntity.server</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
my class application path :
#ApplicationPath("rest")
public class ApplicationRest extends ResourceConfig {
public ApplicationRest() {
// Register resources and providers using package-scanning.
packages("fr.xx.xx.rest");
packages("org.codehaus.jackson.jaxrs");
register( JacksonFeature.class );
register(org.glassfish.jersey.server.validation.ValidationFeature.class);
// register(new ApplicationBinder()); => don't want use it
My simple service class :
#Default
public class ServiceExemple {
...
and to finish my resources class :
#Path("/service")
#ManagedBean
public class RestService {
#Inject private ServiceExemple service;
...
I've add an empty bean.xml in my WEB-INF
Thanks for your help
First of all injected resources(beans) and Jersey Endpoint class(point of injection) must be CDI-Aware. It must be detecteable by CDI. We can use bean-discovery-mode="all" - then CDI scan ALL classes or
bean-discovery-mode="annotated" and MARK our class with PROPER annotation: from here : Bean defining annotations. I prefer#Dependent or #RequestScoped
Then we must use Jersey Extension
<dependency>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>jersey-cdi1x-servlet</artifactId>
<version>{version}</version>
<scope>runtime</scope>
</dependency>
`
to connect CDI with HK2 discovery mechanism.
Here is Official oracle Guideline

Wicket-Atmosphere configuration error

I am new to Atmosphere, I have created a wicket quick start application(6.19.0) and configured Atmosphere but getting following error:
2016-11-09 17:29:31 WARN AtmosphereFramework:1679 - Failed using comet support: org.atmosphere.container.Tomcat7CometSupport, error: Tomcat failed to detect this is a Comet application because context.xml is missing or the Http11NioProtocol Connector is not enabled.You must use the atmosphere-native-runtime dependency in order to use native Comet Support
If that's not the case, you can also remove META-INF/context.xml and WEB-INF/lib/atmosphere-compat-tomcat7.jar Is the NIO or APR Connector enabled?
2016-11-09 17:29:31 ERROR AtmosphereFramework:1682 - If you have more than one Connector enabled, make sure they both use the same protocol, e.g NIO/APR or HTTP for all. If not, org.atmosphere.container.BlockingIOCometSupport will be used and cannot be changed.
2016-11-09 17:29:31 WARN AtmosphereFramework:1694 - Using org.atmosphere.container.BlockingIOCometSupport
2016-11-09 17:29:31 WARN Component:3969 - Markup id set on a component that is usually not rendered into markup. Markup id: version4, component id: version, component tag: container.
pom.xml as follows:
<properties>
<wicket.version>6.19.0</wicket.version>
<jetty.version>7.6.13.v20130916</jetty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wtp.version>none</wtp.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
<version>${wicket.version}</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime-native</artifactId>
<version>2.0.1</version>
<exclusions>
<exclusion>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-compat-tomcat7</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-atmosphere</artifactId>
<version>0.18</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-all-server</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
web.xml:
<servlet>
<servlet-name>AtmosphereServlet</servlet-name>
<servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.cg.web.test.WicketApplication</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>filterMappingUrlPattern</param-name>
<param-value>/*</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
And there is no context.xml file. I have removed the comment from following line in server.xml
<Connector port="9443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
keystorefile="file:///D:/SSL/keystore" keystorepass="changeit"
clientAuth="false" sslProtocol="TLS" />
Can anyone provide some idea on this?
Thanks in advance.

Why do I get two different Project Context for my Spring mvc web application?

Following is my pom.xml
<project xmlns="Page on apache.org" xmlns:xsi="Page on w3.org"
xsi:schemaLocation="Welcome to Apache Maven/POM/4.0.0 Page on apache.org">
<modelVersion>4.0.0</modelVersion>
<groupId>com.MyStartUp.www</groupId>
<artifactId>MyStartUp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>MyStartUp Maven Webapp</name>
<url>Welcome to Apache Maven</url>
<properties>
<spring.version>4.0.2.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>1.6.0.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
<build>
<finalName>MyStartUp</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
I use tomcat server v7.0 to deploy and I use maven to build.
Whenever I make a change I go to maven terminal and use "mvn clean install" and go to localhost:8080/manager and deploy the war by browsing the application in my desktop. After this I see "MyStartUp" in tomcat manager window in browser.
My project name in eclipse looks as "mystartup".
When I add the project in Eclipse IDE using "Add or remove" after right click the server, I see "mystartup" and I add it. Then if I refresh localhost:8080/manager/
I see two different project deployed.
1) MyStartUp (Url : localhost:8080/MyStartUp --> Works)
2) mystartup (Url : localhost:8080/mystartup --> Doesn't Work)
When I click the second one, I am not able to access the application. But if I use the first one, it works
Because of this, each time, I do "mvn clean install" in IDE and I manually undeploy "MyStartUp" and deploy new install of "MyStartUp". This takes away my time. I want to add my project to Server in IDE and restart it when I make a change and run the application. How to fix this issue?
PS:
Here is my web.xml
<web-app version="2.2" id="WebApp_ID">
<!-- <display-name>Archetype Created Web Application</display-name> -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/mvc/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/WEB-INF/jsp/template.jsp</welcome-file>
</welcome-file-list>
</web-app>
This is how my git clone looks
git clone https://MyStartUp#bitbucket.org/MyStartUp/mystartup.git