WFLYEE0007: Not installing optional component org.apache.cxf.transport.servlet.CXFServlet due to an exception - cxf

i want to deploy cxf-based application on wildfly17. i have not included external cxf library in war i want to use internal cxf of wildfly.?
server.log
2019-08-20 17:59:57,235 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore C:\Users\kumarkun\Downloads\jars\wildfly\wildfly-16.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
2019-08-20 17:59:57,261 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\kumarkun\Downloads\jars\wildfly\wildfly-16.0.0.Final\standalone\deployments
2019-08-20 17:59:57,277 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "proj2.war" (runtime-name: "proj2.war")
2019-08-20 17:59:57,962 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
2019-08-20 17:59:58,058 INFO [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0493: EJB subsystem suspension complete
2019-08-20 17:59:58,192 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
2019-08-20 17:59:58,470 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
2019-08-20 17:59:58,658 INFO [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBossWS 5.2.4.Final (Apache CXF 3.2.7)
2019-08-20 17:59:59,641 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.apache.cxf.transport.servlet.CXFServlet due to an exception (enable DEBUG log level to see the cause)
2019-08-20 17:59:59,805 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.web.context.ContextLoaderListener due to an exception (enable DEBUG log level to see the cause)
2019-08-20 18:00:00,144 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-3) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.8.Final
2019-08-20 18:00:00,191 INFO [org.jboss.ws.cxf.metadata] (MSC service thread 1-7) JBWS024061: Adding service endpoint metadata: id=com.services.Addition
address=http://localhost:8080/proj2/AdditionService
implementor=com.services.Addition
serviceName={http://services.com/}AdditionService
portName={http://services.com/}AdditionPort
annotationWsdlLocation=null
wsdlLocationOverride=null
mtomEnabled=false
2019-08-20 18:00:00,230 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."proj2.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."proj2.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "proj2.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jboss.wsf.spi.WSFException: WFLYWS0066: Servlet class org.apache.cxf.transport.servlet.CXFServlet declared in web.xml; either provide a proper deployment relying on JBossWS or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled.
at org.jboss.as.webservices.tomcat.WebMetaDataModifier.configureEndpoints(WebMetaDataModifier.java:98)
at org.jboss.as.webservices.tomcat.WebMetaDataModifier.modify(WebMetaDataModifier.java:63)
at org.jboss.as.webservices.tomcat.WebMetaDataModifyingDeploymentAspect.start(WebMetaDataModifyingDeploymentAspect.java:40)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
... 8 more
2019-08-20 18:00:00,739 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 74) WFLYCLINF0002: Started client-mappings cache from ejb container
2019-08-20 18:00:00,939 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "proj2.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"proj2.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of deployment \"proj2.war\"
Caused by: org.jboss.wsf.spi.WSFException: WFLYWS0066: Servlet class org.apache.cxf.transport.servlet.CXFServlet declared in web.xml; either provide a proper deployment relying on JBossWS or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled."}}
2019-08-20 18:00:00,970 INFO [org.jboss.as.server] (ServerService Thread Pool -- 43) WFLYSRV0010: Deployed "proj2.war" (runtime-name : "proj2.war")
2019-08-20 18:00:00,973 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."proj2.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "proj2.war"
2019-08-20 18:00:01,153 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2019-08-20 18:00:01,157 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2019-08-20 18:00:01,157 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2019-08-20 18:00:01,158 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) started (with errors) in 11390ms - Started 371 of 561 services (1 services failed or missing dependencies, 326 services are lazy, passive or on-demand)
i tried to few solution:
1) comment out:-
standalone.xml
<extension module="org.jboss.as.webservices"/>
<subsystem xmlns="urn:jboss:domain:webservices:2.0" statistics-enabled="${wildfly.webservices.statistics-enabled:${wildfly.statistics-enabled:false}}">
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>
<endpoint-config name="Recording-Endpoint-Config">
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
</pre-handler-chain>
</endpoint-config>
<client-config name="Standard-Client-Config"/>
</subsystem>
2)
adding dependencies in MAINFIST.MF
Dependencies: org.apache.cxf services
Addition.java :-
#WebService(targetNamespace = "http://services.com/", portName = "AdditionPort", serviceName = "AdditionService")
public class Addition {
#WebMethod(operationName = "func1", action = "urn:Func1")
public int func1(#WebParam(name = "arg0") int x, #WebParam(name = "arg1") int y) {
return x+y;
}
}
web.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>proj1</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description>Apache CXF Endpoint</description>
<display-name>cxf</display-name>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf-beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
cxf-bean.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint xmlns:tns="http://services.com/"
id="addition" implementor="com.services.Addition"
wsdlLocation="wsdl/addition.wsdl" endpointName="tns:AdditionPort"
serviceName="tns:AdditionService" address="/AdditionPort">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" scope="singleton" />
</jaxws:features>
</jaxws:endpoint>
</beans>
applicationConext.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:property-placeholder properties-ref="deployProperties"/>
<!-- Activates various annotations to be detected in bean classes -->
<context:annotation-config/>
<!-- Imports SpringMVC configuration -->
<import resource="cxf-beans.xml" />
</beans>
i expect to deploy cxf based applicaion on wildfly server using wildfly internal modules.

Related

Exceptions on startup: JAX RS 2.1 and Weblogic 12.2.1.3

I'm using cxf 3.2.1 and camel 2.20.2 on a weblogic 12.2.1.3 application server. The appliation is working, but on startup a lot of exceptions(log warning) are raised:
WARNING: HK2 service reification failed for
[org.apache.cxf.jaxrs.spring.SpringViewResolverProvider] with an exception:
MultiException stack 1 of 2
java.lang.NoSuchMethodException: Could not find a suitable constructor in org.apache.cxf.jaxrs.spring.SpringViewResolverProvider class.
at org.glassfish.jersey.internal.inject.JerseyClassAnalyzer.getConstructor(JerseyClassAnalyzer.java:192)
MultiException stack 2 of 2
java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
implementation=org.apache.cxf.jaxrs.spring.SpringViewResolverProvider
I think it's because of the dependency of cxf to jax rs 2.1 and weblogic uses jax rs 2.0.
Extract of the libs(300+) in deployment:
cxf-core-3.2.1.jar
cxf-rt-bindings-soap-3.2.1.jar
cxf-rt-bindings-xml-3.2.1.jar
cxf-rt-databinding-jaxb-3.2.1.jar
cxf-rt-frontend-jaxrs-3.2.1.jar
cxf-rt-frontend-jaxws-3.2.1.jar
cxf-rt-frontend-simple-3.2.1.jar
cxf-rt-rs-client-3.2.1.jar
cxf-rt-security-3.2.1.jar
cxf-rt-security-saml-3.2.1.jar
cxf-rt-transports-http-3.2.1.jar
cxf-rt-ws-addr-3.2.1.jar
cxf-rt-ws-policy-3.2.1.jar
cxf-rt-ws-security-3.2.1.jar
cxf-rt-wsdl-3.2.1.jar
javax.servlet-api-3.1.0.jar
javax.ws.rs-api-2.1.jar
weblogic-application.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application
xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<wls:prefer-application-packages>
<wls:package-name>javax.wsdl.*</wls:package-name>
<wls:package-name>antlr.*</wls:package-name>
<wls:package-name>javax.faces.*</wls:package-name>
<wls:package-name>com.sun.mail.*</wls:package-name>
<wls:package-name>javax.mail.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>
How can I get jax rs 2.1 working on weblogic 12.2.1.3?
Or how it is possible to suppress the warning messages?

Apache camel war deployment JBoss EAP 6.1

Iam trying to deploy a sample camel war application created using maven archetype camel-archetype-web:
https://mvnrepository.com/artifact/org.apache.camel.archetypes/camel-archetype-web/2.10.0.redhat-60092
Iam getting below info and warning in logs ,the camel application is not running.
The application is placed in below link.
https://drive.google.com/file/d/0B7junC5UmfFgNlFJVnFtOENtd2s/view?usp=sharing
Server log:
10:11:49,488 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "sampleapp-0.0.1-SNAPSHOT.war" (runtime-name: "sampleapp-0.0.1-SNAPSHOT.war")
10:11:51,324 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry jaxb-api.jar in /C:/Temp/FSW/jboss-eap-6.1/bin/content/sampleapp-0.0.1-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.2.5.jar does not point to a valid jar for a Class-Path reference.
10:11:51,340 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry activation.jar in /C:/Temp/FSW/jboss-eap-6.1/bin/content/sampleapp-0.0.1-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.2.5.jar does not point to a valid jar for a Class-Path reference.
10:11:51,355 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry jsr173_1.0_api.jar in /C:/Temp/FSW/jboss-eap-6.1/bin/content/sampleapp-0.0.1-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.2.5.jar does not point to a valid jar for a Class-Path reference.
10:11:51,371 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry jaxb1-impl.jar in /C:/Temp/FSW/jboss-eap-6.1/bin/content/sampleapp-0.0.1-SNAPSHOT.war/WEB-INF/lib/jaxb-impl-2.2.5.jar does not point to a valid jar for a Class-Path reference.
10:11:51,527 INFO [org.jboss.web] (ServerService Thread Pool -- 110) JBAS018210: Register web context: /sampleapp-0.0.1-SNAPSHOT
10:11:51,543 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sampleapp-0.0.1-SNAPSHOT]] (ServerService Thread Pool -- 110) No Spring WebApplicationInitializer types detected on classpath
10:11:51,558 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sampleapp-0.0.1-SNAPSHOT]] (ServerService Thread Pool -- 110) Initializing Spring root WebApplicationContext
10:11:52,812 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018565: Replaced deployment "sampleapp-0.0.1-SNAPSHOT.war" with deployment "sampleapp-0.0.1-SNAPSHOT.war"
Any Help appreciated.

cronscheduledroutepolicy not working as expected in switchyard

I am trying to implement cronscheduledroutepolicy in camel route and it is not working as expected. I am expecting switchyard Route to stop and start at cron trigger. I had added routePolicyRef="customRoutePolicy" and autoStartup="false" attributes in route definition.
logs:
23:07:01,530 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar
23:07:01,558 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar (runtime-name: Thunderhead-POC-PDF-1.1-SNAPSHOT.jar) in 30ms
23:07:01,559 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar" (runtime-name: "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar")
23:07:01,657 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar
23:07:01,716 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016005: Starting Services for CDI deployment: Thunderhead-POC-PDF-1.1-SNAPSHOT.jar
23:07:01,718 INFO [org.switchyard] (MSC service thread 1-4) Deploying SwitchYard application 'Thunderhead-POC-PDF-1.1-SNAPSHOT.jar'
23:07:01,720 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starting weld service for deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar
23:07:01,764 INFO [org.switchyard] (MSC service thread 1-4) Starting SwitchYard service
23:07:01,768 INFO [org.apache.camel.management.ManagementStrategyFactory] (MSC service thread 1-4) JMX enabled.
23:07:01,771 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-33) is starting
23:07:01,805 INFO [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-4) Loaded 181 type converters
23:07:01,814 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Total 0 routes, of which 0 is started.
23:07:01,814 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-33) started in 0.043 seconds
23:07:01,967 INFO [org.quartz.simpl.SimpleThreadPool] (MSC service thread 1-4) Job execution threads will use class loader of thread: MSC service thread 1-4
23:07:01,978 INFO [org.quartz.core.SchedulerSignalerImpl] (MSC service thread 1-4) Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
23:07:01,979 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-4) Quartz Scheduler v.1.8.5 created.
23:07:01,979 INFO [org.quartz.simpl.RAMJobStore] (MSC service thread 1-4) RAMJobStore initialized.
23:07:01,980 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-4) Scheduler meta-data: Quartz Scheduler (v1.8.5) 'DefaultQuartzScheduler-camel-33' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
23:07:01,980 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-4) Quartz scheduler 'DefaultQuartzScheduler-camel-33' initialized from an externally provided properties instance.
23:07:01,980 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-4) Quartz scheduler version: 1.8.5
23:07:01,980 INFO [org.apache.camel.component.quartz.QuartzComponent] (MSC service thread 1-4) Starting Quartz scheduler: DefaultQuartzScheduler-camel-33
23:07:01,981 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-4) Scheduler DefaultQuartzScheduler-camel-33_$_NON_CLUSTERED started.
23:07:01,982 INFO [org.apache.camel.routepolicy.quartz.ScheduledRoutePolicy] (MSC service thread 1-4) Scheduled trigger: triggerGroup-route19.trigger-START-route19 for action: START on route route19
23:07:02,001 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Skipping starting of route route19 as its configured with autoStartup=false
23:07:02,153 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Route: direct:{urn:com.example.switchyard:Thunderhead-POC-PDF:1.0}ESBService started and consuming from: Endpoint[direct://%7Burn:com.example.switchyard:Thunderhead-POC-PDF:1.0%7DESBService]
23:07:02,217 INFO [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Route: V1CamelJmsBindingModel/ESBService#jms1#-275801100 started and consuming from: Endpoint[jms://queue:Document.Eu.In.Deferred?connectionFactory=%23ConnectionFactory&replyTo=Document.Eu.Out.Result]
23:07:02,319 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018565: Replaced deployment "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar" with deployment "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar"
Iam trying similar to this Throttling based on time interval need to pick messages from queue only during cron trigger,but the attached component starts listening the queue once deployment is done.
can you please tell me what might be the issue?
Camel Route:
<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="http://camel.apache.org/schema/spring">
<route streamCache="true" routePolicyRef="customRoutePolicy" autoStartup="false">
<from uri="switchyard://ESBService" />
<log message="Header is: ${headers.ResponseType}" />
<choice>
<when>
<simple>${headers.ResponseType} == 'XMLANDPDF'</simple>
<bean ref="CreateStub" method="setAttachmentInHeader()" />
<to uri="xslt:xslt/create-response.xslt" />
</when>
<otherwise>
<bean ref="CreateStub" method="setAttachmentInBody()" />
</otherwise>
</choice>
<log message="Response is: ${body}" />
</route>
</routes>
Route Policy:
package com.example.switchyard.Thunderhead_POC_PDF;
import javax.enterprise.inject.Produces;
import javax.inject.Named;
import org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy;
public class MyRoutePolicy{
#Produces #Named("customRoutePolicy")
public static CronScheduledRoutePolicy createRoutePolicy ()
{
CronScheduledRoutePolicy policy=new CronScheduledRoutePolicy();
policy.setRouteStartTime("0 27 18 ? * *");
policy.setRouteStopGracePeriod(10000);
policy.setRouteStartTime("0 29 18 ? * *");
return policy;
}
}
Switchyard xml:
<?xml version="1.0" encoding="UTF-8"?>
<sy:switchyard xmlns:camel="urn:switchyard-component-camel:config:1.1" xmlns:jms="urn:switchyard-component-camel-jms:config:1.1" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sy="urn:switchyard-config:switchyard:1.1" name="Thunderhead-POC-PDF" targetNamespace="urn:com.example.switchyard:Thunderhead-POC-PDF:1.0">
<sca:composite name="Thunderhead-POC-PDF" targetNamespace="urn:com.example.switchyard:Thunderhead-POC-PDF:1.0">
<sca:component name="Component">
<camel:implementation.camel>
<camel:xml path="route.xml"/>
</camel:implementation.camel>
<sca:service name="ESBService">
<sy:interface.esb inputType="java.lang.String" outputType="java.io.InputStream"/>
</sca:service>
</sca:component>
<sca:service name="ESBService" promote="Component/ESBService">
<sy:interface.esb inputType="java.lang.String" outputType="java.io.InputStream"/>
<jms:binding.jms name="jms1">
<jms:contextMapper includes="sourceSystemID.*,ResponseType.*"/>
<jms:queue>Document.Eu.In.Deferred</jms:queue>
<jms:connectionFactory>#ConnectionFactory</jms:connectionFactory>
<jms:replyTo>Document.Eu.Out.Result</jms:replyTo>
</jms:binding.jms>
</sca:service>
</sca:composite>
</sy:switchyard>

Google App Engine HTTP Error 403

I am trying to write a simple Google App Engine application. I am following this tutorial:
https://developers.google.com/appengine/docs/java/gettingstarted/creating, however I cannot make it working.
When testing on the localhost, I receive:
HTTP ERROR 403
Problem accessing /. Reason:
FORBIDDEN
Powered by Jetty://
This is my application code:
package test;
import java.io.IOException;
import javax.servlet.http.*;
public class Test extends HttpServlet {
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
}
My web.xml file:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
"-//Oracle Corporation//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>test.Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
My appengine-web.xml file:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>halocline-test</application>
<version>10</version>
<!--
Allows App Engine to send multiple requests to one instance in parallel:
-->
<threadsafe>true</threadsafe>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
<!--
HTTP Sessions are disabled by default. To enable HTTP sessions specify:
<sessions-enabled>true</sessions-enabled>
It's possible to reduce request latency by configuring your application to
asynchronously write HTTP session data to the datastore:
<async-session-persistence enabled="true" />
With this feature enabled, there is a very small chance your app will see
stale session data. For details, see
http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions
-->
</appengine-web-app>
Console output:
Jul 06, 2012 2:42:34 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jul 06, 2012 2:42:35 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Halocline\workspace\Test\war\WEB-INF/appengine-web.xml
Jul 06, 2012 2:42:35 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\Users\Halocline\workspace\Test\war\WEB-INF/web.xml
Jul 06, 2012 3:42:36 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/
Jul 06, 2012 3:42:36 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8888/_ah/admin
No errors are shown in the console when I open localhost:8888 in my web browser.
Any idea what I am doing wrong?
You servlet is mapped to http://localhost:8888/test
I believe you might have your index.html file in a wrong directory. Check it did not accidentally slip under WEB-INF. It should be directly under war.

debugging JAX-RS service registration on jboss AS 7.1

I have setup a very simple test application to try RESTeasy on Jboss AS 7.1.
Environment:
jboss-as-7.1.0.Final
eclipse 3.7 with Jboss Tools
maven 3
I followed the steps in the tutorial but did not get the same result. The webapp is deployed correctly and it appears in the admin console but it does not work as intended.
The server invariably tells me 404 Resource not available when I try to access http://localhost:8080/SeamSertalVision/services/test
There are 4 files in the whole project:
pom.xml
web.xml
RestApplication.java
Login.java
the pom.xml has one dependency which resolves fine:
<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>ch.sertal</groupId>
<artifactId>SertalVision</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>SertalVision</name>
<description />
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<resteasy.version>2.3.1.GA</resteasy.version>
</properties>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<outputDirectory>${basedir}/build/classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<!-- Include the JBoss Maven repository so we can access JBoss artifacts -->
<repositories>
<repository>
<id>jboss-public-repository</id>
<name>JBoss Repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository</id>
<name>JBoss Repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
the web.xml is empty:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Sertal Vision</display-name>
</web-app>
the RestApplication.java is empty:
package ch.sertal.vision.server;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
#ApplicationPath("/services")
public class RestApplication extends Application {
}
the Login.java contains just one method for testing:
package ch.sertal.vision.server;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
#Path( "/test" )
public class Login {
#GET
#Produces(MediaType.TEXT_HTML)
public Response login() {
return Response.ok( "logged in" ).build();
}
}
that's the whole thing, as it was described in the tutorial (I believe). The deployment works fine. If I add a welcome-file entry to the web.xml it is displayed.
here is the jboss log after teh application is deployed:
WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.
11:35:17,819 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
11:35:18,016 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
11:35:18,060 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.0.Final "Thunder" starting
11:35:18,721 INFO [org.xnio] XNIO Version 3.0.3.GA
11:35:18,722 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
11:35:18,732 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
11:35:18,743 INFO [org.jboss.remoting] JBoss Remoting version 3.2.2.GA
11:35:18,755 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
11:35:18,758 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
11:35:18,770 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
11:35:18,779 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
11:35:18,780 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
11:35:18,781 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
11:35:18,796 INFO [org.jboss.as.security] (MSC service thread 1-10) JBAS013100: Current PicketBox version=4.0.6.final
11:35:18,803 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
11:35:18,829 INFO [org.jboss.as.connector] (MSC service thread 1-9) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
11:35:18,856 INFO [org.jboss.as.naming] (MSC service thread 1-11) JBAS011802: Starting Naming Service
11:35:18,861 INFO [org.jboss.as.mail.extension] (MSC service thread 1-12) JBAS015400: Bound mail session [java:jboss/mail/Default]
11:35:18,911 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
11:35:18,937 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.1.GA
11:35:19,014 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
11:35:19,288 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-13) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
11:35:19,556 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) JBAS015012: Started FileSystemDeploymentService for directory /Development/jboss-as-7.1.0.Final/standalone/deployments
11:35:19,561 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found SeamSertalVision.war in deployment directory. To trigger deployment create a file called SeamSertalVision.war.dodeploy
11:35:19,574 INFO [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on /127.0.0.1:9999
11:35:19,574 INFO [org.jboss.as.remoting] (MSC service thread 1-11) JBAS017100: Listening on /127.0.0.1:4447
11:35:19,664 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.0.Final "Thunder" started in 2145ms - Started 134 of 205 services (70 services are passive or on-demand)
11:35:19,676 INFO [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015876: Starting deployment of "SeamSertalVision.war"
11:35:20,028 INFO [org.jboss.web] (MSC service thread 1-13) JBAS018210: Registering web context: /SeamSertalVision
11:35:20,066 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "SeamSertalVision.war"
My question is: how can I verify that my Webservice is being registered? There is no hint to his in the log but no error either. There must be something wrong but I can't see what it is.
I have an application on Tomcat with Jersey and there the log clearly shows which classes perform RESTful services.
thank you for your help.
You will not see if the REST service is registered during startup because the service only starts on-demand, then you will see something like this:
INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-1)
Found BeanManager at java:comp/BeanManager
INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8080-1)
Deploying javax.ws.rs.core.Application:
class my.rest.JaxRsActivator$Proxy$_$$_WeldClientProxy
I don't see a significant error in your configuration, but it's possible that you are missing a WEB-INF/beans.xml?
To get a working example of a JBoss7 with a REST service you can create a new project using the following archetype: org.jboss.spec.archetypes:jboss-javaee6-ear-webapp:7.0.2.CR2
(you have to change the version of all JBoss dependencies from 7.0.2.CR2 to 7.1.0.Final).

Resources