Is it possible to deploy Orbeon on Oracle Weblogic 12c? - weblogic12c

I am trying to deploy Orbeon PE 2016.3 on Weblogic 12c with no luck.
I have tried to deploy the orbeon.war as is to weblogic, also tried along with the other wars that were included in the zip package and the solution suggested in Orbeon documentation to create a custom EAR to avoid some weblogic 11g dependencies.
The stacktrace I get is:
Root cause of ServletException.
java.lang.NoClassDefFoundError: Could not initialize class org.orbeon.oxf.util.DateUtils$
at org.orbeon.oxf.common.PEVersion$LicenseInfo$$anonfun$8.apply(PEVersion.scala:169)
at org.orbeon.oxf.common.PEVersion$LicenseInfo$$anonfun$8.apply(PEVersion.scala:169)
at scala.Option.map(Option.scala:146)
at org.orbeon.oxf.common.PEVersion$LicenseInfo$.apply(PEVersion.scala:169)
at org.orbeon.oxf.common.PEVersion$LicenseInfo$$anonfun$tryApply$1.apply(PEVersion.scala:175)
If I add joda.time to the prefered application packages in weblogic-application.xml this error disappears, but not sure if that is all.
Also when Orbeon is loaded in Weblogic I get the following error:
<Error> <Weblogic-Validation> <BEA-2156404> <Unable to find a Validation Context. java.lang.RuntimeException: javax.naming.NamingException: String index out of range: -1
java.lang.RuntimeException: javax.naming.NamingException: String index out of range: -1
at weblogic.validation.ValidationContextManager.getValidationContext(ValidationContextManager.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
Truncated. see log file for complete stacktrace
Caused By: javax.naming.NamingException: String index out of range: -1
at weblogic.jndi.Environment.getContext(Environment.java:311)
at weblogic.jndi.Environment.getContext(Environment.java:288)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
I also noticed that the ASCII art in the logs is shown 1 time, then 2 times together (Orbeon Forms, Orbeon Forms) and then 3 times.

Related

Jboss EAP 7.1 ServiceModuleLoader returning null

I'm using Jboss EAP 7.1 and when i try to dumpAllModuleInformation from ServiceModuleLoader, i'm getting null pointer exception, however i could see results for LocalModuleLoader. Attaching the Stack Trace below.
Basically i'm trying to see all loaded resources for my war file. I'm really not sure what's the reason for null pointer exception. All other operations like dumpModuleInformation, getDependencies, getModuleDescription, getModulesPathInfo, refreshResourceLoaders, relink and unLoadModule throwing IllegalArguementException: Module specification is null. Only queryLoadedModuleNames is returning my war filenames. Application is running fine without any issues. Jconsole is also throwing the same exception. I need to find a way to see all loaded jars for my war file. Standalone server is hosted with multiple war files, so planning to write a JMX program to get loaded dependencies for all of my wars/ears. Can you guys help me on this
javax.management.RuntimeMBeanException: java.lang.NullPointerException
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1503)
at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:724)
at org.jboss.as.jmx.BlockingNotificationMBeanServer.invoke(BlockingNotificationMBeanServer.java:168)
at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:950)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:75)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor.handleEvent(ServerInterceptorFactory.java:70)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:149)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.jboss.modules.ModuleLoader$MXBeanImpl.doGetResourceLoaders(ModuleLoader.java:857)
at org.jboss.modules.ModuleLoader$MXBeanImpl.getModuleDescription(ModuleLoader.java:866)
at org.jboss.modules.ModuleLoader$MXBeanImpl.doDumpModuleInformation(ModuleLoader.java:737)
at org.jboss.modules.ModuleLoader$MXBeanImpl.dumpAllModuleInformation(ModuleLoader.java:725)
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 sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source

Spring GroovyDynamicElementReader tries to read a Groovy script as XML and fails

When I looked at Spring Boot, I liked the idea that it:
Gets out of the way quickly if you want to change defaults. - Dave Syer, Spring One 2GX 2013
It wasn't long before practicality hit me. While trying to make Boot work with a 100% Groovy/no-XML pet project, I found 2 issues in 2 days. Here's one of them.
Groovy config file:
beans {
xmlns([ctx:'http://www.springframework.org/schema/context'])
ctx.'component-scan'('base-package':'name.abhijitsarkar.moviedatabase')
}
Exception:
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read XML document; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unable to determine validation mode for [Groovy]: cannot open InputStream. Did you attempt to load directly from a SAX InputSource without specifying the validationMode on your XmlBeanDefinitionReader instance?; nested exception is java.io.FileNotFoundException: Groovy cannot be opened because it does not point to a readable resource
at org.springframework.beans.factory.xml.XmlReaderContext.readDocumentFromString(XmlReaderContext.java:98)
at org.springframework.beans.factory.xml.XmlReaderContext$readDocumentFromString.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.springframework.beans.factory.groovy.GroovyDynamicElementReader.invokeMethod(GroovyDynamicElementReader.groovy:96)
Also posted on Spring forum.

LogManager Exception in JBOSS AS 7.1 with java.util.Logger

I created a java application and initialize a java.util.Logger with that application and run that application as -javaagent with jboss AS 7 server and i got IllegalStateException (i am using eclipse IDE).Here follows my logger initialization code
static public void setup() throws IOException {
// Get the global logger to configure it
Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
logger.setLevel(Level.INFO);
fileTxt = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.txt");
fileHTML = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.html");
// create txt Formatter
formatterTxt = new SimpleFormatter();
fileTxt.setFormatter(formatterTxt);
logger.addHandler(fileTxt);
// create HTML Formatter
formatterHTML = new BMITHtmlFormatter();
fileHTML.setFormatter(formatterHTML);
logger.addHandler(fileHTML);
}
When i create -javaagent jar appended with above lines of code and run with jboss as7 server i got following exception
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
... 7 more
And i serched in fourms and i got a solution which is Open the launch configuration for the server definition.
and add -logmodule org.jboss.logmanager to the program arguments before org.jboss.as.standalone.
But it results the same exception with some additional warning. Here follows the exception
WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
... 7 more
I had the same problem with JBOSS EAP 6, it took me 2 days for find a solution !.
The cause is that your agent need to create a Logger at statup, he need to be able to access the logmanager classes before JBOSS Modules has been initialized. You need to add JBoss LogManager to the boot classloader. Then, there will be a conflict between LogManager available via ModuleClassLoader and classes loaded via system classloader.
The solution is to make Java Agent and JBoss Modules use the same classloader to load the LogManager classes.
For EAP 6, In your standalone.conf (or domain) (It must be close for your version)
add
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/main/jboss-logmanager-1.3.1.jar"
and for make Java Agent and JBoss Modules use the same classloader
modify this piece of code in adding org.jboss.logmanager like this :
if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,org.jboss.logmanager"
fi
Hope this will help.
I found the solution after searching for couple of days in the below link.
https://github.com/jbossas/jboss-as-maven-plugin/issues/40#issuecomment-14943429
I have to tweak a little bit to get is work in Windows 7.
Open Eclipse.
Add Jboss 7.1 Runtime 1 server.
Select the Server and press F3.
Click on Open Launch Config.
Goto VM arguments.
Add the below two entries.
"-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"
"-Djava.util.logging.manager=org.jboss.logmanager.LogManager"
Now select the Classpath TAB
Select User Entries
Click Add External Jars
Select the three jar files
a) jboss-logmanager-1.2.0.GA.jar
b) jboss-logmanager-log4j-1.0.0.GA.jar
c) log4j-1.2.16.jar
Paths
C:/jboss-as-7.1.1.Final/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.0.GA.jar"
C:/jboss-as-7.1.1.Final/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar"
C:/jboss-as-7.1.1.Final/modules/org/apache/log4j/main/log4j-1.2.16.jar"
This will start the standalone jboss without any issues.
In EAP 6.4, the correct logmanager's path should be
$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.4.Final-redhat-1.jar

Upgrade xwiki (2.5 to 4.4)

Im using XWIKI ENTERPRISE 2.5 and want to upgrade it to 4.4 or 4.3 (stable)
I found this upgrade documentation for XWiki. Following the guide, I backed up the important files in WEB-INF.
After that, I copied all the files from the new .war to my wiki directory (/var/lib/tomcat6/webapps/xwiki). Then, I moved back the important files and overwrote the new files.
I get this error message, when I visit my wiki page:
HTTP Status 404 - type Status report
message description
The requested resource () is not available.
Apache Tomcat/6.0.28
Here is the logfile:
SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.xwiki.container.servlet.XWikiServletContextListener
java.lang.RuntimeException: Failed to find the Observation Manager component
at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:101)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.observation.internal.DefaultObservationManager] identifier by [role = [interface org.xwiki.observation.ObservationManager] hint = [default]]
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:348)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:155)
at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:99)
... 24 more
Caused by: org.xwiki.component.phase.InitializationException: Failed to lookup Event Listeners
at org.xwiki.observation.internal.DefaultObservationManager.initialize(DefaultObservationManager.java:139)
at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:323)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346)
... 26 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [role = [interface org.xwiki.observation.EventListener] hint = [default]]
at org.xwiki.component.embed.EmbeddableComponentManager.getInstanceMap(EmbeddableComponentManager.java:187)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstanceList(EmbeddableComponentManager.java:169)
at org.xwiki.observation.internal.DefaultObservationManager.initialize(DefaultObservationManager.java:135)
... 30 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.security.authorization.cache.internal.DefaultSecurityCache] identifier by [role = [interface org.xwiki.security.authorization.cache.SecurityCache] hint = [default]]
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:348)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:161)
at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:312)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstanceMap(EmbeddableComponentManager.java:185)
... 32 more
Caused by: org.xwiki.component.phase.InitializationException: Unable to create the security cache with a capacity of 500
at org.xwiki.security.authorization.cache.internal.DefaultSecurityCache.newCache(DefaultSecurityCache.java:104)
at org.xwiki.security.authorization.cache.internal.DefaultSecurityCache.initialize(DefaultSecurityCache.java:112)
at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:323)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346)
... 36 more
Caused by: org.xwiki.cache.CacheException: Failed to get cache factory for role hint [infinispan]
at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:109)
at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:85)
at org.xwiki.security.authorization.cache.internal.DefaultSecurityCache.newCache(DefaultSecurityCache.java:102)
... 41 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.cache.infinispan.internal.InfinispanCacheFactory] identifier by [role = [interface org.xwiki.cache.CacheFactory] hint = [infinispan]]
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:348)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:161)
at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:107)
... 43 more
Caused by: org.infinispan.jmx.JmxDomainConflictException: Domain already registered org.xwiki.infinispan
at org.infinispan.jmx.JmxUtil.buildJmxDomain(JmxUtil.java:73)
at org.infinispan.jmx.CacheManagerJmxRegistration.updateDomain(CacheManagerJmxRegistration.java:92)
at org.infinispan.jmx.CacheManagerJmxRegistration.buildRegistrar(CacheManagerJmxRegistration.java:86)
at org.infinispan.jmx.AbstractJmxRegistration.registerMBeans(AbstractJmxRegistration.java:46)
at org.infinispan.jmx.CacheManagerJmxRegistration.start(CacheManagerJmxRegistration.java:62)
at org.infinispan.manager.DefaultCacheManager.start(DefaultCacheManager.java:720)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:388)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:353)
at org.xwiki.cache.infinispan.internal.InfinispanCacheFactory.initialize(InfinispanCacheFactory.java:104)
at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:323)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346)
... 45 more
When you say that
I copied all the files from the new .war to my wiki directory
Did you copy the new files over the existing directory? You're supposed to delete everything from the old version and use only the files from the new version, and only copy from the backup the essential configuration files. Also, note that you're not supposed to just copy the old configuration, but merge your custom settings into the default new configuration.
The root error in the stack trace:
Caused by: org.infinispan.jmx.JmxDomainConflictException: Domain already registered org.xwiki.infinispan
suggest a duplicate jar. The other case when this could occur is when you have more than one instance of XWiki in the same container, in which case you should edit WEB-INF/cache/infinispan/config.xml, and replace the line jmxDomain="org.xwiki.infinispan" with a unique value, like jmxDomain="org.xwiki.infinispan.wiki1" and jmxDomain="org.xwiki.infinispan.wiki2" for the two instances.
I've been having the same problem when upgrading from 4.0-rc-1 to 4.4 or 4.5. I have no duplicate jars nor am I running several instances of XWiki. It may be there is an issue either in infinispan or in XWiki's cache implementation.
A temporary workaround is to allow duplicate domains explicitly in config.xml :
<globalJmxStatistics
[...]
allowDuplicateDomains="true" />

JBoss- JMS - Failed to download and/or install client side AOP stack

When tried to build a JMS Client to get a connection to messaging on JBoss5(default configuration), I encounter this error(at line: Connection conn = qcf.createQueueConnection();). This is maven project with following libraries in classpath.
jboss:jnp-client:jar:4.0.2:compile
jboss:jboss-aop:jar:JBOSSAS-5.1:compile
jboss:jboss-messaging-client:jar:1.4.7.GA:compile
jboss:jbossall-client:jar:JBOSSAS-5.1:compile
jboss:jboss-common-core:jar:JBOSSAS-5.1:compile
jboss:jboss-mdr:jar:JBOSSAS-5.1:compile
jboss:jboss-logging-spi:jar:JBOSSAS-5.1:compile
org.jboss.remoting:jboss-remoting:jar:2.5.3.SP1:compile
For a very simple code this did not make sense. Any help is appreciated.
My code is as following:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
env.put(Context.OBJECT_FACTORIES, "ConnectionFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
InitialContext iniCtx = new InitialContext(env);
Object tmp = iniCtx.lookup("java:/XAConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
Connection conn = qcf.createQueueConnection();
The error I was getting is
Exception in thread "main" java.lang.RuntimeException: Failed to download and/or install client side AOP stack
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:199)
at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:101)
at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:95)
at com.test.JMSExample.main(JMSExample.java:120)
Caused by: org.jboss.jms.exception.MessagingNetworkFailureException: Failed to connect client
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:347)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:246)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPStack(ClientConnectionFactoryDelegate.java)
at org.jboss.jms.client.ClientAOPStackLoader.load(ClientAOPStackLoader.java:75)
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:192)
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.remoting.InvokerRegistry.loadClientInvoker(InvokerRegistry.java:460)
at org.jboss.remoting.InvokerRegistry.createClientInvoker(InvokerRegistry.java:359)
at org.jboss.remoting.Client$6.run(Client.java:724)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.remoting.Client.connect(Client.java:720)
at org.jboss.remoting.Client.connect(Client.java:668)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:343)
... 7 more
Caused by: java.lang.NoSuchMethodError: org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(Ljava/lang/Object;Ljava/util/Properties;Z)V
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.mapJavaBeanProperties(MicroSocketClientInvoker.java:1359)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.setup(MicroSocketClientInvoker.java:533)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.<init>(MicroSocketClientInvoker.java:292)
at org.jboss.remoting.transport.socket.SocketClientInvoker.<init>(SocketClientInvoker.java:78)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.<init>(BisocketClientInvoker.java:166)
at org.jboss.remoting.transport.bisocket.TransportClientFactory.createClientInvoker(TransportClientFactory.java:44)
... 18 more
It looks like there is a mismatch between JAR files or connectivity problem. Try to do following steps:
1) set -verbose:class option of JVM running JBoss AS and examine the output to find where MicroSocketClientInvoker.class comes from, it looks like JBoss couldn't find a method from it.
2) check if port 4457 is opened, because JBoss messaging connector uses default serverBindPort on 4457.
Hope it helps.
I had the same issue. The issue can be caused by several underlying root causes. In order to evaluate your specific root cause you need to look at the exception stack trace all the way down the "Caused by" exception the to root exception.
In my case the problem was caused by a truststore certificate file that had been corrupted due to incorrectly filtering it during processResources taks of my gradle project. Binary files get corrupted when they are filtered during processResources. For me the fix was to exclude the my certificate.truststore file from resource filtering.