Widlfly remote EJB-Lookup throws NoSuchEJBException: What's the problem?












1















I don't get why my lookup throws a NoSuchEJBException: My Bean is deployed on wildfly. The admin-console shows that the server has registered the bean: It is listed as EJB under runtime/server/EJB, so I assume that it is deployed correctly. But I still do get a NoSuchEJB-Exception when I look it up remotely. I don't know where to look for a solution.



My EJB is deployed in a jar. The .jar-File is called "Markup2", the Bean is named "MarkupGeneratorBean". It is a remote and stateless session-bean.



Here the stacktrace:



javax.ejb.NoSuchEJBException: EJBCLIENT000079: Unable to discover destination for request for EJB StatelessEJBLocator for "/Markup2/MarkupGeneratorBean", view is interface com.markupGenerator.MarkupGeneratorRemote, affinity is None
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:592)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:114)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:938)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:177)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
at deployment.PTT2.war//com.sun.proxy.$Proxy84.generateDocumentFromUrl(Unknown Source)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.getRenderDocument(TestSessionGeneratorServlet.java:157)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.doGet(TestSessionGeneratorServlet.java:70)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.core@2.0.13.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.core@2.0.13.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.base/java.lang.Thread.run(Thread.java:844)


Here's the method of my serlvet that is doing the lookup:



private Document getRenderDocument() {
Document doc = null;
try {

Context context = new InitialContext();


MarkupGeneratorRemote mB = (MarkupGeneratorRemote) context.
lookup("ejb:/Markup2//MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote");

doc = Jsoup.parse(mB.generateDocumentFromUrl("http://localhost:8080/html-files/intro.html"));

doc.getElementById("pretestform").html(qItem.getHtml() + "<input type="submit" value="let's go!">");

} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return doc;}


My pom.xml contains the following dependencies:




  • jsoup:1.11.3 maven-war-plugin:3.0.0

  • maven-plugin-api:3.0

  • htmlunit:2.32

  • serializer.2.7.2

  • derbyclient:10.14.1.0

  • wildfly-client.all:12.0.0.Final

  • javax.persistence-api:2.2


My jndi.properties:



java.naming.provider.url = http-remoting://127.0.0.1:8080
java.naming.factory.initial = org.jboss.naming.remote.client.InitialContextFactory
java.naming.factory.pkgs=org.jboss.ejb.client.naming


my jboss-ejb-client.properties:



endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false


Thank you very much in advance!!



EDIT: Here are the JNDI-Bindings of the Bean



java:global/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:app/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:module/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:jboss/exported/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
ejb:Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:global/Markup2/MarkupGeneratorBean
java:app/Markup2/MarkupGeneratorBean
java:module/MarkupGeneratorBean


EDIT: In the meantime I had been able to make successful remote EJB-invocations. Don't ask me how: I really don't know why I it did work. I switched to a CDI-workaround. After making a successful EJB-call on the same server in a different application, I wanted to try it again in the app that had the error above. Later, it stopped working in both apps after I had restarted the server - getting the same error as described above.



UPDATE: I was able to make remote EJB-invocations on another server. That means, that I must have messed something up on the original server unknowingly.










share|improve this question

























  • Can you redeploy the app then update your question to contain the entries that all come after these traces JNDI bindings for session bean named 'XXXX' in deployment unit? They'll all start with java: and should be at least 6 per bean

    – JGlass
    Nov 16 '18 at 15:21











  • you could use JNDI portable name stackoverflow.com/questions/52999407/…

    – Mehran Mastcheshmi
    Nov 17 '18 at 4:30











  • @JGlass I added the JNDI-Bindings.

    – mrFunkus
    Nov 17 '18 at 18:27











  • @MehranMastcheshmi I get a javax.naming.NameNotFoundException when I try portable jndi names

    – mrFunkus
    Nov 17 '18 at 21:45











  • Glad you got it figured out - sorry I am late on the reply!

    – JGlass
    Nov 21 '18 at 15:28
















1















I don't get why my lookup throws a NoSuchEJBException: My Bean is deployed on wildfly. The admin-console shows that the server has registered the bean: It is listed as EJB under runtime/server/EJB, so I assume that it is deployed correctly. But I still do get a NoSuchEJB-Exception when I look it up remotely. I don't know where to look for a solution.



My EJB is deployed in a jar. The .jar-File is called "Markup2", the Bean is named "MarkupGeneratorBean". It is a remote and stateless session-bean.



Here the stacktrace:



javax.ejb.NoSuchEJBException: EJBCLIENT000079: Unable to discover destination for request for EJB StatelessEJBLocator for "/Markup2/MarkupGeneratorBean", view is interface com.markupGenerator.MarkupGeneratorRemote, affinity is None
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:592)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:114)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:938)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:177)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
at deployment.PTT2.war//com.sun.proxy.$Proxy84.generateDocumentFromUrl(Unknown Source)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.getRenderDocument(TestSessionGeneratorServlet.java:157)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.doGet(TestSessionGeneratorServlet.java:70)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.core@2.0.13.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.core@2.0.13.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.base/java.lang.Thread.run(Thread.java:844)


Here's the method of my serlvet that is doing the lookup:



private Document getRenderDocument() {
Document doc = null;
try {

Context context = new InitialContext();


MarkupGeneratorRemote mB = (MarkupGeneratorRemote) context.
lookup("ejb:/Markup2//MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote");

doc = Jsoup.parse(mB.generateDocumentFromUrl("http://localhost:8080/html-files/intro.html"));

doc.getElementById("pretestform").html(qItem.getHtml() + "<input type="submit" value="let's go!">");

} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return doc;}


My pom.xml contains the following dependencies:




  • jsoup:1.11.3 maven-war-plugin:3.0.0

  • maven-plugin-api:3.0

  • htmlunit:2.32

  • serializer.2.7.2

  • derbyclient:10.14.1.0

  • wildfly-client.all:12.0.0.Final

  • javax.persistence-api:2.2


My jndi.properties:



java.naming.provider.url = http-remoting://127.0.0.1:8080
java.naming.factory.initial = org.jboss.naming.remote.client.InitialContextFactory
java.naming.factory.pkgs=org.jboss.ejb.client.naming


my jboss-ejb-client.properties:



endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false


Thank you very much in advance!!



EDIT: Here are the JNDI-Bindings of the Bean



java:global/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:app/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:module/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:jboss/exported/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
ejb:Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:global/Markup2/MarkupGeneratorBean
java:app/Markup2/MarkupGeneratorBean
java:module/MarkupGeneratorBean


EDIT: In the meantime I had been able to make successful remote EJB-invocations. Don't ask me how: I really don't know why I it did work. I switched to a CDI-workaround. After making a successful EJB-call on the same server in a different application, I wanted to try it again in the app that had the error above. Later, it stopped working in both apps after I had restarted the server - getting the same error as described above.



UPDATE: I was able to make remote EJB-invocations on another server. That means, that I must have messed something up on the original server unknowingly.










share|improve this question

























  • Can you redeploy the app then update your question to contain the entries that all come after these traces JNDI bindings for session bean named 'XXXX' in deployment unit? They'll all start with java: and should be at least 6 per bean

    – JGlass
    Nov 16 '18 at 15:21











  • you could use JNDI portable name stackoverflow.com/questions/52999407/…

    – Mehran Mastcheshmi
    Nov 17 '18 at 4:30











  • @JGlass I added the JNDI-Bindings.

    – mrFunkus
    Nov 17 '18 at 18:27











  • @MehranMastcheshmi I get a javax.naming.NameNotFoundException when I try portable jndi names

    – mrFunkus
    Nov 17 '18 at 21:45











  • Glad you got it figured out - sorry I am late on the reply!

    – JGlass
    Nov 21 '18 at 15:28














1












1








1








I don't get why my lookup throws a NoSuchEJBException: My Bean is deployed on wildfly. The admin-console shows that the server has registered the bean: It is listed as EJB under runtime/server/EJB, so I assume that it is deployed correctly. But I still do get a NoSuchEJB-Exception when I look it up remotely. I don't know where to look for a solution.



My EJB is deployed in a jar. The .jar-File is called "Markup2", the Bean is named "MarkupGeneratorBean". It is a remote and stateless session-bean.



Here the stacktrace:



javax.ejb.NoSuchEJBException: EJBCLIENT000079: Unable to discover destination for request for EJB StatelessEJBLocator for "/Markup2/MarkupGeneratorBean", view is interface com.markupGenerator.MarkupGeneratorRemote, affinity is None
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:592)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:114)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:938)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:177)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
at deployment.PTT2.war//com.sun.proxy.$Proxy84.generateDocumentFromUrl(Unknown Source)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.getRenderDocument(TestSessionGeneratorServlet.java:157)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.doGet(TestSessionGeneratorServlet.java:70)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.core@2.0.13.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.core@2.0.13.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.base/java.lang.Thread.run(Thread.java:844)


Here's the method of my serlvet that is doing the lookup:



private Document getRenderDocument() {
Document doc = null;
try {

Context context = new InitialContext();


MarkupGeneratorRemote mB = (MarkupGeneratorRemote) context.
lookup("ejb:/Markup2//MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote");

doc = Jsoup.parse(mB.generateDocumentFromUrl("http://localhost:8080/html-files/intro.html"));

doc.getElementById("pretestform").html(qItem.getHtml() + "<input type="submit" value="let's go!">");

} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return doc;}


My pom.xml contains the following dependencies:




  • jsoup:1.11.3 maven-war-plugin:3.0.0

  • maven-plugin-api:3.0

  • htmlunit:2.32

  • serializer.2.7.2

  • derbyclient:10.14.1.0

  • wildfly-client.all:12.0.0.Final

  • javax.persistence-api:2.2


My jndi.properties:



java.naming.provider.url = http-remoting://127.0.0.1:8080
java.naming.factory.initial = org.jboss.naming.remote.client.InitialContextFactory
java.naming.factory.pkgs=org.jboss.ejb.client.naming


my jboss-ejb-client.properties:



endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false


Thank you very much in advance!!



EDIT: Here are the JNDI-Bindings of the Bean



java:global/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:app/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:module/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:jboss/exported/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
ejb:Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:global/Markup2/MarkupGeneratorBean
java:app/Markup2/MarkupGeneratorBean
java:module/MarkupGeneratorBean


EDIT: In the meantime I had been able to make successful remote EJB-invocations. Don't ask me how: I really don't know why I it did work. I switched to a CDI-workaround. After making a successful EJB-call on the same server in a different application, I wanted to try it again in the app that had the error above. Later, it stopped working in both apps after I had restarted the server - getting the same error as described above.



UPDATE: I was able to make remote EJB-invocations on another server. That means, that I must have messed something up on the original server unknowingly.










share|improve this question
















I don't get why my lookup throws a NoSuchEJBException: My Bean is deployed on wildfly. The admin-console shows that the server has registered the bean: It is listed as EJB under runtime/server/EJB, so I assume that it is deployed correctly. But I still do get a NoSuchEJB-Exception when I look it up remotely. I don't know where to look for a solution.



My EJB is deployed in a jar. The .jar-File is called "Markup2", the Bean is named "MarkupGeneratorBean". It is a remote and stateless session-bean.



Here the stacktrace:



javax.ejb.NoSuchEJBException: EJBCLIENT000079: Unable to discover destination for request for EJB StatelessEJBLocator for "/Markup2/MarkupGeneratorBean", view is interface com.markupGenerator.MarkupGeneratorRemote, affinity is None
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:592)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:114)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:938)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:177)
at org.jboss.ejb-client@4.0.11.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
at deployment.PTT2.war//com.sun.proxy.$Proxy84.generateDocumentFromUrl(Unknown Source)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.getRenderDocument(TestSessionGeneratorServlet.java:157)
at deployment.PTT2.war//com.ptt.TestSessionGeneratorServlet.doGet(TestSessionGeneratorServlet.java:70)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
at javax.servlet.api@1.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.core@2.0.13.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
at io.undertow.core@2.0.13.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow@14.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet@2.0.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.core@2.0.13.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.core@2.0.13.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads@2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.base/java.lang.Thread.run(Thread.java:844)


Here's the method of my serlvet that is doing the lookup:



private Document getRenderDocument() {
Document doc = null;
try {

Context context = new InitialContext();


MarkupGeneratorRemote mB = (MarkupGeneratorRemote) context.
lookup("ejb:/Markup2//MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote");

doc = Jsoup.parse(mB.generateDocumentFromUrl("http://localhost:8080/html-files/intro.html"));

doc.getElementById("pretestform").html(qItem.getHtml() + "<input type="submit" value="let's go!">");

} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return doc;}


My pom.xml contains the following dependencies:




  • jsoup:1.11.3 maven-war-plugin:3.0.0

  • maven-plugin-api:3.0

  • htmlunit:2.32

  • serializer.2.7.2

  • derbyclient:10.14.1.0

  • wildfly-client.all:12.0.0.Final

  • javax.persistence-api:2.2


My jndi.properties:



java.naming.provider.url = http-remoting://127.0.0.1:8080
java.naming.factory.initial = org.jboss.naming.remote.client.InitialContextFactory
java.naming.factory.pkgs=org.jboss.ejb.client.naming


my jboss-ejb-client.properties:



endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false


Thank you very much in advance!!



EDIT: Here are the JNDI-Bindings of the Bean



java:global/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:app/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:module/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:jboss/exported/Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
ejb:Markup2/MarkupGeneratorBean!com.markupGenerator.MarkupGeneratorRemote
java:global/Markup2/MarkupGeneratorBean
java:app/Markup2/MarkupGeneratorBean
java:module/MarkupGeneratorBean


EDIT: In the meantime I had been able to make successful remote EJB-invocations. Don't ask me how: I really don't know why I it did work. I switched to a CDI-workaround. After making a successful EJB-call on the same server in a different application, I wanted to try it again in the app that had the error above. Later, it stopped working in both apps after I had restarted the server - getting the same error as described above.



UPDATE: I was able to make remote EJB-invocations on another server. That means, that I must have messed something up on the original server unknowingly.







java java-ee ejb wildfly jndi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 18 '18 at 13:01







mrFunkus

















asked Nov 15 '18 at 18:51









mrFunkusmrFunkus

84




84













  • Can you redeploy the app then update your question to contain the entries that all come after these traces JNDI bindings for session bean named 'XXXX' in deployment unit? They'll all start with java: and should be at least 6 per bean

    – JGlass
    Nov 16 '18 at 15:21











  • you could use JNDI portable name stackoverflow.com/questions/52999407/…

    – Mehran Mastcheshmi
    Nov 17 '18 at 4:30











  • @JGlass I added the JNDI-Bindings.

    – mrFunkus
    Nov 17 '18 at 18:27











  • @MehranMastcheshmi I get a javax.naming.NameNotFoundException when I try portable jndi names

    – mrFunkus
    Nov 17 '18 at 21:45











  • Glad you got it figured out - sorry I am late on the reply!

    – JGlass
    Nov 21 '18 at 15:28



















  • Can you redeploy the app then update your question to contain the entries that all come after these traces JNDI bindings for session bean named 'XXXX' in deployment unit? They'll all start with java: and should be at least 6 per bean

    – JGlass
    Nov 16 '18 at 15:21











  • you could use JNDI portable name stackoverflow.com/questions/52999407/…

    – Mehran Mastcheshmi
    Nov 17 '18 at 4:30











  • @JGlass I added the JNDI-Bindings.

    – mrFunkus
    Nov 17 '18 at 18:27











  • @MehranMastcheshmi I get a javax.naming.NameNotFoundException when I try portable jndi names

    – mrFunkus
    Nov 17 '18 at 21:45











  • Glad you got it figured out - sorry I am late on the reply!

    – JGlass
    Nov 21 '18 at 15:28

















Can you redeploy the app then update your question to contain the entries that all come after these traces JNDI bindings for session bean named 'XXXX' in deployment unit? They'll all start with java: and should be at least 6 per bean

– JGlass
Nov 16 '18 at 15:21





Can you redeploy the app then update your question to contain the entries that all come after these traces JNDI bindings for session bean named 'XXXX' in deployment unit? They'll all start with java: and should be at least 6 per bean

– JGlass
Nov 16 '18 at 15:21













you could use JNDI portable name stackoverflow.com/questions/52999407/…

– Mehran Mastcheshmi
Nov 17 '18 at 4:30





you could use JNDI portable name stackoverflow.com/questions/52999407/…

– Mehran Mastcheshmi
Nov 17 '18 at 4:30













@JGlass I added the JNDI-Bindings.

– mrFunkus
Nov 17 '18 at 18:27





@JGlass I added the JNDI-Bindings.

– mrFunkus
Nov 17 '18 at 18:27













@MehranMastcheshmi I get a javax.naming.NameNotFoundException when I try portable jndi names

– mrFunkus
Nov 17 '18 at 21:45





@MehranMastcheshmi I get a javax.naming.NameNotFoundException when I try portable jndi names

– mrFunkus
Nov 17 '18 at 21:45













Glad you got it figured out - sorry I am late on the reply!

– JGlass
Nov 21 '18 at 15:28





Glad you got it figured out - sorry I am late on the reply!

– JGlass
Nov 21 '18 at 15:28












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53326135%2fwidlfly-remote-ejb-lookup-throws-nosuchejbexception-whats-the-problem%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53326135%2fwidlfly-remote-ejb-lookup-throws-nosuchejbexception-whats-the-problem%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine