JVMCFRE003 bad major version; class=com/ibm/filenet/ps/ciops/test/AUDOperationsTest, offset=6
1) | First run of the JUnit test class, AUDOperationsTest, we get indicating that the compiled class JRE is different from the JVM version, so this was changed in the Eclipse project from 1.7 to 1.8. |
Figure 3-80The Java Compiler is changed from Java version 1.7 to 1.8
The next run of the JUnit test class, AUDOperationsTest, gave the output:
com.filenet.api.exception.EngineRuntimeException: FNRCE0051E: E_OBJECT_NOT_FOUND: The requested item was not found. Object identity: /AUDIT_TEST/Audit Event Test Version 2. Class name: Versionable. errorStack={
(/AUDIT_TEST/Audit Event Test Version 2 was used initially.)
The second run, after using the following JUnit Test properties:
AUDOperationsTest.CEWsiUrl=http://ecmukdemo6:9080/wsi/FNCEWS40MTOM/
AUDOperationsTest.ConnectionPointName=CP1
AUDOperationsTest.EmailFrom=alan.bluck@asbsoftware.co.uk
AUDOperationsTest.EmailTemplatePath=/AUDIT_TEST/AC.pdf
AUDOperationsTest.EmailTo= alan.bluck@asbsoftware.co.uk
AUDOperationsTest.ObjectstoreName=OS2
AUDOperationsTest.Password=filenet
AUDOperationsTest.TestFolderName=/AUDIT_TEST
AUDOperationsTest.Username=Alan
AUDOperationsTest.WaspLocation=/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/localhostNode01Cell/FileNetEngine.ear/cews.war/WEB-INF/classes/com/filenet/engine/wsi
AUDOperationsTest.WsiJaasConfigFile=/opt/IBM/ECMClient/configure/CE_API/config/jaas.conf.WSI
Listing 3-8The updated Configuration.properties file
Now, we get further, but we get the following stack trace:
log4j:WARN No appenders could be found for logger (filenet_error.api.com.filenet.apiimpl.util.ConfigValueLookup).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[Perf Log] No interval found. Auditor disabled.
<?xml version=1.0 encoding= utf-8/?><AUDIT_REPORT><CaseID>00001</CaseID><COMMENTS>AUD Test on 17th February pm</COMMENTS><AUDIT_DATE>2022-06-27</AUDIT_DATE><AUDIT_STATUS>Date of Audit Report Document</AUDIT_STATUS></AUDIT_REPORT>
Lookup connection factory cn=AUDQCF
Sending a message…
Lookup connection factory cn=AUDQCF
Error : com.ibm.mq.jms.MQQueue incompatible with javax.jms.ConnectionFactory
Error Stack : java.lang.ClassCastException: com.ibm.mq.jms.MQQueue incompatible with javax.jms.ConnectionFactory
So, now we get the error indicating that the class com.ibm.mq.jms.MQQueue cannot be cast to javax.jms.ConnectionFactory.
There is an IBM Technote for this; see the link:
www.ibm.com/support/pages/javalangclasscastexception-error-occurs-during-jndi-lookup-queue-connection-factory
The application code is similar to the following example:
javax.jms.QueueConnectionFactory myQCF = null;
InitialContext ic = null;
//… setup InitialContext here …
try
{
myQCF = (QueueConnectionFactory)ic.lookup(“jms/myQCF”);
}
catch(Throwable e)
{
e.printStackTrace();
}
You can resolve the problem using one of the following methods:
- Define the queue connection factory as a WebSphere MQ Queue Connection Factory.
- Use a javax.jms.ConnectionFactory object in the application code rather than a javax.jms.QueueConnectionFactory object.
Update JMS tcp 1414 port in the server Firewall for ibm-mqseries using the commands:
firewall-cmd –zone=public –permanent –add-port=1414/tcp
firewall-cmd –reload
The server Firewall is now updated to allow the MQ Series port 1414 to be opened.
firewall-cmd –zone=public –permanent –add-port=1417/tcp
firewall-cmd –reload
We also need to be able to reference the following IBM jar file packages: com.ibm.mq.jar
com.ibm.mq.jmqi.jar
com.ibm.msg.client.jms.internal.jar
com.ibm.msg.client.jms.jar
com.ibm.msg.client.provider.jar
We also need the WAS_ROOT/runtimes/com.ibm.ws.ejb.thinclient_8.5.0.jar classpath, where WAS_ROOT is the installation home of the WAS, for example, /opt/WebSphere80/AppServer/runtimes/com.ibm.ws.ejb.thinclient_8.5.0.jar.
Figure 3-81The required IBM MQ reference .jars are found and copied
The copied jars are selected for the Eclipse Java project Classpath.
Figure 3-82The selected files are referenced
The Java Build Path now has the following selected library .jar files.
Figure 3-83The required IBM MQ jars are selected from the /opt/MQJars folder
Figure 3-84The com.ibm.ws.ejb.thinclient_8.5.0.jar is copied to /opt/MQJars
Figure 3-85The com.ibm.ws.ejb.thinclient_8.5.0.jar is loaded to Eclipse
Figure 3-86The com.ibm.ws.ejb.thinclient_8.5.0.jar is added to the Classpath
We also need the following .jar files from <WebSphere Installation Directory>/lib:
j2ee.jar
bootstrap.jar
Figure 3-87The j2ee.jar and bootstrap.jar files are copied
Next, we need the following JARs from <WebSphere Installation Directory>/plugins:
— com.ibm.ws.runtime.jar
— com.ibm.ws.emf.jar
— org.eclipse.emf.ecore.jar
— org.eclipse.emf.common.jar
— com.ibm.ffdc.jar
Figure 3-88The listed .jars are also copied
We also required the ibmorb.jar.
Figure 3-89The ibmorb.jar is copied from the /opt/mqm/java/jre64/jre/lib folder
Added providerutil.jar from the path:
Figure 3-90The providerutil.jar file is added to the /opt/MQJars folder
Figure 3-91The selected .jars from the /opt/MQJars are added to the Classpath
Figure 3-92The listed .jars are added using the Apply and Close command