java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException while deploying on jboss - xmlbeans

I have a weird problem that will make me crazy since 3 days.
I'm generating a client stub(xmlbeans) using axis from a wsdl file then using it to call Ms CRM web service.
My webservice call is working fine in eclipse (having added generated xml resources to classpath) and when i export everything to my jboss server I'm getting this error:
the cause is 'java.lang.reflect.InvocationTargetException'
java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
XMLStreamException is within the xmlbeans-2.3.jar file which is included within the dependencies in the server side so I can't understand why it stops working when deployed to jboss.
JDKs version are exactly the same as well as lib jars.
Any ideas please.
Thankss

Applies to versions <= 3.17 (Java 6):
This error indicates that the class XMLEventFactory does not provide functionality which POI is depending upon. There can be a number of different reasons for this:
Outdated xml-apis.jar, stax-apis.jar or xercesImpl.jar:
These libraries were required with Java 5 and lower, but are not actually required with spec-compliant Java 6 implementations, so try removing those libraries from your classpath. If this is not possible, try upgrading to a newer version of those jar files.
Running IBM Java 6 (potentially as part of WebSphere Application Server):
IBM Java 6 does not provide all the interfaces required by the XML standards, only IBM Java 7 seems to provide the correct interfaces, so try upgrading your JDK.

Related

Maven antrun plugin run with JDK specified with toolchains plugin

Is there any way to make maven run ant with a JDK that is defined using maven toolchains plugin?
Why?
I'm testing if I can convert a legacy ant based project to maven based project. Seems parts of it are next to impossible to do with maven so I need to do those with ant. At one point I need to compile using JDK 6 (and it needs to be 6, see e.g. bootstrap class path not set ). Seems maven runs the antrun with the JDK version it is running and toolchains are not taken into consideration (which is ok because the https://maven.apache.org/guides/mini/guide-using-toolchains.html does not display antrun as compatible plugin).
I had maybe a related issue and and least for a subset of Java related Ant tasks the attribute jvm or executable and setting fork=true to set the used JVM might be helpful. I assume the problem in your case might be solved with javac and java. In my example I had to use Java 8 for an older Java program not running with Java 17:
<java classname="com.sun.javacard.converter.Main"
failonerror="true" fork="true"
jvm="${JAVA_8_HOME}/bin/java">
<jvmarg value="-Djc.home=${jc.home}"/>
...

How can I protect my source code when deploying on different computers

I have a program I just finish writing in CFML (.cfm files) for my client, but I don't want my client to see the source code. I will install the software on his computer. I tried using the compile.bat but when I install it on the other computer, it gives an error (java language...). What are my options?
#Bardware is correct: the target machine needs to have the same major version of Java as that which you compiled the code with, and probably for good measure the minor version should be the same or greater.
You can - of course - confront this from the other direction: find out what version of Java they have running, and compile to that version. However they will still need to be running at least the minimum Java version that is supported for the intended version of ColdFusion.
Also it's vital to note #Bardware's comment against the question itself:
cfcompile.bat calls findjava.bat. There a variable JAVACMD is set.
Coldfusion prefers the JAVA that resides within the CF installation
folder. That is an issue, since CF came with JAVA 7 but might be set
to run with JAVA 8 in the jvm.config. You might resolve the variables
from the command afterdeploycompdir and compile without using the bat
file.

Developing for BlackBerry with IntelliJ

I wonder if someone has idea about next.
I'm developing for BlackBerry. IDEA doesn't recognize RIM installation as JSDK or Mobile SDK. So I have create project without SDK and attach RIM jar file as dependency.
I'm trying to write as much as possible unit test with JUnit and Mockito but to run them IDEA requires JSDK. So I created additional module where I set JSDK, correct language level and it works. It's already hassle to create additional module (better if we could set JSDK and other compiler, runtime options for code and tests) but I was quite happy.
I have also dependencies for some common libraries which we use in android and J2ME also. I added them as modules with JSDK 1.6 and language level 1.3. And I able to develop and run test on it also.
But I got issue with LEDA EAP. IDEA now complaints about incompatibility with java.lang because it found them both in RIM jar and JSDK for libraries. And now I'm thinking about next hassle to fix my favorite ide. Sure it's EAP and things could be changed.
But anyone has any recommendation or similar situation setup?

why i can use jpa 2 feature Criteria API in JDeveloper and Weblogic!

I'm writing criteria API but not work with Weblogic Server. I find that (jpa1.x.x.jar,jpa2.x.x.jar) Library file in weblogic module folder.
I am calling EntityManager.getCriteriaBuilder();
But It shows syntax error, I think it doesn't know the library file.
The EntityManager is included in both jpa1.x.x.jar and jpa2.x.x.jar,
but getCriteriaBuilder() is only included in jpa2.x.x.jar file.
I think it should work because the required library is included.
The version I used is JDeveloper 11.1.14 and Integrated Weblogic.
-waiting for your reply.
I completed my question with NetBean IDE 7.0. In netbean version 7, I can enable/disable jpa2.0 and jsf2.0 with Weblogic 10.3.

How to precompile a ColdFusion application under Websphere/Solaris 10

I am in the process of installing a ColdFusion application on Solaris 10 64-bit (Sparc) running with WebSphere 6.1. The cfcompile script that comes with CF makes a reference to jrun.jar however this library is not available when CF is installed as an ear file. An abstract of cfcompile.sh is the following:
su $cfuser -c "${_JAVACMD} -cp $CLASSES -Dcoldfusion.classPath=$CFUSION_HOME/lib/updates,$CFUSION_HOME/lib -Dcoldfusion.libPath=$CFUSION_HOME/lib coldfusion.tools.CommandLineInvoker Compiler -cfroot $CFUSION_HOME -webinf $WEBINF -webroot $webroot $dir"
Do you see ways to solve this problem (that is to precompile an application), besides installing CF as a standalone running on JRUN server?
Have you checked the contents of the EAR file? There should be a WAR file, in which you'll find WEB-INF/lib. It may be in there. If so, extract it and place it on the classpath.
EAR/WAR file are just zip compressed archives.
This is just a "best guess" on my part.
HTH
Can you install in stand-alone mode on some other temporary location (preferably the same OS & version), and copy jrun.jar to where you want it to be, on the permanent home of the application?
I created my own version of cfcompile.sh on-site to work on the client's infrastructure. The most important part is to have a correct reference to j2ee.jar (found in WAS distribution).