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>
Related
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.
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.
I am trying to deploy a .war file called LicenseManager.war. The data server is hosted on another machine with an ip address. I am the database drivers have been correctly imported. After trying to copy and paste the LicenseManager.war file in deployments folder, the deployment fails and a LicenseManager.war.failed is created. The following is the server log :
2017-09-07 14:38:47,802 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 59) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
2017-09-07 14:38:47,825 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 59) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
2017-09-07 14:38:47,859 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 59) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
2017-09-07 14:38:47,859 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 59) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
2017-09-07 14:38:48,415 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0006: Starting Services for CDI deployment: LicenseManager.war
2017-09-07 14:38:48,602 INFO [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.3.3 (redhat)
2017-09-07 14:38:48,851 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0009: Starting weld service for deployment LicenseManager.war
2017-09-07 14:38:49,303 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 59) WFLYCLINF0002: Started client-mappings cache from ejb container
2017-09-07 14:38:49,642 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "LicenseManager.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"LicenseManager.war#LicenseManager\" is missing [jboss.naming.context.java.jboss.manageIDDatasource]",
"jboss.persistenceunit.\"LicenseManager.war#LicenseManager\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.manageIDDatasource]"
]}
2017-09-07 14:38:49,734 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "LicenseManager.war" (runtime-name : "LicenseManager.war")
2017-09-07 14:38:49,755 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.manageIDDatasource (missing) dependents: [service jboss.persistenceunit."LicenseManager.war#LicenseManager", service jboss.persistenceunit."LicenseManager.war#LicenseManager".__FIRST_PHASE__]
2017-09-07 14:38:50,197 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management
2017-09-07 14:38:50,198 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990
2017-09-07 14:38:50,198 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: JBoss EAP 7.0.0.GA (WildFly Core 2.1.2.Final-redhat-1) started (with errors) in 18730ms - Started 578 of 983 services (135 services failed or missing dependencies, 385 services are lazy, passive or on-demand)
2017-09-07 14:38:50,410 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 59) WFLYCLINF0003: Stopped client-mappings cache from ejb container
2017-09-07 14:38:50,541 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment LicenseManager.war (runtime-name: LicenseManager.war) in 301ms
2017-09-07 14:38:50,724 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location /home/aboshi/EAP-7.0.0/standalone/data/content/7e/7e872f95551f1c9ff56e422fcc5a18b44a4e12/content
2017-09-07 14:38:50,724 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "LicenseManager.war" (runtime-name: "LicenseManager.war")
2017-09-07 14:38:50,783 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.deployment.unit."LicenseManager.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."LicenseManager.war".component."com.sun.faces.taglib.html_basic.CommandButtonTag".WeldInstantiator, service jboss.deployment.unit."LicenseManager.war".component."com.sun.faces.taglib.jsf_core.RegexValidatorTag".WeldInstantiator, service jboss.deployment.unit."LicenseManager.war".component."com.sun.faces.taglib.jsf_core.SelectItemTag".WeldInstantiator, service jboss.deployment.unit."LicenseManager.war".component.LicenseTimerBean.WeldInterceptorBindingsService, WFLYCTL0208: ... and 63 more ]
service jboss.deployment.unit."LicenseManager.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."LicenseManager.war".component."com.sun.faces.taglib.html_basic.CommandButtonTag".WeldInstantiator, service jboss.deployment.unit."LicenseManager.war".component."com.sun.faces.taglib.jsf_core.RegexValidatorTag".WeldInstantiator, service jboss.deployment.unit."LicenseManager.war".component."com.sun.faces.taglib.jsf_core.SelectItemTag".WeldInstantiator, service jboss.deployment.unit."LicenseManager.war".component.LicenseTimerBean.WeldInterceptorBindingsService, WFLYCTL0208: ... and 64 more ]
service jboss.deployment.unit."LicenseManager.war".beanmanager (missing) dependents: [service jboss.persistenceunit."LicenseManager.war#LicenseManager"]
service jboss.deployment.unit."LicenseManager.war".component.LicenseManagerAction.CREATE (missing) dependents: [service jboss.deployment.unit."LicenseManager.war".component.LicenseManagerAction.START] service jboss.deployment.unit."LicenseManager.war".component.LicenseManagerAction.JndiBindingsService (missing) dependents: [service jboss.deployment.unit."LicenseManager.war".jndiDependencyService]
service
Also, one of the main errors is :
6:34:19,720 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "LicenseManager.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"LicenseManager.war#LicenseManager\" is missing [jboss.naming.context.java.jboss.manageIDDatasource]",
"jboss.persistenceunit.\"LicenseManager.war#LicenseManager\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.manageIDDatasource]"
]}
This is way too much to understand. Also, a similar configuration ran successfully on a windows 7 OS where again, the database was external. But this one is on RHEL 7.4. Can some please help me understand what is going on? Thank you very much!!
Regards,
Abhi Joe
It seems JBoss is not finding the datasource where it expects it:
jboss.naming.context.java.jboss.manageIDDatasource
You might first turn logging to 'debug' then start the server-- grep for any lines that deal with manageIDDatasource.
It's quite possible the deployment of the datasource wasn't as smooth as could be. Look for examples of doing this, then when there are no errors things should be better. (If there are still questions about the validity of the datasource, then maybe write a small servlet to retrieve and test it)
While I was debugging my Camel application I realized, that the graceful shutdown of a route ignores the outstanding tasks that have been triggered by wireTap().
If I have a route definition like this:
from("direct:start")
.wireTap("bean:myWireTapBean")
.to("mock:result");
and I set a debugging breakpoint in myWireTapBean (i.e. suspend the asynchronous processing of wireTap) then a CamelContext.stopRoute(routeId) call produces the following log messages:
11:36:12.352 [Thread-1] INFO o.a.camel.spring.SpringCamelContext - Apache Camel 2.19.1 (CamelContext: camel-1) is shutting down
11:36:12.352 [Thread-1] INFO o.a.c.impl.DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 300 seconds)
11:36:12.352 [Camel (camel-1) thread #6 - ShutdownTask] INFO o.a.c.impl.DefaultShutdownStrategy - Route: route1 shutdown complete, was consuming from: direct://myRoute
11:36:12.352 [Thread-1] INFO o.a.c.impl.DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
11:36:12.478 [Thread-1] WARN o.a.c.impl.DefaultInflightRepository - Shutting down while there are still 1 inflight exchanges.
11:36:12.478 [Thread-1] INFO o.a.camel.spring.SpringCamelContext - Apache Camel 2.19.1 (CamelContext: camel-1) uptime 1.411 seconds
11:36:12.478 [Thread-1] INFO o.a.camel.spring.SpringCamelContext - Apache Camel 2.19.1 (CamelContext: camel-1) is shutdown in 0.126 seconds
Is there any way to prevent Camel from shutting down while there are still inflight exchanges in the DefaultInflightRepository that have been created by wireTap?
I've already read the FAQ: How can I stop a route from a route but this doesn't seem to be an answer to this question.
Yeah the current implementation of WireTap does not take in account of active tasks if they are not being routed.
I logged a ticket to add support for deferring shutdown of the WireTap EIP if it has inflight tasks: https://issues.apache.org/jira/browse/CAMEL-11539
The workaround is to create a route such as direct and then call that route where you can then call the bean, then when you shutdown Camel the direct route will have inflight exchanges and therefore wait for it to complete.
The DefaultShutdownStrategy's default behavior is to complete route shutdowns, so it is one of those things where the default works for many scenarios, but not all and you are in the latter. If the exchange is run within a transaction, it would rollback, you might look at sourcing from a JMS queue or other so you can rollback and resume processing.
The Javadocs have good information on the behavior and various options you can use to configure the DefaultShutdownStrategy before considering writing a custom one:
DefaultShutdownStrategy
I'm using apache camel 2.12.1 to create a route and then move some files in my local directory, the exmple runs fine but the files are never moved, this is the code for the class.
public class MoveFilesTest {
private static final Log LOG = LogFactory.getLog(MoveFilesTest.class);
public static void main(String args[]) throws Exception {
LOG.debug("create CamelContext");
CamelContext context = new DefaultCamelContext();
// add our route to the CamelContext
context.addRoutes(new RouteBuilder() {
File file = null;
public void configure() {
from("file:data/inbox?delay=100&noop=true")
.process( new Processor() {
public void process(Exchange msg) throws Exception {
File file = msg.getIn().getBody(File.class);
LOG.debug("Processing file: " + file.getName());
}
})
.to("file:data/outbox").end();
}
});
LOG.debug("start the route and let it do its work");
context.start();
context.stop();
}
}
as a note, this code just to work, now i'm working on mac os x 10.7, this is the debug log. i added the noop=false and the delete=true, but the result is the same. thank you
DEBUG [main] (MoveFilesTest.java:24) - create CamelContext
DEBUG [main] (MoveFilesTest.java:45) - start the route and let it do its work
INFO [main] (DefaultCamelContext.java:1498) - Apache Camel 2.12.1 (CamelContext: camel-1) is starting
INFO [main] (ManagedManagementStrategy.java:187) - JMX is enabled
INFO [main] (DefaultTypeConverter.java:50) - Loaded 176 type converters
INFO [main] (DefaultCamelContext.java:1689) - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
INFO [main] (FileEndpoint.java:83) - Endpoint is configured with noop=true so forcing endpoint to be idempotent as well
INFO [main] (FileEndpoint.java:89) - Using default memory based idempotent repository with cache max size: 1000
INFO [main] (DefaultCamelContext.java:2183) - Route: route1 started and consuming from: Endpoint[file://data/inbox?delay=100&noop=true]
INFO [main] (DefaultCamelContext.java:1533) - Total 1 routes, of which 1 is started.
INFO [main] (DefaultCamelContext.java:1534) - Apache Camel 2.12.1 (CamelContext: camel-1) started in 8.936 seconds
INFO [main] (DefaultCamelContext.java:1706) - Apache Camel 2.12.1 (CamelContext: camel-1) is shutting down
INFO [main] (DefaultShutdownStrategy.java:172) - Starting to graceful shutdown 1 routes (timeout 300 seconds)
INFO [Camel (camel-1) thread #2 - ShutdownTask] (DefaultShutdownStrategy.java:600) - Route: route1 shutdown complete, was consuming from: Endpoint[file://data/inbox?delay=100&noop=true]
INFO [main] (DefaultShutdownStrategy.java:217) - Graceful shutdown of 1 routes completed in 0 seconds
INFO [main] (DefaultCamelContext.java:1780) - Apache Camel 2.12.1 (CamelContext: camel-1) uptime 8.953 seconds
INFO [main] (DefaultCamelContext.java:1781) - Apache Camel 2.12.1 (CamelContext: camel-1) is shutdown in 0.013 seconds
Yes, you start Camel and stop it immediately. So, when you put a file to a folder. It wont process cuz camel is already stopped.
Camel contains Main implementation to keep Camel running in standalone application.
There is link: http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html
CamelContext.start does not block, so basically you are starting the context and then immediately stopping it. You need to wait or block on something until the context should stop. You can reference this thread for some ways of doing this.
I had a similar problem but that was to do with streamCaching() not getting set properly and so the code below was failing
context.getStreamCachingStrategy().setSpoolDirectory(spoolDirectory);
from(uri.toString()).streamCaching().to(destination);
I set the Streaming directly on CamelContext and that solved the problem
CamelContext context = getContext();
context.setStreamCaching(true);
context.getStreamCachingStrategy().setSpoolDirectory(localSpoolDirectory);
context.getStreamCachingStrategy().setSpoolThreshold(Long.parseLong(spoolThreshold.trim()));
context.getStreamCachingStrategy().setBufferSize(Integer.parseInt(bufferSize.trim()));