Jboss EAP 7.1: Strange 'jboss EJBCLIENT000409: No more destinations are available' - ejb

I am a java EE developer, and I was trying to compile my project (which consists on three EAR projects: Service, Business and Web.
The EJB classes were in Business container. I then tried to compile using Maven 3.3.3, I also tried other versions like 3.5.3 (jboss-as-maven-plugin)
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.1.0.Final</version>
And I got this error:
RequestSendFailedException
org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
2018-04-10 11:47:59,530 INFO [org.jboss.ejb.client] (default task-6) JBoss EJB Client version 4.0.9.Final-redhat-1
2018-04-10 11:47:59,623 INFO [stdout] (default task-6) default task-6:2018-04-10 11:47:59,608 [ERROR] [web.mbean.MentoTOBean] [System error, try again!]
2018-04-10 11:47:59,624 INFO [stdout] (default task-6) org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
2018-04-10 11:47:59,624 INFO [stdout] (default task-6) at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:567)
2018-04-10 11:47:59,624 INFO [stdout] (default task-6) at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
2018-04-10 11:47:59,624 INFO [stdout] (default task-6) at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
I tried everything so far, and I've found that, at least, the EJB is located somehow, but the 'Bean' is null:
WebEJBInterceptor: InterpcetorParameters [ type: interface web.service.MentoService, name: MentoService, serverName: MentoNegocio-server, authResolverClass:WebAuthenticationResolver]. Bean Scope: null
My service locator is okay, as it worked before:
<?xml version="1.0" encoding="UTF-8" ?>
<tpp:serviceLocator xmlns:tpp="http://www.mento.br/ns/javaee/ejb"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mento.br/ns/javaee/ejb serviceLocator.xsd">
<tpp:server name="SDC">
<tpp:initialContextFactory>org.jboss.as.naming.InitialContextFactory</tpp:initialContextFactory>
<tpp:providerUrl>remote://localhost:4447</dtp:providerUrl>
<tpp:user>xxxxxxxxxxx</tpp:user>
<tpp:password>xxxxxxxxx</tpp:password>
</tpp:server>
<tpp:service name="MentoNegocio-server" jndiPrefix="" jndiSuffix="">
<tpp:preserveInitialContext>true</tpp:preserveInitialContext>
</tpp:service>
</tpp:serviceLocator>
I used Jboss EAP 7.1 (It worked before in EAP 6.0 but the systems now use 7.0+ due to compatibility).

I faced the same issue in recent past and after so many analysis , I am able to find the resolution.
Here are details:
In EAP 7.1 Context Factory data is changed which was modified in
Provider URL :remote+http://:
JNDI ContextFactory: org.wildfly.naming.client.WildFlyInitialContextFactory
Change these two in the EJB Client and issue will be resolved.

Is it possible, that you used an outdated jboss-client-library on the client-side which is now causing the errors?
Possibly import from your jboss-server e.g.: /app/jboss/jboss-eap-7.1.4/bin/client/jboss-client.jar into your project.

Related

Spring Kafka 2.9.3 NoClassDefFound - AlterIsrRequest$Builder on EmbeddedKafka Start up

Trying to upgrade the springboot application which uses spring kafka to version 2.9.3 from 2.8.4.
I have followed the instructions here to pulldown kafka-client version 3.2.3 as a separate dependency.
My dependencies looks like this
implementation("org.springframework.kafka:spring-kafka:2.9.3") {
exclude group: "org.apache.kafka", module: "kafka-streams"
exclude group: "org.apache.kafka", module: "kafka-clients"
}
implementation("org.apache.kafka:kafka-clients:3.2.3")
testImplementation("org.springframework.kafka:spring-kafka-test:2.9.3")
When I try to kick off a test which makes use of EmbeddedKafka.
I am getting this NoClassDefFound error
Caused by: java.lang.NoClassDefFoundError: org/apache/kafka/common/requests/AlterIsrRequest$Builder
at kafka.server.KafkaServer.startup(KafkaServer.scala:313)
at kafka.utils.TestUtils$.createServer(TestUtils.scala:177)
at kafka.utils.TestUtils$.createServer(TestUtils.scala:172)
at kafka.utils.TestUtils.createServer(TestUtils.scala)
at org.springframework.kafka.test.EmbeddedKafkaBroker.afterPropertiesSet(EmbeddedKafkaBroker.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 87 more
Caused by: java.lang.ClassNotFoundException: org.apache.kafka.common.requests.AlterIsrRequest$Builder
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 94 more
I think I am missing a dependency?
You have a version mis-match between the kafka-clients and other kafka jars. All kafka jars must be the same version since the server uses classes from the clients jar.
I don't see AlterIsrRequest in jars since 3.1.2 - so it looks like, somehow, you have older kafka server jars on the class path.
spring-kafka-test:2.9.3 should pull in 3.2.3 transitively.
Since you are using Spring Boot, it will pull in 3.1.2 instead.
See the documentation (https://docs.spring.io/spring-kafka/docs/2.9.3/reference/html/#update-deps) for how to override the dependencies when using Spring Boot.

upgrade from alfresco community 5.2 to 7.1

When I upgrade from ACS 5.2 to ACS 7.1, I got error message:
ERROR [web.context.ContextLoader] [main] Context initialization failed
org.alfresco.service.namespace.NamespaceException: Namespace prefix 'dc' is already in use for URI 'http://purl.org/dc/elements/1.1/' so cannot be registered for URI 'http://alfresco.parliament.ge/share'
I have used "dc" prefix for my namespace http://alfresco.parliament.ge/share in ACS 5.2 data
Please, can You help me
Thank You very much in advance
Best Regards
David Adamia
Ouch - you have a prefix name conflict with Alfresco's own namespace for dublin core, which is defined in iptcModel.
I'm afraid you won't be able to avoid refactoring your namespace.
It would be great if Alfresco / the community would have something like a model namespace prefix registry to avoid such a nameclash ...

Facing issue while loading app to PCF

Bean method 'configServicePropertySource' in 'ConfigServiceBootstrapConfiguration' not loaded because #ConditionalOnProperty (spring.cloud.config.enabled) found different value in property 'spring.cloud.config.enabled'
2017-12-17T14:40:46.20+0530 [APP/PROC/WEB/0] OUT Field locator in io.pivotal.spring.cloud.service.config.ConfigClientOAuth2BootstrapConfiguration$ConfigClientOAuth2Configurer required a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' that could not be found.
-I am receiving the above message when I am trying to load it into PCF. But when running locally, it is working as expected.
When this error message appeared in a Spring Boot 2.01 / Pivotal Cloud Foundry / Groovy / Gradle environment, one additional thing I noticed was that the problem went away when I removed the dependency on the Spring Boot based module that was being developed.
The fix was to change the build.gradle of the imported module so that dependencies were compileOnly() instead of compile().
Like this,
compileOnly('org.springframework.boot:spring-boot-starter')
compileOnly('org.springframework.boot:spring-boot-starter-amqp')
compileOnly('org.springframework.cloud:spring-cloud-config-server')
compileOnly('org.springframework.boot:spring-boot-configuration-processor')
testCompile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-amqp')
testCompile('org.springframework.cloud:spring-cloud-config-server')
Instead of,
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework.boot:spring-boot-starter-amqp')
compile('org.springframework.cloud:spring-cloud-config-server')
compile('org.springframework.boot:spring-boot-configuration-processor')
My theory is that there was a conflict between multiple instances of the Spring Boot framework in the environment and this removed one of them, but I'm not certain if that is correct.
Here is the complete error message from my environment:
***************************
APPLICATION FAILED TO START
Description:
Parameter 1 of constructor in io.pivotal.spring.cloud.service.config.ConfigClientOAuth2BootstrapConfiguration$ConfigClientOAuth2Configurer required a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' that could not be found.
- Bean method 'configServicePropertySource' in 'ConfigServiceBootstrapConfiguration' not loaded because #ConditionalOnProperty (spring.cloud.config.enabled) found different value in property 'spring.cloud.config.enabled'
Action:
Consider revisiting the conditions above or defining a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' in your configuration.
While troubleshooting different combinations of Spring Boot modules I also saw this error, which I believe had the same cause:
***************************
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in io.pivotal.spring.cloud.service.config.VaultTokenRenewalAutoConfiguration required a bean of type 'io.pivotal.spring.cloud.service.config.ConfigClientOAuth2ResourceDetails' that could not be found.
[OUT] Action:
[OUT] Consider defining a bean of type 'io.pivotal.spring.cloud.service.config.ConfigClientOAuth2ResourceDetails' in your configuration.

Websphere 7 and EJB 2.1 - JNDI name not specified

Environment - WAS 7.0 and EJB 2.1
I have a EAR with EJB jar file. It has some remote EJB's (EJB 2.1) that I want to convert to local EJB. Hence i had to modify ejb-jar.xml as per my understanding.
My modified ejb-jar xml file is as follows:
<ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
....
...
<session id="Manager">
<ejb-name>Manager</ejb-name>
<home>com.aa.bb.ManagerHome</home>
<remote>com.aa.bb.ManagerRemote</remote>
<ejb-class>com.aa.bb.Manager</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<local-home>com.aa.bb.ManagerLocalHome</local-home>
<local>com.aa.bb.ManagerLocal</local>
<ejb-local-ref id="EJBLocalRef_1139997836094">
<ejb-ref-name>ejb/ManagerLocalHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.aa.bb.ManagerLocalHome</local-home>
<local>com.aa.bb.ManagerLocal</local>
<ejb-link>Manager</ejb-link>
</ejb-local-ref>
, and are newly added tags for the local ejb.
And my Bindings file is as follows -
<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1107442316219">
<ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
.....
.....
<ejbBindings xmi:id="EnterpriseBeanBinding_1142021363669" jndiName="ejb/ManagerLocalHome">
<enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#Manager"/>
<resRefBindings xmi:id="ResourceRefBinding_1315855161720" jndiName="OraDataSource">
<bindingResourceRef href="META-INF/ejb-jar.xml#ResourceRef_1142023723001"/>
</resRefBindings>
</ejbBindings>
During deploy of the EAR file I get the following error -
com.ibm.websphere.management.application.client.AppDeploymentException:
ADMA0014E: Validation failed. ADMA0007E: A Validation error occurred in task Mapping EJB references to enterprise beans.
The Java Naming and Directory Interface (JNDI) name is not specified for reference binding ejb/ManagerLocalHome in module ZZZZZ with EJB name Manager.
Any idea why it would complain about JNDI when it has been defined ?
Am I missing something?
It seems like the jndiName should jndiName="ejb/Manager" in the bindings file and it started working for me.
Had to run it rhought rmic but the lookup is now working.

Wildfly 8.2: component.CREATE is missing

I just updated my Wildfly-8.1.0.Final installation to 8.2.0.Final and deployed my WAR application and ran into deployment error.
It said
ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2)
JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "MYAPPNAME.war")]) -
failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
and then listed all my EJBs in the following manner:
"jboss.deployment.unit.\"MYAPPNAME.war\".component.EJBNAME.CREATE is missing [jboss.security.security-domain.java:/jaas/MYSECURITYDOMAIN]"
When I rolled back to 8.1.0.Final everything worked as expected again.
All my EJBs are declared with #Stateless and there exists an empty beans.xml for CDI there aren't any other special configurations for EJB or CDI except compontents.xml with the following content:
<components>
<component name="org.jboss.seam.core.init">
<!-- JNDI name pattern for JBoss EJB 3.0 -->
<property name="jndiPattern">#{ejbName}/local</property>
</component>
</components>
Has anyone encountered this case and could give me a hint how to resolve it?
Take a look at this Wildfly issue;
https://issues.jboss.org/browse/WFLY-4116
This issue relates to;
"WAR deployment fails on missing security domain dependency"
and contains error traces in the log output that are similar in nature to the ones reported.
Specifically, constructs like;
<jboss-web>
<security-domain>java:/jaas/haa-portal</security-domain>
</jboss-web>
should be replaced with;
<jboss-web>
<security-domain>haa-portal</security-domain>
</jboss-web>
I had a similar issue and the advice in this issue rectified it for me.

Resources