Axis2 Fault : The system is attempting to engage a module that is not available: addressing - axis2

I have the addressing module in my modules folder as well. I have the <module ref="addressing"/> uncommented as well. But, it is still giving the error. I searched in another thread on Stack Overflow:
org.apache.axis2.AxisFault: The system is attempting to engage a module that is not available: addressing
But, it did not help.

Disclaimer- The axis2 war was working on JBoss Server but not on WAS server.
Solution- In axis2.xml file, there is a parameter 'EnableChildFirstClassLoading' which was commented, uncommenting it and deploying axis2 war again solved the issue.
Needed to make the above mentioned change on WAS server only.

Related

java.lang.NoClassDefFoundError: Could not initialize class org.apache.pdfbox.pdmodel.font.PDFont

I am using Apache Tika( tika-app 1.17) in wildfly modules.
While I start extracting PDF it always throws the error:
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.pdfbox.pdmodel.font.PDFont
For other file extensions it works fine.
Things I have tried out dependencies in apache-tika module.xml to PDFbox
Explicitly loaded org.apache.pdfbox from standalone.xml
I have also tried with the below structure
app1.war->(WEB-INF)lib-->app.jar->lib-->tika-app-1.17.jar
I have also jboss-deployment-structure.xml where
<dependencies>
<module name="com.company.tika" />
</dependencies>
is mentioned as a module dependency.
In MANIFEST.MF of the jar also, I have dependency to com.company.tika
Nothing seems to work.
Any suggestions or help would be thankful.
Thanks in Advance
Dwai
I could resolve the issue. The problem was the minor version of pdfbox, fontbox and jempbox were not the same. Hence the PDFFont was not initialized, because internally it needs to load the classes of fontbox also and probably there was a mismatch in the version id of the classes
setting SOLR_JAVA_STACK_SIZE='-Xss256M' only and not making any changes to libs solved this issue for me
I had similar problem.
Under linux i just install missing library pdfbox by:
apt-get install libpdfbox-java
and restart solr server
After this modification i need to change solr start parameter in ./bin/solr
from
SOLR_JAVA_STACK_SIZE='-Xss256kb'
to
SOLR_JAVA_STACK_SIZE='-Xss256M'
because i had error
java.lang.StackOverflowErrorjava.lang.RuntimeException: java.lang.StackOverflowError
of course i restart solr server again.
I hope, it help you reolve this problem.

java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.util.IdGenerator

I am trying to use ActiveMQ 5.10.0 with SoapUI 4.6 and Hermes 1.14. I get the error below when I try and add a queue. I presume Hermes can't find the type IdGenerator in any of the loaded jars. Which are:
activemq-client-5.10.0.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
Does anyone know where this class is defined? I looked for activemq-util.jar in the binary distribution but I did not find such a file.
Error:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.util.IdGenerator
at org.apache.activemq.ActiveMQConnectionFactory.getClientIdGenerator(ActiveMQConnectionFactory.java:969)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:363)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:331)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:303)
at org.apache.activemq.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:260)
at hermes.impl.jms.ConnectionManagerSupport.createConnection(ConnectionManagerSupport.java:147)
at hermes.impl.jms.ConnectionManagerSupport.createConnection(ConnectionManagerSupport.java:92)
at hermes.impl.jms.ConnectionSharedManager.reconnect(ConnectionSharedManager.java:81)
at hermes.impl.jms.ConnectionSharedManager.connect(ConnectionSharedManager.java:91)
at hermes.impl.jms.ConnectionSharedManager.getConnection(ConnectionSharedManager.java:104)
at hermes.impl.jms.ConnectionSharedManager.getObject(ConnectionSharedManager.java:142)
at hermes.impl.jms.ThreadLocalSessionManager.connect(ThreadLocalSessionManager.java:190)
at hermes.impl.jms.ThreadLocalSessionManager.getSession(ThreadLocalSessionManager.java:570)
at hermes.impl.jms.AbstractSessionManager.getDestination(AbstractSessionManager.java:460)
at hermes.impl.DefaultHermesImpl.getDestination(DefaultHermesImpl.java:367)
at hermes.browser.tasks.BrowseDestinationTask.invoke(BrowseDestinationTask.java:141)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Unknown Source)
This is very old but in case anyone else is trying to get this spun up... don't use the built in HermesJMS that comes with SoapUI. Apparently there's a bug in it that doesn't play nice with ActiveMQ v5.8 and following [I tried 5.11 & 5.13 and had the issue. The cheating fix is to install the standalone [I had to get it from sourceforge].
The sourceforge jar is installed with [assuming version 1.14]: java -jar hermes-installer-1.14.jar
Once installed you can tie this version to soapui or launch it with the bat/sh file. I still had issues with ActiveMQ version 5.13 but version 5.11 worked for me.
The IdGenerator class is located in the activemq-client jar. Here is the result of a search in the source tree:
/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java
There's been no recent changes so I'd guess that the error is misleading and that it's actually some other missing dependency that's being loaded when the class is created. Is there more information in the log or a 'caused by exception' ?
For whom it may interest. This is kind of common issue I come accross from time to time. I call it jar version incompatibility. I was getting exception in title and other funny exceptions when using latest (but not actively developed) hermes 1.14 and currently latest Apache Active MQ 5.14. I've found out after a long struggle that it is fixed by using an older version of Active MQ - like 5.3.

maven 3.1.0 compile does not use proxy username

Running on Windows XP, I set up my ~/.m2/settings.xml to include the following proxy settings:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>davidho</username>
<password>mypassword</password>
<host>192.168.0.35</host>
<port>3128</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
mvn archetype:generate then worked great, downloading all the required files and succeeding.
But then I tried
mvn compile
and got:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (http.//repo.maven.apache.org/maven2): Error transferring file: Server returned HTTP response code: 407 for URL: http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom from http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom with proxyInfo ProxyInfo{host='192.168.0.35', userName='null', port=3128, type='http', nonProxyHosts='null'}
Huh ?! Why does it say userName='null' when I have specified a username and password in my
settings.xml ?
I then tried:
mvn compile -Dhttp.proxyUser=davidho -Dhttp.proxyPassword=mypassword
and it made no difference - it still said userName='null'
How can I fix this thanks ?
n.b. stackoverflow forced me to change the "http:" in the error message to "http."
Same here, using parameters on the cmd line or in the settings file.
There are few things you need to check!
if you are using IDE then you might be facing issues with Embedded maven installation which is by default value and you can get it resolved by changing maven installation. try this answer.
if you are behind NTLM windows proxy you need to use CNTLM software to get you authenticated which is batter described in this answer.if you are using IDE please change installation as described in first point.

weblogic hot deployment working for jsps but not for web-inf/classes

I am deploying an ear application in weblogic 10.3 in exploded format with fast swap enabled and in dev mode.
The ear file contains a web app also in exploded format. The changes made to the jsps in the web app are getting reloaded. But the classes under web-inf when changed are not reloaded.
The weblogic deployment configuration is given below.
weblogic-application.xml content in ear/META-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:classloader-structure>
<wls:classloader-structure>
<wls:module-ref>
<wls:module-uri>web.war</wls:module-uri>
</wls:module-ref>
</wls:classloader-structure>
</wls:classloader-structure>
application.xml content in ear/META-INF
<display-name>web-ear</display-name>
<module>
<web>
<web-uri>web.war</web-uri>
<context-root>/web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
weblogic.xml content in war/WEB-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:context-root>/web</wls:context-root>
<wls:session-descriptor>
<wls:cookie-max-age-secs>-1</wls:cookie-max-age-secs>
<wls:cookie-name>JSESSIONID_SQE_AAI</wls:cookie-name>
<wls:cookie-path>/</wls:cookie-path>
<wls:cookies-enabled>true</wls:cookies-enabled>
<wls:invalidation-interval-secs>120</wls:invalidation-interval-secs>
<wls:id-length>52</wls:id-length>
<wls:timeout-secs>7200</wls:timeout-secs>
<wls:url-rewriting-enabled>true</wls:url-rewriting-enabled>
<wls:persistent-store-type>memory</wls:persistent-store-type>
<wls:http-proxy-caching-of-cookies>false</wls:http-proxy-caching-of-cookies>
</wls:session-descriptor>
<wls:jsp-descriptor>
<wls:page-check-seconds>6</wls:page-check-seconds>
</wls:jsp-descriptor>
<wls:container-descriptor>
<wls:servlet-reload-check-secs>6</wls:servlet-reload-check-secs>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
Is the configuration done above right? Are there any config details I have missed to include here? What other settings or configurations should I check?
Any help would be very much appreciated thanks.
Even if you enable FastSwap in your application, the modules that are declared in the classloader-structure will not support FastSwap because they aren't loaded by the RedefiningClassLoader, but rather by the GenericClassLoader.
You can test this by printing the classloader of your classes under WEB-INF/classes and check if it's the com.bea.wls.redef.RedefiningClassLoader or not.
I struggled to make them work together, you can see more details here https://forums.oracle.com/forums/thread.jspa?threadID=2476484&tstart=60 but, unfortunately, no solution so far.
Regards.

Apache Mina tutorial

I am tearing my hair out trying to figure out how to run the simplest Apache Mina tutorial.
I am running the tutorial on Netbeans 6.9 on Ubuntu and it keeps saying the following error
even I have added the necessary jar files to the compile-time libraries folders in Netbeans.
Exception in thread "main"
java.lang.ExceptionInInitializerError
at minatimeserver.MinaTimeServer.main(MinaTimeServer.java:29)
Caused by: java.lang.RuntimeException:
Uncompilable source code - package
org.slf4j does not exist
at org.apache.mina.core.service.AbstractIoService.(AbstractIoService.java:51)
... 1 more
I have downloaded slf4j-log4j12-1.6.1.jar and slf4j-api-1.6.1.jar and placed them in the compile-time libraries folder too but the error still remains. I have also tried with slf4j-1.5.11
Any person who has solved this problem? Please help me or I'm going bald in no time!
Thanks in advance!
Yakult121
slf4j-log4j12-1.6.1.jar and slf4j-api-1.6.1.jar are runtime libraries.
Add them to your class path not to your compile-time libraries else it will try to compile your jar files.
Also See
What's the difference of compile time libraries and run time libraries in java?
Apache mina uses slf4j-api-1.6.1.jar, adding slf4j-api-1.6.1.jar to class path will resolve the issue.
Well, I also had faced same problem. What I did was, I unjarred the mina-core-2.x that is on the main page of the apache project. When things failed, I changed downloaded mina-core-1.1.7 and everything worked fine. Of course, you have to make sure that you set the claspath correctly.