Buscar este blog

sábado, 2 de enero de 2016

JBoss - EJB - java.lang.ClassCastException: org.xnio.SingleOption cannot be cast to org.xnio.Option

This exception is thrown during a Context.lookup() in order to get a remote EJB in JBoss EAP 6.x
18:20:10,906 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/ejemplo].[spring]] (http-localhost/127.0.0.1:8080-3) JBWEB000236: Servlet.service() for servlet spring threw exception: java.lang.ClassCastException: org.xnio.SingleOption cannot be cast to org.xnio.Option
 at org.xnio.Option.fromString(Option.java:155) [xnio-api-3.0.7.GA.jar:3.0.7.GA]
 at org.xnio.OptionMap$Builder.parseAll(OptionMap.java:316) [xnio-api-3.0.7.GA.jar:3.0.7.GA]
 at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:234) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.parseProperties(PropertiesBasedEJBClientConfiguration.java:221) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.<init>(PropertiesBasedEJBClientConfiguration.java:118) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createIdentifiableEjbClientContext(EjbNamingContext.java:255) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.ejb.client.naming.ejb.EjbNamingContext.setupScopedEjbClientContextIfNeeded(EjbNamingContext.java:123) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.ejb.client.naming.ejb.EjbNamingContext.<init>(EjbNamingContext.java:98) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.ejb.client.naming.ejb.ejbURLContextFactory.getObjectInstance(ejbURLContextFactory.java:38) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
 at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:101)
 at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)
 at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
 at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_21]

Solution.

Add the following dependencies to the jboss-deployment-structure.xml:
  • org.jboss.xnio
  • org.jboss.remoting3
  • org.jboss.ejb-client

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
 <deployment>
  <dependencies>
   <module name="org.jboss.xnio" export="true" />
   <module name="org.jboss.remoting3" export="true" />
   <module name="org.jboss.ejb-client" export="true" />
  </dependencies>
  
  <exclude-subsystems>
   <subsystem name="logging" />
  </exclude-subsystems>

  <exclusions>
   <module name="org.apache.log4j" />
   <module name="org.slf4j" />
   <module name="org.log4j" />
   <module name="org.jboss.logging" />
  </exclusions>
 </deployment>
</jboss-deployment-structure>

No hay comentarios:

Publicar un comentario