[JBoss JIRA] (WFCORE-1580) the "cli" Maven module: should the JBoss LogManager dependency be optional?
by Ladislav Thon (JIRA)
Ladislav Thon created WFCORE-1580:
-------------------------------------
Summary: the "cli" Maven module: should the JBoss LogManager dependency be optional?
Key: WFCORE-1580
URL: https://issues.jboss.org/browse/WFCORE-1580
Project: WildFly Core
Issue Type: Bug
Components: CLI
Affects Versions: 2.1.0.Final
Reporter: Ladislav Thon
Assignee: Alexey Loubyansky
Say I have a very simple Java program using the WildFly CLI scripting facilities:
{code:java}
public static void main(String[] args) throws Exception {
CLI cli = CLI.newInstance();
cli.connect();
System.out.println(cli.cmd(":whoami").getResponse());
cli.disconnect();
}
{code}
This is in a small Maven project that has a single dependency:
{code:xml}
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<version>2.1.0.Final</version>
</dependency>
{code}
When trying to run the program (no matter if there's a running WildFly server or not), I get the following exception:
{code}
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logmanager/LogContextSelector
at org.jboss.as.cli.embedded.EmbeddedControllerHandlerRegistrar.registerEmbeddedCommands(EmbeddedControllerHandlerRegistrar.java:89)
at org.jboss.as.cli.impl.CommandContextImpl.initCommands(CommandContextImpl.java:581)
at org.jboss.as.cli.impl.CommandContextImpl.<init>(CommandContextImpl.java:302)
at org.jboss.as.cli.impl.CommandContextFactoryImpl.newCommandContext(CommandContextFactoryImpl.java:44)
at org.jboss.as.cli.scriptsupport.CLI.connect(CLI.java:80)
at cz.ladicek.foobar.Main.main(Main.java:8)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.LogContextSelector
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
{code}
This is because {{CommandContextImpl}}'s constructor calls {{EmbedServerHandler.create}} and for the {{EmbedServerHandler}} class to load, there has to be JBoss LogManager present on the classpath.
The {{wildfly-cli}} Maven module already has a dependency on JBoss LogManager, except that...
{code:xml}
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<optional>true</optional>
</dependency>
{code}
It's optional. I guess this made sense in WildFly Core 1.x which didn't have server embedding, but in WildFly Core 2.x, I wonder if the dependency should be mandatory.
Thoughts?
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (WFLY-4892) wildfly-9.0.0.Final stops automatically on linux fedora 3.14.8-200.fc20. java version "1.8.0_45"
by Paul Gier (JIRA)
[ https://issues.jboss.org/browse/WFLY-4892?page=com.atlassian.jira.plugin.... ]
Paul Gier reassigned WFLY-4892:
-------------------------------
Assignee: (was: Paul Gier)
> wildfly-9.0.0.Final stops automatically on linux fedora 3.14.8-200.fc20. java version "1.8.0_45"
> -------------------------------------------------------------------------------------------------
>
> Key: WFLY-4892
> URL: https://issues.jboss.org/browse/WFLY-4892
> Project: WildFly
> Issue Type: Bug
> Components: Build System, EE, EJB
> Affects Versions: 9.0.0.Final
> Environment: RAM: 4GB
> OS: Fedora 3.14.8-200.fc20.i686+PAE #1 SMP Mon Jun 16 22:20:16 UTC 2014 i686 i686 i386 GNU/Linux
> JAVA VERSION: 1.8.0_45
> Reporter: vako beridze
> Attachments: hs_err_pid2211.log
>
>
> wildfly-9.0.0.Final stops working on linux machine.
> I have no idea why.
> *Server Log:*
> [CodeBlob (0xa752af48)]
> Framesize: 0
> BufferBlob (0xa752af48) used for StubRoutines (2)
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (sharedRuntime.cpp:834), pid=2211, tid=482995008
> # fatal error: exception happened outside interpreter, nmethods and vtable stubs at pc 0xa752c8d4
> #
> # JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14)
> # Java VM: Java HotSpot(TM) Server VM (25.45-b02 mixed mode linux-x86 )
> # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
> #
> # An error report file with more information is saved as:
> # /opt/wildfly-9.0.0.Final/bin/hs_err_pid2211.log
> #
> # If you would like to submit a bug report, please visit:
> # http://bugreport.java.com/bugreport/crash.jsp
> #
> ./standalone.sh: line 346: 2211 Aborted "/opt/java/jdk1.8.0_45/bin/java" -D"[Standalone]" -server -server -Xms512m -Xmx2048m -XX:MaxPermSize=2048m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true "-Dorg.jboss.boot.log.file=/opt/wildfly-9.0.0.Final/standalone/log/server.log" "-Dlogging.configuration=file:/opt/wildfly-9.0.0.Final/standalone/configuration/logging.properties" -jar "/opt/wildfly-9.0.0.Final/jboss-modules.jar" -mp "/opt/wildfly-9.0.0.Final/modules" org.jboss.as.standalone -Djboss.home.dir="/opt/wildfly-9.0.0.Final" -Djboss.server.base.dir="/opt/wildfly-9.0.0.Final/standalone"
> *standalone.conf:*
> #
> # Specify options to pass to the Java VM.
> #
> if [ "x$JAVA_OPTS" = "x" ]; then
> JAVA_OPTS="-Xms512m -Xmx2048m -XX:MaxPermSize=2048m -Djava.net.preferIPv4Stack=true"
> JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
> else
> echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
> fi
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (WFLY-6352) Build Fails with maven 3.3.9 Oracle JDK 8
by Paul Gier (JIRA)
[ https://issues.jboss.org/browse/WFLY-6352?page=com.atlassian.jira.plugin.... ]
Paul Gier commented on WFLY-6352:
---------------------------------
If you look at the dom4j 1.6.1 POM in Maven central [1], the transitive dependencies listed in the error message are optional, so they shouldn't be included transitively [2]. I'm not sure why these dependencies are showing up in your build, maybe you had a bad dom4j pom in your local repo?
Also in your example, you are using the wrong profile name "Release" instead of "release". This will give a warning, but shouldn't have any effect on the transitive dependency issue.
I wasn't able to reproduce this using Maven 3.3.9 and JDK 8 on the 10.0.0.Final tag or on master, so I will close this issue.
[1]http://central.maven.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.pom
[2]https://maven.apache.org/guides/introduction/introduction-to-optional-a...
> Build Fails with maven 3.3.9 Oracle JDK 8
> ------------------------------------------
>
> Key: WFLY-6352
> URL: https://issues.jboss.org/browse/WFLY-6352
> Project: WildFly
> Issue Type: Bug
> Components: Build System
> Affects Versions: 10.0.0.Final
> Environment:
> Reporter: Eric Lemesre
> Assignee: Paul Gier
>
> When trying to build 10.0.0.Final with Maven 3.3.9 I get the following error from maven-enforcer plugin (at wildfly-feature-pack module).
> {code}
> $ mvn --version
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
> Apache Maven 3.3.9
> Maven home: /usr/share/maven
> Java version: 1.8.0_72, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/jdk-8-oracle-x64/jre
> Default locale: fr_FR, platform encoding: UTF-8
> OS name: "linux", version: "4.2.0-1-amd64", arch: "amd64", family: "unix"
> {code}
> {code}
> $ mvn clean install -PRelease
> ....
> [INFO] ------------------------------------------------------------------------
> [INFO] Building WildFly: Full Feature Pack 10.0.0.Final
> [INFO] ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (ban-bad-dependencies) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java-version) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-maven-version) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (ban-transitive-deps) @ wildfly-feature-pack ---
> [WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanTransitiveDependencies failed with message:
> org.wildfly:wildfly-feature-pack:pom:10.0.0.Final
> dom4j:dom4j:jar:1.6.1:compile has transitive dependencies:
> jaxme:jaxme-api:jar:0.3:compile
> msv:xsdlib:jar:20030807:compile
> msv:relaxngDatatype:jar:20030807:compile
> pull-parser:pull-parser:jar:2:compile
> xpp3:xpp3:jar:1.1.3.3:compile
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (WFLY-6352) Build Fails with maven 3.3.9 Oracle JDK 8
by Paul Gier (JIRA)
[ https://issues.jboss.org/browse/WFLY-6352?page=com.atlassian.jira.plugin.... ]
Paul Gier closed WFLY-6352.
---------------------------
Resolution: Cannot Reproduce
> Build Fails with maven 3.3.9 Oracle JDK 8
> ------------------------------------------
>
> Key: WFLY-6352
> URL: https://issues.jboss.org/browse/WFLY-6352
> Project: WildFly
> Issue Type: Bug
> Components: Build System
> Affects Versions: 10.0.0.Final
> Environment:
> Reporter: Eric Lemesre
> Assignee: Paul Gier
>
> When trying to build 10.0.0.Final with Maven 3.3.9 I get the following error from maven-enforcer plugin (at wildfly-feature-pack module).
> {code}
> $ mvn --version
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
> Apache Maven 3.3.9
> Maven home: /usr/share/maven
> Java version: 1.8.0_72, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/jdk-8-oracle-x64/jre
> Default locale: fr_FR, platform encoding: UTF-8
> OS name: "linux", version: "4.2.0-1-amd64", arch: "amd64", family: "unix"
> {code}
> {code}
> $ mvn clean install -PRelease
> ....
> [INFO] ------------------------------------------------------------------------
> [INFO] Building WildFly: Full Feature Pack 10.0.0.Final
> [INFO] ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (ban-bad-dependencies) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java-version) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-maven-version) @ wildfly-feature-pack ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4:enforce (ban-transitive-deps) @ wildfly-feature-pack ---
> [WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanTransitiveDependencies failed with message:
> org.wildfly:wildfly-feature-pack:pom:10.0.0.Final
> dom4j:dom4j:jar:1.6.1:compile has transitive dependencies:
> jaxme:jaxme-api:jar:0.3:compile
> msv:xsdlib:jar:20030807:compile
> msv:relaxngDatatype:jar:20030807:compile
> pull-parser:pull-parser:jar:2:compile
> xpp3:xpp3:jar:1.1.3.3:compile
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (WFLY-6678) StackoverflowError ejbclientinvocationcontext
by Jimmy Pannier (JIRA)
[ https://issues.jboss.org/browse/WFLY-6678?page=com.atlassian.jira.plugin.... ]
Jimmy Pannier updated WFLY-6678:
--------------------------------
Attachment: server.log
Yes of course, this is the server.log file
> StackoverflowError ejbclientinvocationcontext
> ---------------------------------------------
>
> Key: WFLY-6678
> URL: https://issues.jboss.org/browse/WFLY-6678
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Environment: wildfly 9.0.1, jdk 1.8
> Reporter: Jimmy Pannier
> Attachments: server.log
>
>
> Sometimes after few days i get an exception
> Here is a stacktrace.
> 2016-06-07 07:38:10,441 ERROR [org.jboss.as.ejb3.invocation] (default task-76) WFLYEJB0034: EJB Invocation failed on component StorageServiceImpl for method public abstract java.util.List com.inovelan.cloud.api.storage.service.dataset.IStorageEjbService.loadData(com.inovelan.cloud.api.storage.model.dto.dataset.LoadDataConfig): javax.ejb.EJBTransactionRolledbackException: WFLYEJB0457: Unexpected Error
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:153)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
> .....
> Caused by: java.lang.StackOverflowError
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (WFLY-6678) StackoverflowError ejbclientinvocationcontext
by David Lloyd (JIRA)
[ https://issues.jboss.org/browse/WFLY-6678?page=com.atlassian.jira.plugin.... ]
David Lloyd commented on WFLY-6678:
-----------------------------------
This is caused by the interceptor counter "escaping" the bounds of the interceptors array. Somehow something is calling {{getResult()}} on the EJB invocation context again after the result was already acquired. [~jimmy.pannier], is there any way you can paste the *bottom* of that giant stack overflow?
> StackoverflowError ejbclientinvocationcontext
> ---------------------------------------------
>
> Key: WFLY-6678
> URL: https://issues.jboss.org/browse/WFLY-6678
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Environment: wildfly 9.0.1, jdk 1.8
> Reporter: Jimmy Pannier
>
> Sometimes after few days i get an exception
> Here is a stacktrace.
> 2016-06-07 07:38:10,441 ERROR [org.jboss.as.ejb3.invocation] (default task-76) WFLYEJB0034: EJB Invocation failed on component StorageServiceImpl for method public abstract java.util.List com.inovelan.cloud.api.storage.service.dataset.IStorageEjbService.loadData(com.inovelan.cloud.api.storage.model.dto.dataset.LoadDataConfig): javax.ejb.EJBTransactionRolledbackException: WFLYEJB0457: Unexpected Error
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:153)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
> .....
> Caused by: java.lang.StackOverflowError
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (WFLY-6678) StackoverflowError ejbclientinvocationcontext
by David Lloyd (JIRA)
[ https://issues.jboss.org/browse/WFLY-6678?page=com.atlassian.jira.plugin.... ]
David Lloyd updated WFLY-6678:
------------------------------
Steps to Reproduce:
Invoke ejb service with ejbclient
{code}
/**
* Get service needed authentication
*
* @param userContext
* @return
*/
public T getService(final String fullUserId, final String applicationName) {
try {
final Properties ejbClientContextProps = new Properties();
ejbClientContextProps.put("org.jboss.ejb.client.scoped.context", "true");
final Context initialContext = new InitialContext(ejbClientContextProps);
EJBClientContext.requireCurrent().registerInterceptor(0x99999, new ProxyInterceptor(fullUserId, applicationName));
return (T) initialContext.lookup(jndiName);
}
catch (NamingException e) {
LOGGER.warn("Service non disponible : " + jndiName + ", " + e);
}
return null;
}
public class ProxyInterceptor implements EJBClientInterceptor {
public static final String FULL_USER_ID = "fullUserId";
public static final String APPLICATION_NAME = "applicationName";
private final String fullUserId;
private final String applicationName;
/**
*
*/
public ProxyInterceptor(final String fullUserId, final String applicationName) {
this.fullUserId = fullUserId;
this.applicationName = applicationName;
}
/*
* (non-Javadoc)
* @see org.jboss.ejb.client.EJBClientInterceptor#handleInvocation(org.jboss.ejb.client.EJBClientInvocationContext)
*/
@Override
public void handleInvocation(final EJBClientInvocationContext ctx) throws Exception {
ctx.getContextData().put(FULL_USER_ID, fullUserId);
ctx.getContextData().put(APPLICATION_NAME, applicationName);
ctx.sendRequest();
}
/*
* (non-Javadoc)
* @see org.jboss.ejb.client.EJBClientInterceptor#handleInvocationResult(org.jboss.ejb.client.EJBClientInvocationContext)
*/
@Override
public Object handleInvocationResult(EJBClientInvocationContext ctx) throws Exception {
return ctx.getResult();
}
{code}
was:
Invoke ejb service with ejbclient
/**
* Get service needed authentication
*
* @param userContext
* @return
*/
public T getService(final String fullUserId, final String applicationName) {
try {
final Properties ejbClientContextProps = new Properties();
ejbClientContextProps.put("org.jboss.ejb.client.scoped.context", "true");
final Context initialContext = new InitialContext(ejbClientContextProps);
EJBClientContext.requireCurrent().registerInterceptor(0x99999, new ProxyInterceptor(fullUserId, applicationName));
return (T) initialContext.lookup(jndiName);
}
catch (NamingException e) {
LOGGER.warn("Service non disponible : " + jndiName + ", " + e);
}
return null;
}
public class ProxyInterceptor implements EJBClientInterceptor {
public static final String FULL_USER_ID = "fullUserId";
public static final String APPLICATION_NAME = "applicationName";
private final String fullUserId;
private final String applicationName;
/**
*
*/
public ProxyInterceptor(final String fullUserId, final String applicationName) {
this.fullUserId = fullUserId;
this.applicationName = applicationName;
}
/*
* (non-Javadoc)
* @see org.jboss.ejb.client.EJBClientInterceptor#handleInvocation(org.jboss.ejb.client.EJBClientInvocationContext)
*/
@Override
public void handleInvocation(final EJBClientInvocationContext ctx) throws Exception {
ctx.getContextData().put(FULL_USER_ID, fullUserId);
ctx.getContextData().put(APPLICATION_NAME, applicationName);
ctx.sendRequest();
}
/*
* (non-Javadoc)
* @see org.jboss.ejb.client.EJBClientInterceptor#handleInvocationResult(org.jboss.ejb.client.EJBClientInvocationContext)
*/
@Override
public Object handleInvocationResult(EJBClientInvocationContext ctx) throws Exception {
return ctx.getResult();
}
> StackoverflowError ejbclientinvocationcontext
> ---------------------------------------------
>
> Key: WFLY-6678
> URL: https://issues.jboss.org/browse/WFLY-6678
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Environment: wildfly 9.0.1, jdk 1.8
> Reporter: Jimmy Pannier
>
> Sometimes after few days i get an exception
> Here is a stacktrace.
> 2016-06-07 07:38:10,441 ERROR [org.jboss.as.ejb3.invocation] (default task-76) WFLYEJB0034: EJB Invocation failed on component StorageServiceImpl for method public abstract java.util.List com.inovelan.cloud.api.storage.service.dataset.IStorageEjbService.loadData(com.inovelan.cloud.api.storage.model.dto.dataset.LoadDataConfig): javax.ejb.EJBTransactionRolledbackException: WFLYEJB0457: Unexpected Error
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:153)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
> .....
> Caused by: java.lang.StackOverflowError
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
> at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
> at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months