How to integrate JRebel with Mule ESB? - java

Has anybody sometime tried to use JRebel with Mule instead of a typical application server? If so, could you describe your experience?
As far as I know, currently, Mule is not officially supported by the JRebel team. However, I was wondering if there might be some workaround to this limitation.

Although Mule ESB is not officially supported by JRebel, we have found a workaround. First of all, let me start by stating that:
As of today, it is not possible to hot-deploy Mule XML flows by using JRebel. Mule, however, offers its own mechanisms for achieving this same thing. As such, the lack of JRebel support for this is no deal breaker.
So, the only thing we can hot-deploy are the Java classes, which is still very welcome. How do we do that?
Start by configuring the JRebel agent in $MULE_HOME/conf/wrapper.conf. The required lines, in our case, were:
wrapper.java.additional.13=-javaagent:{path to jrebel.jar}
wrapper.java.additional.14=-Xbootclasspath:{path to rebelboot.jar}
wrapper.java.additional.16=-Drebel.remoting_plugin=true
wrapper.java.additional.19=-Drebel.remoting_port={whatever}
These are the JVM paremeters required to launch JRebel along with Mule. The numbering of the parameters is arbitrary.
We want to use JRebel in remote mode. You can read about this mode in the docs. That's the reason for the wrapper.java.additional.16=-Drebel.remoting_plugin=true and wrapper.java.additional.19=-Drebel.remoting_port={whatever} paremeters.
Now go ahead and launch Mule by either executing mule.bat or mule.sh, depending on your environment (Windows or *nix). JRebel should start along with it.
Place your Mule applications inside $MULE_HOME/apps. They will be automatically deployed and, from now on, their .class files will be monitored by JRebel.
Inside your IDE, install the JRebel plugin and apply your license. Afterwards, add the JRebel nature to your project and configure its remote server URL using the port we previously defined inside wrapper.conf.
Do whatever changes you need to do to your code and sync. They should be successfully hot-deployed into the running Mule instance.

when I was testing, I noticed that you need to add in the file wrapper.conf the next attributes:
wrapper.java.additional.18=-Drebel.log=true
wrapper.java.additional.19=-Drebel.log.file=/MyPath/LogName.log
With these the JRebel runs correctly. In conclusion, when we´re using a specific port, is necessary to enable JRebel’s logging.
More information, check in Step 6:
https://zeroturnaround.com/software/jrebel/learn/remoting/setting-up-jrebel-remoting-with-intellij-idea-and-tomcat/

When I configured with the points indicated, I have the next exception in Mule´s console:
Launching a JVM...
2015-10-27 11:00:27 JRebel: WARN You are running JRebel using the -javaagent option on a system where -agentpath is supported.<br/>
2015-10-27 11:00:29 JRebel: Monitoring Log4j configuration in 'file:/C:/Dev/Mule%20-%2002-esb-mule-ee%20-%203.4/conf/log4j.properties'.<br/>
Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.parsers.SecuritySupport$1: method <init>()V not found<br/>
at javax.xml.parsers.SecuritySupport.getContextClassLoader(Unknown Source)<br/>
at javax.xml.parsers.FactoryFinder.find(Unknown Source)<br/>
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)<br/>
at com.opensymphony.module.propertyset.config.PropertySetConfig.<init>(PropertySetConfig.java:53)<br/>
at com.opensymphony.module.propertyset.config.PropertySetConfig.getConfig(PropertySetConfig.java:113)<br/>
at com.opensymphony.module.propertyset.PropertySetManager.getInstance(PropertySetManager.java:32)<br/>
at com.opensymphony.module.propertyset.PropertySetManager.getInstance(PropertySetManager.java:22)<br/>
at com.mulesource.licm.pref.MulePropertySetPreferences.loadPropertySet(MulePropertySetPreferences.java:208)<br/>
at com.mulesource.licm.pref.MulePropertySetPreferences.<clinit>(MulePropertySetPreferences.java:50)<br/>
at com.mulesource.licm.pref.MulePreferencesFactory.<clinit>(MulePreferencesFactory.java:19)<br/>
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br/>
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)<br/>
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)<br/>
at java.lang.reflect.Constructor.newInstance(Unknown Source)<br/>
at java.lang.Class.newInstance(Unknown Source)<br/>
at java.util.prefs.Preferences.factoryOrig(Unknown Source)<br/>
at java.util.prefs.Preferences.userRoot(Unknown Source)<br/>
at com.mulesource.licm.impl.TrueLicenseHelper.createLicenseManagerParameters (TrueLicenseHelper.java:338)<br/>
at com.mulesource.licm.impl.TrueLicenseHelper.createLicenseManagerParameters(TrueLicenseHelper.java:330)<br/>
at com.mulesource.licm.impl.TrueLicenseHelper.<init>(TrueLicenseHelper.java:120)<br/>
at com.mulesource.licm.impl.MuleLicenseManager.<init>(MuleLicenseManager.java:25)<br/>
at com.mulesource.licm.LicenseManagementFactory.createLicenseManager(LicenseManagementFactory.java:48)<br/>
at org.mule.module.boot.LicenseKeyHandler.<init>(LicenseKeyHandler.java:43)<br/>
at org.mule.module.reboot.MuleContainerBootstrap.handleLicenseKey(MuleContainerBootstrap.java:192)<br/>
at org.mule.module.reboot.MuleContainerBootstrap.main(MuleContainerBootstrap.java:62)<br/>

Configuration JRebel in Mule is very similar to configuration in tc Server.
You need to add JRebel Agent as a wrapper.java.additional.* property in $MULE_HOME/conf/wrapper.conf:
wrapper.java.additional.10=-agentpath:[c:\path\to]lib\jrebel64.dll
If you use Java version 7 and newer you use agent:
Windows 64-bit JDK jrebel64.dll
Windows 32-bit JDK jrebel32.dll
Mac OS X 64-bit JDK libjrebel64.dylib
Mac OS X 32-bit JDK libjrebel32.dylib
Linux 64-bit JDK libjrebel64.so
Linux 32-bit JDK libjrebel32.so
If you use Java version 6 and below, you need to use legacy agent jrebel.jar file.

Related

Install DB2 Connect under Linux - error occured: "AWT-EventQueue-0" java.lang.NullPointerException

I am trying to install db2 connect (Version 10.1) under Linux (Debian 9.5). After calling db2setup the user interface freezes at point 5 (language selection) of the menu. The problem occurs only with the installation type CUSTOM.
This error message is triggered in the /tmp/db2setup.err log when the Next button is pressed.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.ibm.db2.install.util.MessageHandler.handleMessage(Unknown Source)
at com.ibm.db2.install.util.MessageHandler.handleMessage(Unknown Source)
at com.ibm.db2.install.util.MessageHandler.handleError(Unknown Source)
at com.ibm.db2.install.gui.panels.FeaturePage.preValidate(Unknown Source)
at com.ibm.db2.install.gui.wizard.SetupWizardPanel.preValidatePage(Unknown Source)
at com.ibm.db2.install.gui.wizard.SetupWizardPanel.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2029)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2352)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:413)
at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:319)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:263)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:300)
at java.awt.Component.processMouseEvent(Component.java:6515)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3332)
at com.ibm.db2.tools.common.sg.CustomToggleButton.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Component.java:6280)
at java.awt.Container.processEvent(Container.java:2240)
at java.awt.Component.dispatchEventImpl(Component.java:4871)
at java.awt.Container.dispatchEventImpl(Container.java:2298)
at java.awt.Component.dispatchEvent(Component.java:4697)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4843)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4503)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4433)
at java.awt.Container.dispatchEventImpl(Container.java:2284)
at java.awt.Window.dispatchEventImpl(Window.java:2724)
at java.awt.Component.dispatchEvent(Component.java:4697)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:718)
at java.awt.EventQueue.access$000(EventQueue.java:112)
at java.awt.EventQueue$3.run(EventQueue.java:677)
at java.awt.EventQueue$3.run(EventQueue.java:675)
at java.security.AccessController.doPrivileged(AccessController.java:226)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:98)
at java.awt.EventQueue$4.run(EventQueue.java:691)
at java.awt.EventQueue$4.run(EventQueue.java:689)
at java.security.AccessController.doPrivileged(AccessController.java:226)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:688)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:222)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:124)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
This message appears in db2setup.log:
"TSAMP" is needed but cannot be found on the media.
What am I doing wrong? I also tried to make the selection with the keyboard only - with the same result.
Is it possible to install db2 connect without GUI?
Stackoverflow is for programming issues, you might try dba.stackexchange.com for non-programming matters.
According to IBM SPCR, the v10.1 of Db2-connect was supported on RHEL 5.6 & 6, also SLES 10 and 11 , and Ubuntu 10.04LTS , 12.04LTS.
It might work (or might not) on later versions of Linux, or Debian 9.5 , or might have issues that need workaraounds. You might not get official support via the IBM formal channels. If you intend to use for production, ensure your business formally accepts the risks of running an out-of-support product on operating-system for which it was not tested.
If possible, use a currently supported version of a Db2-connect edition. Check end of support dates with IBM.
Ensure you try with the final fixpack of V10.1 which is FP6 (free download from IBM - get the 'server fixpack' build fixpack, not the universal one,
the server fixpack is installable without needing the base product to be installed already).
Install as root, because non-root installs are troublesome.
Carefully verify all of the prerequisites especially the required packages, SElinux settings, kernel-parameters and all others mentioned in documentation.
To install without a GUI you have 2 options, either use db2setup with response-files, or use the command-line db2_install tool (deprecated, but still works). Both tools support additional detailed logging (tracing) which can help, refer to documentation for details.
If you already have a different working Db2-connect server, you can use its db2rspgn tool to generate a text response-file (which you can then edit as needed) and supply the modified response file to db2setup.
If you get installation/run issues, try dba.stackexchange.com.
To avoid the exception, the TSAMP option must be deselected (installation type: CUSTOM).

Oracle JDK Update 5 (1.7.0_05) not working on SUSE Linux Enterprise Server 11. EOFException while connecting to Javaspace Blackboard (JINI)

We are trying to run a process (broker) from a SUSE Linux Enterprise Server 11 (java-1_7_0-ibm) which connects to a Javaspace Blackboard (JINI) deployed on another linux machine. (CentOs with Open JDK "1.7.0_05-icedtea" version)
Stack Trace :
INFO: Starting broker
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:259)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:653)
at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at com.sun.jini.reggie.$Proxy0.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
at edu.vt.ndssl.blackboard.JiniSpaceService.findSpace(JiniSpaceService.java:372)
at edu.vt.ndssl.blackboard.JiniSpaceService.<init>(JiniSpaceService.java:74)
at edu.vt.ndssl.blackboard.JavaSpaceBlackboard.<init>(JavaSpaceBlackboard.java:31)
at edu.vt.ndssl.blackboard.BlackboardFactory.make(BlackboardFactory.java:28)
at edu.vt.ndssl.broker.Broker.<init>(Broker.java:53)
at edu.vt.ndssl.broker.Broker.main(Broker.java:231)
Caused by: java.lang.RuntimeException: Unexpected exception
at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:237)
... 10 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1387)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2059)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1984)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1867)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1419)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:420)
at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
... 13 more
Same code works fine with Java 1.6 version upto 26.
I am looking for a correct version of Java to be installed on the SUSE Linux Enterprise Server which will be compatible with this OS and also equivalent to the Oracle JDK Update 5 or Open JDK Version 1.7.0_05 (icedtea).
Apparently, the root cause of the problem is that Oracle has made an incompatible change to the serialization format of the com.sun.jini.logging.Levels class. The change reportedly happened in Oracle JDK 1.6.0_38 and JDK 1.7.0_13, and has presumably made it into recent OpenJDK versions as well.
This problem has manifested in a variety of projects that use JINI. Examples:
https://issues.apache.org/jira/browse/RIVER-415 + https://issues.apache.org/jira/browse/RIVER-416.
https://cloudifysource.zendesk.com/entries/23079726-bootstrap-localcloud-not-working-Could-not-initialize-class-com-sun-jini-logging-Levels
More examples can be found by searching for "com.sun.jini.logging.Levels EOFException".
I can't say what the solution is / would be for you, but I have a couple of ideas:
Avoidance: I think you can avoid the problem if you don't mix pre and post-change JVM versions in your application network.
If you need to upgrade your application JVMs, I suggest that you upgrade them all, and then do a complete shutdown/restart of your JINI applications and services.
Fix your applications: It appears that the Apache River project fixed the problem by modifying the JINI code. As the issue ticket says:
The com.sun.jini.logging.Levels class produces a RuntimeException with the latest version of Java (both 1.6 and 1.7). The issue surrounds creation of custom java.util.logging.Level. The current implementation uses a ClassReplacingObjectOutputStream and the LevelData approach. By removing this approach and creating a subclass of java.util.logging.Level the issue gets resolved.
The issue ticket has a lot of discussion on the best way to do this, proposed patches and links to the checkin where they actually implemented the fix.

Deployed jars to the Domino server via Notes-UpdateSite Database end in NoClassDefFoundException

We have several .jar Files that we want to deploy to our 8.5.3 Domino servers.
The console command "tell http osgi diag <bundle name>" works and shows me the bundle is there. But when i start an Notes Java Agent that has import statements from the jar the domino console prints NoClassDefFoundError errors for these classes.
Example from a .jar originally called saxon9he.jar:
[1834:0036-1E84] 24.08.2012 11:21:14 HTTP JVM: Exception in thread "AgentThread:JavaAgent"
[1834:0037-1E84] 24.08.2012 11:21:14 HTTP JVM: java.lang.NoClassDefFoundError:net.sf.saxon.Version
[1834:0039-1E84] 24.08.2012 11:21:14 HTTP JVM: at JavaAgent.NotesMain(Unknown Source)
[1834:003B-1E84] 24.08.2012 11:21:14 HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)
[1834:003D-1E84] 24.08.2012 11:21:14 HTTP JVM: at lotus.domino.NotesThread.run(Unknown Source)
[1834:003F-1E84] 24.08.2012 11:21:14 HTTP JVM: Caused by:
[1834:0040-1E84] 24.08.2012 11:21:14 HTTP JVM: java.lang.ClassNotFoundException: net.sf.saxon.Version
[1834:0042-1E84] 24.08.2012 11:21:14 HTTP JVM: at lotus.domino.AgentLoader.loadClass(Unknown Source)
[1834:0044-1E84] 24.08.2012 11:21:14 HTTP JVM: at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
[1834:0046-1E84] 24.08.2012 11:21:14 HTTP JVM: ... 3 more
Some of these .jar Files are completly written by ourselfs while others are contributed from open-source-projects. These jar. Files are just used via import-instructions in several Java Agents, XPages and classes created in the Java-Views in Domino Designer in "WebContent". We use these packages in various design-elements and have about 100 domino servers that have to get these files and patches, thats why we don't want to lay them into the local file-system in each of them.
This is what i have done so far to get the jar. Files to my domino server:
I have imported these jar. Files in my Eclipse 4.2 client into a new "Plugin Project from existing Jar" and configured the import and export packages. (I even tried making Bnd-Projects from these jar.Files to have proper OSGI-ready Manifest-files which sadly didn't do it better)
After that i created a feature project which contains the plugins. At Last i imported that feature to a new Update-Site project in my Eclipse and build it.
I picked this site.xml in a database i created from the Template "StdEclipseUpdateSite" (Version 8.5.3 (04.03.2011). This database is referenced in the Notes.ini via "OSGI_HTTP_DYNAMIC_BUNDLES" param on my 8.5.3 Domino server x64 running locally on my windows 7 x64 for testing purposes.
I have worked on this problem for several days now, read about osgi and googl'ed a lot about similiar problems but i was not able to get this done myself. Any help is very appreciated.
OSGI Bundles are not visible to Classic Agents, I would recommend you use the DOTS plugin service to accomplish those tasks. http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=OSGI%20Tasklet%20Service%20for%20IBM%20Lotus%20Domino
I know this is an old question - I just stumbled over it looking for some deployment issues :-)
In short: The agent JVM and the XPages JVM are NOT the same. So "old" agents (and webservices for that matter) will not see anything deployed to OSGi via update sites.
The only option you can use is to copy the jar file(s) to the jvm/lib/ext in the program library of the server. That works. You should not even consider adding the jar files to the agent (or a Java script library) since there is a memory leak in the mechanism that detaches the jar file prior to using it.
So consider it this way. The shift to the "new Java world" is not going to involve the old technologies (primarily agents). You will have to look out for new mechanisms for scheduling tasks in Domino. I personally believe DOTS/Tasklets is going to be the way forward - but there still is a need for solutions to "wrap it in" - and make it easy to set up tasks.
/John

JAX-WS and version conflicts

As test project I've create a very simple WebService using wsdl and jax-ws. The client runs very well if it is deployed as web application in GlassFish but if I start the same (WebService-)Code in Eclipse directly, I get the following error:
WARNUNG: Input Action on WSDL operation AddNumbers and #Action on its associated Web Method addNumbers did not match and will cause problems in dispatching the requests
Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/ha/store/api/BackingStoreException
at com.sun.xml.ws.rx.mc.runtime.McConfigurationFactory.createInstance(McConfigurationFactory.java:66)
at com.sun.xml.ws.rx.mc.runtime.McTubeFactory.createTube(McTubeFactory.java:68)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:228)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:205)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:178)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:85)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:608)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:348)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312)
at javax.xml.ws.Service.getPort(Service.java:134)
at mnm.namedesdienstes.webservice.service.NameDesDienstesService.getNameDesDienstesPortTypePort(NameDesDienstesService.java:56)
at webserviceClient.NameDesDienstesClient.myTest(NameDesDienstesClient.java:12)
at webserviceClient.NameDesDienstesClient.main(NameDesDienstesClient.java:25)
Caused by: java.lang.ClassNotFoundException: org.glassfish.ha.store.api.BackingStoreException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 16 more
After some research I found out that it must have something to do with different versions of some library files. So now my question is, how can I "fix" my eclipse java execution to run my webservice client correctly? I've found some tips to copy some jar to an endorsed-directory, but which jars into which directory :-)
I'm using Max OS 10.6.8, Eclipse Project uses JVM 1.6. My Mac Java Version is
xmacbook:~ cstraube$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
UPDATE: My first try (thanks to the link from remipod) I performed the following steps:
Get the directory of endorsed lirbaries with System.out.println(System.getProperty("java.endorsed.dirs"));
Next, I copied the two files JAXWS2.1.7-20090419.jar and JAXB2_20080513.jar (both Version 2.1.7) into this directory
Unfortunately I get still the same error
I have similar problem with yours when deploying web service (JAX-WS) in tomcat 7.
The missing class definition could be found in ha-api.jar.
org/glassfish/ha/store/api/BackingStoreException
You should add the ha-api.jar (From JAX-WS distribution) into server lib. For my case, the eclipse run tomcat 7, so the location is (Tomcat 7.0\lib).
You have to copy the fitting versions of jaxws-api.jar and jaxb-api.jar into the directory /Library/Java/Home/lib/endorsed (Mac).
Have a look at this link JAX WS with WS 2.1.1. You will need to give precedence to your version of jaxws to the provided jaxws from the jre 1.6.
Edit:
Glassfish already includes some libraries, as well as java 6. I had to track down version conflicts with jaxws in glassfish 3.1 / 3.1.1 and java 6 / 7. You might check the exact java runtime eclipse uses to start the application and look for duplicate jars on the effective classpath.
The endorsed mechanism just provides an easy and error prone way to override the included jaxws distribution. Error prone, because your colleague will suffer from the same problem.
I havn't seen the exception org.glassfish.ha.store.api.BackingStoreException in the context of jaxws. Your version conflict could be created by another library than jaxws...
I experienced the exact same exception
org.glassfish.ha.store.api.BackingStoreException
And after ensuring my JAX-WS and JAX-B jars were all the same version the issue was still occurring.
THE FIX: I then added the ha-api.jar to the WEB-INF\lib directory and this solved the issue.
The clue here was the "ha" package in the exceptions class path as seen above. Hope this helps!

Plugin inside Sametime with Lotus Notes Classess - The Whole Story

It's gonna be a long read so Thanks for being patient :).
I have been trying to develop a plugin to be executed inside Lotus Sametime. The idea of this plugin is to extract the calendar entries for a given date and then display it in sametime. Simple isn't it, i thought so too. Apparently I was wrong and grossly misunderstood the JVM version compatibility issues. I first did an independent test in the default Java 1.6 and it worked fine, I got the entries and got the code ready to move to the Sametime Development environment.
I moved to the plugin development environment to insert my code.My first issue came, when I added the Notes.jar to the External jar list and the import lotus.domino line. The IDE told me this
The type org.omg.CORBA.UserException cannot be resolved. It is indirectly referenced from required .class files
After some googling , i referenced the ibmorbapi.jar in the project and got it running. Unfortunately for me even that didn't work out. The plugin itself failed to load and this is what i got
java.lang.NoClassDefFoundError: lotus.notes.Session
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1244)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:157)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
at com.ibm.collaboration.realtime.imhub.ImHub.loadMiniAppExtensions(ImHub.java:416)
at com.ibm.collaboration.realtime.imhub.ImHub.getMiniApps(ImHub.java:356)
at com.ibm.collaboration.realtime.imhub.workbench.ImHubWorkbenchWindowAdvisorShelf.transformMiniApps(ImHubWorkbenchWindowAdvisorShelf.java:354)
at com.ibm.collaboration.realtime.imhub.workbench.ImHubWorkbenchWindowAdvisorShelf.createWindowContents(ImHubWorkbenchWindowAdvisorShelf.java:179)
at org.eclipse.ui.internal.WorkbenchWindow.createContents(WorkbenchWindow.java:938)
at org.eclipse.jface.window.Window.create(Window.java:426)
at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:805)
at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1453)
at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1404)
at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1101)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.createAndRunWorkbench(WorkbenchAdapter.java:103)
at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.run(WorkbenchAdapter.java:85)
at com.ibm.collaboration.realtime.application.RTCApplication.run(RTCApplication.java:765)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:211)
at java.lang.reflect.Method.invoke(Method.java:272)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Since that was not gonna work. I thought why not create the NotesCalendarExtraction part into a separate jar execution file and get a xml file with the calendar entries in it and then give it to the plugin to show the entries. I know it was not the best solution but i was desperate and wanted to get this working. In anycase, the idea kinda worked well when I had hardcoded the jar file and and the path to the generated xml file. Btw I was executing the jar file using the getRuntime.exec module in java. Time came to get it running generically and unfortunately for me the exec module was not accepting spaces in its path so program files was out of question. I was not sure if this was right method but then the jar as such was not executing either for some reason. I tried putting in a bat file with the appropriate command line parameters and it generated the xml when executed in the command line but not when running from the eclipse ide for reasons known only to the IDE. I was out of options at this point and I got my hands on another plugin which did exactly the same thing with regard to getting the calendar entries. I decompiled plugin and checked out the source code and saw the code was using a class loader to do the job. A new hope got into me when i saw this code. After some googling i put together some code which did the job for me. Time came for the acid test, i put the code into the plugin env and this is what I got.
!ENTRY org.eclipse.ui 4 0 2009-09-27 22:05:55.996
!MESSAGE (org/omg/CORBA/UserException) bad major version at offset=6
!STACK 0
java.lang.UnsupportedClassVersionError: (org/omg/CORBA/UserException) bad major version at offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:246)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1028)
at java.net.URLClassLoader$4.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(AccessController.java:213)
at java.net.URLClassLoader.findClass(URLClassLoader.java:547)
at java.lang.ClassLoader.loadClass(ClassLoader.java:625)
at java.lang.ClassLoader.loadClass(ClassLoader.java:582)
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:246)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1028)
at java.net.URLClassLoader$4.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(AccessController.java:213)
at java.net.URLClassLoader.findClass(URLClassLoader.java:547)
at java.lang.ClassLoader.loadClass(ClassLoader.java:625)
at java.lang.ClassLoader.loadClass(ClassLoader.java:582)
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
at java.lang.reflect.AccessibleObject.initializeClass(Native Method)
at java.lang.reflect.Method.invoke(Method.java:248)
at com.ibm.collaboration.realtime.lotusnotes.LotusNotes.getNotesSession(LotusNotes.java:179)
at com.ibm.notes.sametime.calendar.hack.SpeakUpMiniApp.createControl(SpeakUpMiniApp.java:58)
at com.ibm.collaboration.realtime.miniapp.MiniAppViewPart.createPartControl(MiniAppViewPart.java:41)
at com.ibm.rcp.ui.internal.shelf.ShelfViewReference.createPartHelper(ShelfViewReference.java:330)
at com.ibm.rcp.ui.internal.shelf.ShelfViewReference.createPart(ShelfViewReference.java:201)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at com.ibm.rcp.ui.shelf.ShelfPage.activatePart(ShelfPage.java:1168)
at com.ibm.rcp.ui.shelf.ShelfPage.access$10(ShelfPage.java:1159)
at com.ibm.rcp.ui.shelf.ShelfPage$7.handleEvent(ShelfPage.java:1312)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706)
at com.ibm.rcp.swt.swidgets.SViewForm.toggleMaximize(SViewForm.java:1501)
at com.ibm.rcp.swt.swidgets.SViewStack.expand(SViewStack.java:596)
at com.ibm.rcp.swt.swidgets.SViewStack.toggleMaximize(SViewStack.java:526)
at com.ibm.rcp.swt.swidgets.SViewStack$5.handleEvent(SViewStack.java:312)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706)
at com.ibm.rcp.swt.swidgets.SViewForm.onMouseUpMaximize(SViewForm.java:1437)
at com.ibm.rcp.swt.swidgets.SViewForm.onMouseUp(SViewForm.java:1127)
at com.ibm.rcp.swt.swidgets.SViewForm$4.handleEvent(SViewForm.java:421)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.createAndRunWorkbench(WorkbenchAdapter.java:103)
at com.ibm.collaboration.realtime.ui.WorkbenchAdapter.run(WorkbenchAdapter.java:85)
at com.ibm.collaboration.realtime.application.RTCApplication.run(RTCApplication.java:765)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:211)
at java.lang.reflect.Method.invoke(Method.java:272)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
It's really frustrating again to the version error. The sametime plugin dev environment runs on J9 JVM and the for some reason that is not enough for notes.jar ibmorbapi.jar i guess. Atleast that is what my assumption is about the error.
I would appreciate any help on this from you guys. "org/omg/CORBA/UserException" seems to be crux of the issue and I am simply not able to get over it. I can get the external jar execution working in some complex way but I don't want to do it as i feel its the best way to get calendar entries from notes. I am sure it has to be reasonably simple and any help on this would be appreciated.
There are two jars that are related to talking to a Notes application.
Notes.jar - This is a JNI wrapper for LSXBE classes. In order for it to work correctly you will need Lotus Notes installed on the machine and the main directory on the system PATH.
NCSO.jar - This is for making DIIOP connections to a Domino server. This does not require Lotus Notes to be installed. It does require a Domino server you can connect to which has DIIOP enabled on it.
It is unclear if you have Notes installed?
The jars are also specific to certain JVM versions.
Java 6 - Notes 8.5.1
Java 5 - Notes 8.x
Java 1.4.2 - Notes 7.x
Java 1.3 - Notes 6.x
"bad major version at offset" means your are running the wrong jar for the JVM (eg. 851 jar on 1.4.2).
To rule out any configuration issues first I recommend creating just a simple java application which makes a connection to Notes/Domino. Once that works then you know your paths/jars are all set up correctly.
Looks like CORBA classes are compiled for a newer JDK. You need to find an older version of the JAR, or, alternatively, get the sources and compile them under your JDK (J9?). From what I see from a brief Google search, J9 is either 1.4 or even 1.3 compatible.
Also, make sure that all the code you compile yourself has the same target Java version, i.e. 1.4 (1.3?) in this case.

Categories