Migration from Jboss EAP 6.4 to Wildfly 23 (JBOSS 7.4) - jboss

We are working on tech refresh of application and server. We are upgrading server and application to below versions:
Application server:
JBOSS EAP 6.4 to (upto) Wildfly 23.0.2
Application:
Apache Camel: 2.14.1 to 3.14.3
Spring: 3.2.11.RELEASE to 5.3.19
Spring Security: 3.1.7.RELEASE to 5.6.3
We are able to deploy and test application with above upgraded dependency on wildfly-18.0.1.Final and wildfly-20.0.1.Final but the same application not working from wildfly 21.0.0 onwards.
There is no error in the server log and socket timeout observed in SOAP UI log for wildfly 21 to wildfly 23.
But below error is observed for wildfly-24.0.1.Final onwards:
**08:38:16,616 ERROR [org.jboss.as.ejb3.invocation] (default task-2) WFLYEJB0527: Remoting connector (address ***/127.0.0.1, port 4447) is not correctly configured for EJB client invocations, the connector must be listed in
We have one EJB module deployed on the same JVM and application tries to connect as remoting component with EJB module which is available on port 4447.
Remoting port 4447 is not enabled in wildfly by default, so it’s enabled with below steps
/socket-binding-group=standard-sockets/socket-binding=remoting:add(port=4447)
/subsystem=remoting/connector=remoting-connector:add(socket-binding=remoting)
After googling we tried to add below dependency in pom.xml instead of jboss-remote-naming dependency
Raw
org.wildfly
wildfly-ejb-client-bom
26.0.1.Final
pom
JNDI template is registered as below:
Raw
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory"></prop>
<prop key="java.naming.provider.url">remote://localhost:4447</prop>
<prop key="java.naming.factory.url.pkgs">org.jboss.naming</prop>
</props>
</property>
</bean>
Tried to change java.naming.factory.initial org.wildfly.naming.client.WildFlyInitialContextFactory but still not working.
We tried to enable spring security debugging and org.wildfly.security to trace but there is no clue what is going wrong.
Above highlighted error observed with Jboss 7.4 as well.
Any help is appreciated. Thank you in advance!!

Related

War deployment failing on Jboss 7.4

I am migrating from Jboss 6.4 to Jboss 7.4, First I have not made any changes in war file and tried to deploy it on Jboss 7.4, but I was getting below error. This error is coming for all filter and servlet classes which are configured in web.xml file.
Caused by: java.lang.IllegalArgumentException: UT010011: Filter log4jServletFilter of type class org.apache.logging.log4j.web.Log4jServletFilter does not implement javax.servlet.Filter
at io.undertow.servlet.api.FilterInfo.<init>(FilterInfo.java:74)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:801)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:276)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
... 6 more
Then I tried with excluding undertow subsystem in jboss-deployment-structure.xml file as below. This time I was able to deploy war file without error, but application is not accessible with root context or any different way. On jboss admin console War is showing in active state but still accessible.
<exclude-subsystems>
<subsystem name="undertow" />
</exclude-subsystems>
Could anyone advise me to resolve filter or servlet class error?

java.lang.IllegalArgumentException: XNIO001001: No XNIO provider found when configuring JBoss EAP 7.1 Client

I am trying to configure my ESB server as a client for JBoss EAP 7.1 integrated Active MQ Artemis which will connect using the RemoteConnectionFactory. However, I couldn't use the JBoss client jar as it conflicts with the internal JARs. Therefore, I added all the necessary JARs separately.
Now an exception is being thrown saying no provider found.
I have added both xnio-api and xnio-nio jars.
Below is the exception.
Caused by: java.lang.IllegalArgumentException: XNIO001001: No XNIO provider found
at org.xnio.Xnio.doGetInstance(Xnio.java:226)
at org.xnio.Xnio.getInstance(Xnio.java:192)
at org.jboss.naming.remote.client.EndpointCache.get(EndpointCache.java:47)
at org.jboss.naming.remote.client.InitialContextFactory.createEndpoint(InitialContextFactory.java:226)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateEndpoint(InitialContextFactory.java:207)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:170)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:146)
... 50 more
How do I resolve this error?

Deploying Apache Isis on WildFly

I'm trying to deploy an Apache Isis project on a WildFly server.
The project is just the simpleapp-archetype-1.10.0 and it starts and works well with mvn antrun:run -P self-host and mvn jetty:run-war.
For the jetty part, I added configuration to the org.eclipse.jetty plugin of the parent pom.xml
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.2.v20150730</version>
<configuration>
<war>${project.basedir}/webapp/target/simpleapp.war</war>
</configuration>
</plugin>
Now I wanted to deploy this on a WildFly server, but I get the following error:
Cannot upload deployment: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"simpleapp.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"simpleapp.war\".WeldStartService: Failed to start service Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type IsisJdoSupport with qualifiers #Default at injection point [BackedAnnotatedField] #Inject org.apache.isis.objectstore.jdo.datanucleus.service.support.TimestampService.isisJdoSupport at org.apache.isis.objectstore.jdo.datanucleus.service.support.TimestampService.isisJdoSupport(TimestampService.java:0) "}}
How can I fix this error, and why does jetty bypass this error?
I got an answer via the Apache Isis Mailing List.
The error says that WildFly tries to do CDI work. Jetty is just a web server and doesn't support Java EE stuff like CDI. Try to disable CDI support for this application (I have no idea how exactly).
http://isis.markmail.org/message/d3coq6qus3rca7kx
To fix this error:
Add the file jboss-all.xml to Simple App Webapp/Web Pages/WEB-INF with the following code:
<jboss xmlns="urn:jboss:1.0">
<weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
</jboss>
https://docs.jboss.org/author/display/WFLY8/CDI+Reference
Credits to Martin Grigorov though.

NoSuchMethodError when compiling in Eclipse with Spring IDE

I have a development environment based on Eclipse Juno with Spring IDE installed. My project uses also Spring Security. The Spring version I am using is 2.5.5 and Spring Security is at 2.0.6. Now, after updating Spring IDE from 3.1.0 to 3.3.0, I am getting a NoSuchMethodError when Spring compiler is trying to compile this line:
<security:authentication-provider user-service-ref="userDetailsService" />
<bean id="userDetailsService" class="com.mycompany.security.MyUserDetailsService">
<property name="daoFactory" ref="DaoFactory" />
</bean>
MyUserDetailsService implements UserDetailsService and InitializingBean.
schemaLocation for the file has been defined as:
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.6.xsd"
The stacktrace looks like this:
!MESSAGE Error occured processing '/Server/WEB-INF/business-layer-context.xml'
!STACK 0
java.lang.NoSuchMethodError: org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArg(Ljava/lang/Object;)Lorg/springframework/beans/factory/support/BeanDefinitionBuilder;
at org.springframework.security.config.AuthenticationProviderBeanDefinitionParser.parse(AuthenticationProviderBeanDefinitionParser.java:88)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
at org.springframework.ide.eclipse.beans.core.internal.model.namespaces.DelegatingNamespaceHandlerResolver$ElementTrackingNamespaceHandler.parse(DelegatingNamespaceHandlerResolver.java:177)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1427)
at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ErrorSuppressingBeanDefinitionParserDelegate.parseCustomElement(BeansConfig.java:1400)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1417)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:187)
at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ToolingFriendlyBeanDefinitionDocumentReader.doRegisterBeanDefinitions(BeansConfig.java:1330)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:110)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:494)
at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.registerBeanDefinitions(BeansConfig.java:402)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.loadBeanDefinitions(BeansConfig.java:388)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:445)
at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
When compiling the application with Ant script and starting the server, everything works fine, so the problem is limited to Eclipse and Spring IDE. Both my Ant and Eclipse configurations use the same Spring library. addConstructorArg method still seems to exist in the newest version of Spring, so I am puzzled by this error. What could be causing this problem?
I believe this is because Spring Tools Suite comes with it's own spring libraries. So for the XML parsing and validation it does not use libraries on your project classpath.
Please see STS-3679
Check your XML configuration files for both Spring and Spring security.
Do you have correct URLs in xsi:schemaLocation, like:
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

Accessing ejb deployed in JBoss 7.0.1 from another client

Having deployed an EJB module in JBoss 7.0.1, I am trying to access it from a client executing on another JVM. However, I am unable to figure out the client side jars needed to add to my client's classpath.
I tried out with the following:-
jboss-ejb-api_3.1_spec-1.0.1.Final.jar
jboss-ejb-client-1.0.0.Beta11.jar
3.jboss-logging-3.1.0.CR2.jar
jboss-marshalling-1.3.4.GA.jar
5.jboss-marshalling-river-1.3.4.GA.jar
jboss-remoting-3.2.0.CR8.jar
7.jboss-sasl-1.0.0.Beta9.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
xnio-api-3.0.0.CR7.jar
There seems to be some inconsistency in this setup and I get this exception:-
INFO: JBoss EJB Client version 1.0.0.Beta11 Nov 9, 2012 12:01:04 AM
org.xnio.Xnio INFO: XNIO Version 3.0.0.CR7 Nov 9, 2012
12:01:04 AM org.jboss.ejb.client.ConfigBasedEJBClientContextSelector
createConnections ERROR: Could not create connection for connection
named default java.lang.IllegalArgumentException: No matching XNIO
provider found at org.xnio.Xnio.doGetInstance(Xnio.java:192) at
org.xnio.Xnio.getInstance(Xnio.java:146) at
org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:73)
...
I didn't have any issues while having a client access an ejb deployed in JBoss 7.1.0 Final, JBoss 6.1.0 Final or Glassfish servers. The jars required at the client side war available.
I am a newbie in Java EE and Application Servers by the way and I am trying to learn in the process.
Thanks.
please add xnio-nio-3.0.3.GA.jar in your classpath
In addition to Ramkumar's answer, I am adding the maven dependency for this jar. Following the maven dependency for the jar:
<dependency>
<groupId>org.jboss.xnio</groupId>
<artifactId>xnio-nio</artifactId>
<version>3.0.3.GA</version>
</dependency>