java.lang.UnsupportedClassVersionError: Bad version number in .class file

java.lang.UnsupportedClassVersionError: Bad version number in .class file

book

Article ID: KB0085274

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Abstract:
============
java.lang.UnsupportedClassVersionError: Bad version number in .class file

Description:
============
When loading palette plugin jar, if the jar not complied by the same version with the java BW uses, exception is shown:
Exception in DesignerResourceStore.loadResourceFrom() uri:Processes/Inbound/ParseFIXMessage.process using unknown file type resource.
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at com.tibco.util.ResourceManager.getClass(ResourceManager.java:700)
    at com.tibco.util.ResourceManager.getClass(ResourceManager.java:647)
    at com.tibco.ae.designerapi.AEResourceUtils.getClassForType(AEResourceUtils.java:785)
    at com.tibco.ae.designerapi.AEResourceUtils.createResourceOfType(AEResourceUtils.java:827)
    at com.tibco.ae.designerapi.AEResourceUtils.createResourceOfType(AEResourceUtils.java:793)
    at com.tibco.ae.tools.palettes.processpalette.ProcessDefinition.createChildrenFromModel(ProcessDefinition.java:1533)
    at com.tibco.ae.tools.palettes.processpalette.ProcessDefinition.setModel(ProcessDefinition.java:1342)
    at com.tibco.ae.tools.palettes.processpalette.ProcessDefinition.<init>(ProcessDefinition.java:354)
    at com.tibco.ae.tools.palettes.processpalette.ProcessObjectFactory.readFromStream(ProcessObjectFactory.java:101)
    at com.tibco.pe.load.ProcessModelXiNodeObjectFactory.newInstance(ProcessModelXiNodeObjectFactory.java:118)
    at com.tibco.objectrepo.object.ObjectProvider.a(ObjectProvider.java:522)
    at com.tibco.objectrepo.object.ObjectProvider.getObject(ObjectProvider.java:312)
    at com.tibco.ae.designerapi.AEResourceOperations.resolveResourceReferenceFor(AEResourceOperations.java:198)
    at com.tibco.ae.designerapi.AEResourceOperations.resolveResourceReferenceFor(AEResourceOperations.java:305)
    at com.tibco.ae.tools.designer.AEWindow.initializeDocument(AEWindow.java:336)
    at com.tibco.ae.tools.designer.AEWindow.initialize(AEWindow.java:240)
    at com.tibco.ae.tools.designer.AEWindow.<init>(AEWindow.java:70)
    at com.tibco.ae.tools.designer.AEDocument.initRootFolder(AEDocument.java:272)
    at com.tibco.ae.tools.designer.AEDocument.<init>(AEDocument.java:130)
    at com.tibco.ae.tools.designer.AEApplication.openDocument(AEApplication.java:1791)
    at com.tibco.ae.tools.designer.AEApplication.reopenDocument(AEApplication.java:2255)
    at com.tibco.ae.tools.designer.actions.ReopenProjectAction.performAction(ReopenProjectAction.java:95)
    at com.tibco.ae.designerapi.actions.GenericDesignerAction.actionPerformed(GenericDesignerAction.java:300)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5517)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5282)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3984)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1791)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Symptoms:
============
Sometimes this type of error can be accompanied with below exception:
initialing provider for type: service.definition failed. - extension: [Ljava.lang.String;@4fdf11
com.tibco.objectrepo.NotAllowedException: Can not register 2 factories for the same fileType/ObjectType combination: serviceagent, com.tibco.ae.designerapi.AEResource
    at com.tibco.objectrepo.object.ObjectProvider.registerFactory(ObjectProvider.java:2590)
    at com.tibco.ae.designerapi.AEResourceUtils.initializeProvider(AEResourceUtils.java:534)
    at com.tibco.ae.tools.designer.AEApplication.getObjectProvider(AEApplication.java:138)
    at com.tibco.ae.tools.designer.AEApplication.startup(AEApplication.java:1052)
    at com.tibco.ae.tools.designer.DesignerAppStarter.run(AEConsole.java:342)
    at com.tibco.ae.tools.designer.AEConsole.startDesigner(AEConsole.java:98)
    at com.tibco.ae.tools.designer.AEConsole.main(AEConsole.java:41)
com.tibco.objectrepo.NotAllowedException: Can not register 2 factories for the same fileType/ObjectType combination: serviceagent, com.tibco.ae.designerapi.AEResource
    at com.tibco.objectrepo.object.ObjectProvider.registerFactory(ObjectProvider.java:2590)
    at com.tibco.ae.designerapi.AEResourceUtils.initializeProvider(AEResourceUtils.java:534)
    at com.tibco.ae.tools.designer.AEApplication.getObjectProvider(AEApplication.java:138)
    at com.tibco.ae.tools.designer.AEApplication.startup(AEApplication.java:1052)
    at com.tibco.ae.tools.designer.DesignerAppStarter.run(AEConsole.java:342)
    at com.tibco.ae.tools.designer.AEConsole.startDesigner(AEConsole.java:98)
    at com.tibco.ae.tools.designer.AEConsole.main(AEConsole.java:41)
DAVstore: Setting connection timeout to 40000 milliseconds.

Environment:
============

Cause:
============
The jar is not complied by the same Java version which the Java BW uses.

Resolution:
============
Compile the classes with the same Java version as BW uses and build the package with the same jar.exe version as BW uses.

Issue/Introduction

java.lang.UnsupportedClassVersionError: Bad version number in .class file