I try to read connection parameters from my datasource to make a JDBC connection. But i get following exception[1]
Im using wildfly 10.x
Im trying like;
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:jboss/datasources/myDS");
// Look up our data source
DataSource ds = (DataSource)
envCtx.lookup("java:/testdb");
Can anybody helps me out?
[1]
16:44:05,140 ERROR [stderr] (ServerService Thread Pool -- 68) java.lang.ClassCastException: org.jboss.as.connector.subsystems.datasources.WildFlyDataSource cannot be cast to javax.naming.Context
16:44:05,140 ERROR [stderr] (ServerService Thread Pool -- 68) at com.cdi.crud.infra.rest.RestApplication.initialize(RestApplication.java:117)
16:44:05,140 ERROR [stderr] (ServerService Thread Pool -- 68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:44:05,140 ERROR [stderr] (ServerService Thread Pool -- 68) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:44:05,140 ERROR [stderr] (ServerService Thread Pool -- 68) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:44:05,140 ERROR [stderr] (ServerService Thread Pool -- 68) at java.lang.reflect.Method.invoke(Method.java:497)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:98)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:81)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:126)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.resteasy.cdi.JaxrsInjectionTarget.postConstruct(JaxrsInjectionTarget.java:77)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:171)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
16:44:05,141 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:141)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at com.cdi.crud.infra.rest.RestApplication$Proxy$_$$_WeldClientProxy.getClasses(Unknown Source)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.resteasy.spi.ResteasyDeployment.processApplication(ResteasyDeployment.java:485)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:331)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:245)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
16:44:05,142 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
16:44:05,143 ERROR [stderr] (ServerService Thread Pool -- 68) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
16:44:05,144 ERROR [stderr] (ServerService Thread Pool -- 68) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
16:44:05,144 ERROR [stderr] (ServerService Thread Pool -- 68) at java.util.concurrent.FutureTask.run(FutureTask.java:266)
16:44:05,144 ERROR [stderr] (ServerService Thread Pool -- 68) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
16:44:05,144 ERROR [stderr] (ServerService Thread Pool -- 68) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
16:44:05,144 ERROR [stderr] (ServerService Thread Pool -- 68) at java.lang.Thread.run(Thread.java:745)
16:44:05,144 ERROR [stderr] (ServerService Thread Pool -- 68) at org.jboss.threads.JBossThread.run(JBossThread.java:320)
16:44:05,148 INFO [o
The error is described in the first line of the stack trace.
java.lang.ClassCastException: org.jboss.as.connector.subsystems.datasources.WildFlyDataSource cannot be cast to javax.naming.Context
You're doing a lookup on a javax.sql.DataSource and trying to cast it to a javax.naming.Context.
Related
I must migrate an existing application, running on Wildfly Swarm (2018) to Thorntail. Yes, I know this is outdated already, but ...
I did it with another application, without problems.
But now I get an deployment error:
2021-10-07 13:59:04,226 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Thorntail 2.5.0.Final (WildFly Core 7.0.0.Final) started in 3109ms - Started 150 of 155 services (31 services are lazy, passive or on-demand)
2021-10-07 14:02:35,651 ERROR [stderr] (main) org.wildfly.swarm.container.DeploymentException: java.lang.NullPointerException
2021-10-07 14:02:35,652 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:301)
2021-10-07 14:02:35,652 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:174)
2021-10-07 14:02:35,652 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:107)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer$Proxy$_$$_WeldClientProxy.deploy(Unknown Source)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.deploy(Swarm.java:476)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.main(Swarm.java:747)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2021-10-07 14:02:35,653 ERROR [stderr] (main) at java.lang.reflect.Method.invoke(Unknown Source)
2021-10-07 14:02:35,654 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:57)
2021-10-07 14:02:35,654 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.run(Main.java:134)
2021-10-07 14:02:35,654 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.main(Main.java:87)
2021-10-07 14:02:35,654 ERROR [stderr] (main) Caused by: java.lang.NullPointerException
2021-10-07 14:02:35,655 ERROR [stderr] (main) at io.smallrye.openapi.runtime.util.TypeUtil.getAnnotation(TypeUtil.java:281)
2021-10-07 14:02:35,655 ERROR [stderr] (main) at io.smallrye.openapi.runtime.util.TypeUtil.getSchemaAnnotation(TypeUtil.java:236)
2021-10-07 14:02:35,655 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.readKlass(OpenApiDataObjectScanner.java:236)
2021-10-07 14:02:35,655 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.depthFirstGraphSearch(OpenApiDataObjectScanner.java:206)
2021-10-07 14:02:35,655 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.process(OpenApiDataObjectScanner.java:190)
2021-10-07 14:02:35,655 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.process(OpenApiDataObjectScanner.java:141)
2021-10-07 14:02:35,656 ERROR [stderr] (main) at io.smallrye.openapi.runtime.util.SchemaFactory.introspectClassToSchema(SchemaFactory.java:242)
2021-10-07 14:02:35,656 ERROR [stderr] (main) at io.smallrye.openapi.runtime.util.SchemaFactory.typeToSchema(SchemaFactory.java:214)
2021-10-07 14:02:35,656 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsMethod(OpenApiAnnotationScanner.java:645)
2021-10-07 14:02:35,656 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsResourceClass(OpenApiAnnotationScanner.java:373)
2021-10-07 14:02:35,656 ERROR [stderr] (main) at io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.scan(OpenApiAnnotationScanner.java:207)
2021-10-07 14:02:35,656 ERROR [stderr] (main) at io.smallrye.openapi.runtime.OpenApiProcessor.modelFromAnnotations(OpenApiProcessor.java:72)
2021-10-07 14:02:35,657 ERROR [stderr] (main) at org.wildfly.swarm.microprofile.openapi.runtime.OpenApiDeploymentProcessor.process(OpenApiDeploymentProcessor.java:101)
2021-10-07 14:02:35,657 ERROR [stderr] (main) at org.wildfly.swarm.microprofile.openapi.runtime.OpenApiDeploymentProcessor$Proxy$_$$_WeldClientProxy.process(Unknown Source)
2021-10-07 14:02:35,657 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:233)
2021-10-07 14:02:35,657 ERROR [stderr] (main) ... 12 more
Debugging into the code at startup, I see that there is a NPE when parsing annotations of the Endpoint. The difference to my other application is, that the Payload uses Polymorphism:
#JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "eventType")
#JsonSubTypes({
#JsonSubTypes.Type(value = PayloadDocument.class, name = "document"),
#JsonSubTypes.Type(value = PayloadCampaign.class, name = "campaign"),
#JsonSubTypes.Type(value = PayloadMessage.class, name = "message")
})
public void setPayload(Payload payload) {
this.payload = payload;
}
The class Payload is abstract.
I solved the issue, without switching to Quarkus (what I will definitely do in the next step).
The problem was, that I used an Optional attribute in my Payload PoJo. I found it by digging a little deeper in the debugger.
After eliminating the Optional attribute, the deployment worked as expected.
For some reason, if I start the server with the wars on the deployment path, the server will timeout. If I start the server and immediatly deploy the wars, they deploy with no issues. So, is there a way to delay deployments to post-startup only ?
Log until timeout appears :
[] 2019-10-17 14:25:01,442 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-3) WFLYDM0111: Keystore C:\Software\wildfly-11.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-10-17 14:25:09,163 WARN [org.jboss.as.weld] (ServerService Thread Pool -- 69) WFLYWELD0052: Using deployment classloader to load proxy classes for module com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.jboss.weld.spi]
[] 2019-10-17 14:25:13,953 WARN [org.jboss.as.dependency.private] (MSC service thread 1-5) WFLYSRV0018: Deployment "deployment.backend-2.0-SNAPSHOT.war" is using a private module ("org.apache.httpcomponents") which may be changed or removed in future versions without notice.
[] 2019-10-17 14:25:15,296 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,301 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,302 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,308 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,309 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:18,964 WARN [org.jboss.as.weld] (ServerService Thread Pool -- 77) WFLYWELD0052: Using deployment classloader to load proxy classes for module com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.jboss.weld.spi]
[] 2019-10-17 14:25:25,824 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,824 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,824 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,824 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,826 WARN [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:26,736 WARN [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentTypeTranslation_#language; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:25:26,736 WARN [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentTypeTranslation_#importsource; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:25:26,743 WARN [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentSourceTranslation_#language; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:25:26,743 WARN [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentSourceTranslation_#importsource; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:30:01,444 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'add' at address '[
("core-service" => "management"),
("management-interface" => "http-interface")
]'
I think you might be interested in increasing the timeout of Wildfly, because the default timeout for applications is 5 minutes.
So you can adjust your standalone.xml and use something like this example, the time is in seconds by the way, so 900s would be 15 minutes...
Here is a link so you can check more variables that you may need (It is for Wildfly 10, but I think it is the same for Wildfly 11). So you can manage if you need a scan-interval or even if you want to deploy files that are in other directories by changing/adding a new path.
1 Option -> To increase timeout:
<system-properties>
<property name="jboss.as.management.blocking.timeout" value="900"/>
</system-properties>
...
<profile>
...
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir"
scan-interval="5000" deployment-timeout="900"
runtime-failure-causes-rollback=
"${jboss.deployment.scanner.rollback.on.failure:false}"/>
</subsystem>
...
</profile>
2 Option -> To cancel scanning, to start Wildfly then to deploy, you can turn off scanning by changing your standalone.xml:
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" scan-enabled="false"/>
So now you will just start Wildfly, after that, you will run jboss-cli.bat or jboss-cli.sh depending on your OS. Type "connect" and paste this /subsystem=deployment-scanner/scanner=default:write-attribute(name="scan-enabled",value=true)
So now your wars will be deployed at runtime - after your Wildfly already started 'clean' (PS.: I am considering the default ports and the default configuration of Wildfly). Regards
UPDATED
3 Option -> Modify your standalone.conf and increase your Wildfly JVM memory allocation to this values: set "JAVA_OPTS=-Xms2G -Xmx4G"
Then try to start Wildfly again, with your wars normally. (Just be sure to change the correct one, standalone.conf or standalone.conf.bat depending on your OS).
I think your memory allocation is causing this problem.
Following the documentation:
https://docs.jboss.org/hibernate/stable/ogm/reference/en-US/html_single/?v=5.3#ogm-gettingstarted
I am trying to use JPA OGM with MongoDB.
I have added the latest version of Hibernate ORM (5.2.14.Final) to the WildFly 11 module folder:
/usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/hibernate/5.2.14.Final
and downloaded and installed:
hibernate-ogm-modules-5.3.0.Final-wildfly-11-dist.zip
However when I build and deploy the EAR I get:
18:34:16,467 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "NOTiFYwell.ear" (runtime-name: "NOTiFYwell.ear")
18:34:18,044 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "NOTiFYwellWAR.war")
18:34:18,044 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0207: Starting subdeployment (runtime-name: "NOTiFYwellJAR.jar")
18:34:18,515 INFO [org.jboss.as.jpa] (MSC service thread 1-4) WFLYJPA0002: Read persistence.xml for NOTiFYwellPersistenceUnit
18:34:18,516 INFO [org.jboss.as.jpa] (MSC service thread 1-4) WFLYJPA0002: Read persistence.xml for NOTiFYwellMongoDBPersistenceUnit
18:34:18,776 WARN [org.jboss.modules] (MSC service thread 1-7) Failed to define class org.hibernate.jpa.HibernatePersistenceProvider in Module "org.hibernate:5.2.14.Final" from local module loader #6fffcba5 (finder: local module finder #34340fab (roots: /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules,/usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/.overlays/layer-base-wildfly-11-weld-2.4,/usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base)): org.jboss.modules.ModuleLoadError: org.hibernate.jipijapa-hibernate5:5.2.14.Final
at org.jboss.modules.ModuleLoadException.toError(ModuleLoadException.java:74)
at org.jboss.modules.Module.getPathsUnchecked(Module.java:1559)
at org.jboss.modules.Module.loadModuleClass(Module.java:708)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:358)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:713)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.<init>(HibernateOgmPersistence.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:74)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
18:34:18,777 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."NOTiFYwell.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."NOTiFYwell.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "NOTiFYwell.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.ogm.jpa.HibernateOgmPersistence'
at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:79)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:74)
... 7 more
Caused by: org.jboss.modules.ModuleLoadError: org.hibernate.jipijapa-hibernate5:5.2.14.Final
at org.jboss.modules.ModuleLoadException.toError(ModuleLoadException.java:74)
at org.jboss.modules.Module.getPathsUnchecked(Module.java:1559)
at org.jboss.modules.Module.loadModuleClass(Module.java:708)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:358)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:713)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.<init>(HibernateOgmPersistence.java:37)
... 12 more
18:34:18,781 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "NOTiFYwell.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYwell.ear\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"NOTiFYwell.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.ogm.jpa.HibernateOgmPersistence'
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.jboss.modules.ModuleLoadError: org.hibernate.jipijapa-hibernate5:5.2.14.Final"}}
18:34:18,783 ERROR [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0021: Deploy of deployment "NOTiFYwell.ear" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYwell.ear\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"NOTiFYwell.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.ogm.jpa.HibernateOgmPersistence'
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.jboss.modules.ModuleLoadError: org.hibernate.jipijapa-hibernate5:5.2.14.Final"}}
18:34:18,794 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0208: Stopped subdeployment (runtime-name: NOTiFYwellJAR.jar) in 11ms
18:34:18,798 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0208: Stopped subdeployment (runtime-name: NOTiFYwellWAR.war) in 14ms
18:34:18,812 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment NOTiFYwell.ear (runtime-name: NOTiFYwell.ear) in 29ms
18:43:58,465 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 1) WFLYDR0009: Content /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/standalone/data/content/b4/f50292c0e75f0a407d46c7649f8f03c7c1b6a2 is obsolete and will be removed
18:43:58,471 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 1) WFLYDR0002: Content removed from location /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/standalone/data/content/b4/f50292c0e75f0a407d46c7649f8f03c7c1b6a2/content
18:43:58,471 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 1) WFLYDR0009: Content /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/standalone/data/content/06/38d1a6bf571ddafcba91ee07ca7051924973f7 is obsolete and will be removed
18:43:58,474 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 1) WFLYDR0002: Content removed from location /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/standalone/data/content/06/38d1a6bf571ddafcba91ee07ca7051924973f7/content
It appears to unable to load:
Caused by: org.jboss.modules.ModuleLoadError:
org.hibernate.jipijapa-hibernate5:5.2.14.Final"}}
TIA.
Did you update Hibernate ORM using the modules zip? https://search.maven.org/remotecontent?filepath=org/hibernate/hibernate-orm-modules/5.2.14.Final/hibernate-orm-modules-5.2.14.Final-wildfly-11-dist.zip
That's where the missing module is.
I am new to drools.
I am using drools 6.5.0 and wildfly 10.
I am developing a REST application with drools rules and executing through REST url.
My drools rules are executed in eclipse perfectly. After that I have deployed my REST application on wildfly. It is successful.
But, If I call the url from browser, it throws the below exception in console.
Is it mandatory to deploy KIE server for the rule execution? Because in tomcat the same application is working fine without KIE server.
droolsTest.java
KieServices ks = KieServices.Factory.get(); //This statement is working fine
KieContainer kContainer = ks.getKieClasspathContainer(); // Error is thrown in this statement
KieSession kSession = kContainer.newKieSession("ksession-rules");
Message message = new Message();
message.setMessage("Hello World Testing");
message.setStatus(Message.HELLO);
kSession.insert(message);
kSession.fireAllRules();
System.out.println("Drools Rules execution is Completed");
14:47:43,604 INFO [stdout] (default task-19) Error caught :java.lang.NoClassDef
FoundError: Could not initialize class org.drools.compiler.kie.builder.impl.KieC
ontainerImpl
14:47:43,607 ERROR [stderr] (default task-19) java.lang.NoClassDefFoundError: Co
uld not initialize class org.drools.compiler.kie.builder.impl.KieContainerImpl
14:47:43,625 ERROR [stderr] (default task-19) at org.drools.compiler.kie.build
er.impl.KieServicesImpl.newKieClasspathContainer(KieServicesImpl.java:135)
14:47:43,626 ERROR [stderr] (default task-19) at org.drools.compiler.kie.build
er.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:101)
14:47:43,626 ERROR [stderr] (default task-19) at org.drools.compiler.kie.build
er.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:79)
14:47:43,627 ERROR [stderr] (default task-19) at com.sample.DroolsTest.drools(
DroolsTest.java:45)
14:47:43,627 ERROR [stderr] (default task-19) at com.abc.rest.MessageRestSe
rvice.TestDroolsCode(MessageRestService.java:29)
14:47:43,628 ERROR [stderr] (default task-19) at sun.reflect.NativeMethodAcces
sorImpl.invoke0(Native Method)
14:47:43,628 ERROR [stderr] (default task-19) at sun.reflect.NativeMethodAcces
sorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:47:43,628 ERROR [stderr] (default task-19) at sun.reflect.DelegatingMethodA
ccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:47:43,629 ERROR [stderr] (default task-19) at java.lang.reflect.Method.invo
ke(Method.java:498)
14:47:43,630 ERROR [stderr] (default task-19) at org.jboss.resteasy.core.Resou
rceLocatorInvoker.createResource(ResourceLocatorInvoker.java:79)
14:47:43,630 ERROR [stderr] (default task-19) at org.jboss.resteasy.core.Resou
rceLocatorInvoker.createResource(ResourceLocatorInvoker.java:58)
14:47:43,631 ERROR [stderr] (default task-19) at org.jboss.resteasy.core.Resou
rceLocatorInvoker.invoke(ResourceLocatorInvoker.java:100)
14:47:43,631 ERROR [stderr] (default task-19) at org.jboss.resteasy.core.Synch
ronousDispatcher.invoke(SynchronousDispatcher.java:402)
14:47:43,632 ERROR [stderr] (default task-19) at org.jboss.resteasy.core.Synch
ronousDispatcher.invoke(SynchronousDispatcher.java:209)
14:47:43,634 ERROR [stderr] (default task-19) at org.jboss.resteasy.plugins.se
rver.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:
221)
14:47:43,635 ERROR [stderr] (default task-19) at org.jboss.resteasy.plugins.se
rver.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
14:47:43,638 ERROR [stderr] (default task-19) at org.jboss.resteasy.plugins.se
rver.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
14:47:43,639 ERROR [stderr] (default task-19) at javax.servlet.http.HttpServle
t.service(HttpServlet.java:790)
14:47:43,640 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletHandler.handleRequest(ServletHandler.java:85)
14:47:43,641 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.jav
a:62)
14:47:43,641 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
14:47:43,642 ERROR [stderr] (default task-19) at org.wildfly.extension.underto
w.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssoci
ationHandler.java:78)
14:47:43,644 ERROR [stderr] (default task-19) at io.undertow.server.handlers.P
redicateHandler.handleRequest(PredicateHandler.java:43)
14:47:43,645 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociatio
nHandler.java:131)
14:47:43,647 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCal
lHandler.java:57)
14:47:43,649 ERROR [stderr] (default task-19) at io.undertow.server.handlers.P
redicateHandler.handleRequest(PredicateHandler.java:43)
14:47:43,653 ERROR [stderr] (default task-19) at io.undertow.security.handlers
.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.jav
a:46)
14:47:43,655 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidenti
alityConstraintHandler.java:64)
14:47:43,657 ERROR [stderr] (default task-19) at io.undertow.security.handlers
.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.j
ava:60)
14:47:43,658 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSess
ionHandler.java:77)
14:47:43,661 ERROR [stderr] (default task-19) at io.undertow.security.handlers
.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
14:47:43,663 ERROR [stderr] (default task-19) at io.undertow.security.handlers
.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContext
AssociationHandler.java:43)
14:47:43,664 ERROR [stderr] (default task-19) at io.undertow.server.handlers.P
redicateHandler.handleRequest(PredicateHandler.java:43)
14:47:43,665 ERROR [stderr] (default task-19) at org.wildfly.extension.underto
w.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
14:47:43,665 ERROR [stderr] (default task-19) at io.undertow.server.handlers.P
redicateHandler.handleRequest(PredicateHandler.java:43)
14:47:43,668 ERROR [stderr] (default task-19) at io.undertow.server.handlers.P
redicateHandler.handleRequest(PredicateHandler.java:43)
14:47:43,669 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
14:47:43,670 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler.access$100(ServletInitialHandler.java:81)
14:47:43,671 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler$2.call(ServletInitialHandler.java:138)
14:47:43,672 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler$2.call(ServletInitialHandler.java:135)
14:47:43,675 ERROR [stderr] (default task-19) at io.undertow.servlet.core.Serv
letRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction
.java:48)
14:47:43,676 ERROR [stderr] (default task-19) at io.undertow.servlet.core.Cont
extClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
14:47:43,677 ERROR [stderr] (default task-19) at io.undertow.servlet.api.Legac
yThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
14:47:43,681 ERROR [stderr] (default task-19) at io.undertow.servlet.api.Legac
yThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
14:47:43,682 ERROR [stderr] (default task-19) at io.undertow.servlet.api.Legac
yThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
14:47:43,686 ERROR [stderr] (default task-19) at io.undertow.servlet.api.Legac
yThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
14:47:43,695 ERROR [stderr] (default task-19) at io.undertow.servlet.api.Legac
yThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
14:47:43,702 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
14:47:43,703 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler.access$000(ServletInitialHandler.java:81)
14:47:43,704 ERROR [stderr] (default task-19) at io.undertow.servlet.handlers.
ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
14:47:43,704 ERROR [stderr] (default task-19) at io.undertow.server.Connectors
.executeRootHandler(Connectors.java:202)
14:47:43,705 ERROR [stderr] (default task-19) at io.undertow.server.HttpServer
Exchange$1.run(HttpServerExchange.java:805)
14:47:43,705 ERROR [stderr] (default task-19) at java.util.concurrent.ThreadPo
olExecutor.runWorker(ThreadPoolExecutor.java:1142)
14:47:43,706 ERROR [stderr] (default task-19) at java.util.concurrent.ThreadPo
olExecutor$Worker.run(ThreadPoolExecutor.java:617)
14:47:43,706 ERROR [stderr] (default task-19) at java.lang.Thread.run(Thread.j
ava:745)
14:47:43,707 INFO [stdout] (default task-19) Executed
Could anyone provide your help.
Thanks
Senthil
I am running my code on Latest Wildfly 9.0.1.Final(JBoss).
During deployment I am facing lot of issues and deployment is marked as faild.
Below is my server.log
ERROR [org.apache.myfaces.webapp.StartupServletContextListener] (ServerService Thread Pool -- 262) Error initializing ServletContext: java.lang.UnsupportedOperationException
at javax.faces.application.Application.addELContextListener(Application.java:1427)
at org.jboss.as.jsf.injection.weld.WeldApplication.<init>(WeldApplication.java:56)
at org.jboss.as.jsf.injection.weld.WeldApplicationFactory.getApplication(WeldApplicationFactory.java:52)
at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:568)
at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:148)
at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:68)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:51)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
2015-09-04 11:46:13,506 ERROR [stderr] (ServerService Thread Pool -- 262) java.lang.UnsupportedOperationException
2015-09-04 11:46:13,506 ERROR [stderr] (ServerService Thread Pool -- 262) at javax.faces.application.Application.addELContextListener(Application.java:1427)
2015-09-04 11:46:13,506 ERROR [stderr] (ServerService Thread Pool -- 262) at org.jboss.as.jsf.injection.weld.WeldApplication.<init>(WeldApplication.java:56)
2015-09-04 11:46:13,506 ERROR [stderr] (ServerService Thread Pool -- 262) at org.jboss.as.jsf.injection.weld.WeldApplicationFactory.getApplication(WeldApplicationFactory.java:52)
2015-09-04 11:46:13,506 ERROR [stderr] (ServerService Thread Pool -- 262) at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:568)
2015-09-04 11:46:13,506 ERROR [stderr] (ServerService Thread Pool -- 262) at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:148)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:68)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:51)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at java.util.concurrent.FutureTask.run(FutureTask.java:262)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at java.lang.Thread.run(Thread.java:745)
2015-09-04 11:46:13,522 ERROR [stderr] (ServerService Thread Pool -- 262) at org.jboss.threads.JBossThread.run(JBossThread.java:320)
2015-09-04 11:46:13,522 INFO [org.apache.myfaces.webapp.StartupServletContextListener] (ServerService Thread Pool -- 262) ServletContext 'E:\Mahendra\FDMS\FDMS Software\wildfly-9.0.1.Final\wildfly-9.0.1.Final\standalone\tmp\vfs\deployment\deployment4b98e9eab26d7135\WEBFDMSDashboard.war-490d541171eb43e' initialized.
2015-09-04 11:46:13,537 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 262) Initializing Mojarra 2.2.11-jbossorg-1 20150505-1501 for context '/dashboard'
2015-09-04 11:46:17,438 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 272) WFLYUT0021: Registered web context: /webservicesfdms
2015-09-04 11:46:17,548 INFO [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {http://schemas.xmlsoap.org/ws/2004/10/wsat}WSATCoordinator from WSDL: WEB-INF/wsdl/wsat.wsdl
2015-09-04 11:46:18,919 SEVERE [javax.faces] (ServerService Thread Pool -- 262) Unable to call #PreDestroy annotated methods because no InjectionProvider can be found. Does this container implement the Mojarra Injection SPI?
2015-09-04 11:46:18,997 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 262) Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:330)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: javax.faces.FacesException: com.sun.faces.lifecycle.ClientWindowFactoryImpl
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:404)
at javax.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:248)
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:529)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:275)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328)
... 13 more
Caused by: java.lang.UnsupportedOperationException
at javax.faces.application.Application.addELContextListener(Application.java:1427)
at org.jboss.as.jsf.injection.weld.WeldApplication.<init>(WeldApplication.java:56)
at org.jboss.as.jsf.injection.weld.WeldApplicationFactory.getApplication(WeldApplicationFactory.java:52)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:144)
at com.sun.faces.lifecycle.ClientWindowFactoryImpl.<init>(ClientWindowFactoryImpl.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:402)
... 17 more
2015-09-04 11:46:18,997 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 262) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./dashboard: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./dashboard: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:224)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)
... 8 more
Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:330)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
... 10 more
Caused by: javax.faces.FacesException: com.sun.faces.lifecycle.ClientWindowFactoryImpl
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:404)
at javax.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:248)
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:529)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:275)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328)
... 13 more
Caused by: java.lang.UnsupportedOperationException
at javax.faces.application.Application.addELContextListener(Application.java:1427)
at org.jboss.as.jsf.injection.weld.WeldApplication.<init>(WeldApplication.java:56)
at org.jboss.as.jsf.injection.weld.WeldApplicationFactory.getApplication(WeldApplicationFactory.java:52)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:144)
at com.sun.faces.lifecycle.ClientWindowFactoryImpl.<init>(ClientWindowFactoryImpl.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:402)
... 17 more
Please help me resolve this issues.
Thanks.
WildFly contains the JSF reference implementation Mojarra. You seem to be using MyFaces, presumably embedded in your JAR. This does not work out of the box.
See this article on using other JSF implementations with WildFly.