Error occurred when Create Enterprisejavabean

I've installed every update I can find for ECLIPSE but I cannot for the life of me get it to finish creating the enterprisejavabean. These are the error details.

org.eclipse.core.runtime.CoreException: Extended Operation failure: org.eclipse.jst.j2ee.ejb.annotation.internal.operations.AddSessionBeanOperation

at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard.performFinish(DataModelWizard.java:182)

at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:680)

at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)

at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1496)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1505)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3312)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2941)

at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)

at org.eclipse.jface.window.Window.open(Window.java:796)

at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:181)

at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)

at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)

at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)

at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1496)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1505)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3312)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2941)

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 org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)

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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

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)

org.eclipse.core.runtime.CoreException[0]: java.lang.UnsupportedClassVersionError: org/eclipse/jst/j2ee/ejb/gmf/templates/session/TypeCommentGenerator (Unsupported major.minor version 49.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:539)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)

at java.net.URLClassLoader.access$100(URLClassLoader.java:55)

at java.net.URLClassLoader$1.run(URLClassLoader.java:194)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:187)

at java.lang.ClassLoader.loadClass(ClassLoader.java:289)

at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

at org.eclipse.jst.j2ee.internal.project.WTPJETEmitter.loadClass(WTPJETEmitter.java:346)

at org.eclipse.jst.j2ee.internal.project.WTPJETEmitter.initialize(WTPJETEmitter.java:228)

at org.eclipse.jst.j2ee.internal.project.WTPJETEmitter.<init>(WTPJETEmitter.java:108)

at org.eclipse.jst.j2ee.ejb.annotations.internal.emitter.EjbEmitter.createJetEmitter(EjbEmitter.java:72)

at org.eclipse.jst.j2ee.ejb.annotations.internal.emitter.EjbEmitter.generate(EjbEmitter.java:89)

at org.eclipse.jst.j2ee.ejb.annotations.internal.emitter.SessionEjbEmitter.emitTypeComment(SessionEjbEmitter.java:30)

at org.eclipse.jst.j2ee.ejb.annotations.internal.xdoclet.provider.XDocletAnnotationProvider.generateSession(XDocletAnnotationProvider.java:102)

at org.eclipse.jst.j2ee.ejb.annotation.internal.operations.AddSessionBeanOperation.execute(AddSessionBeanOperation.java:39)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:376)

at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:401)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:352)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:242)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:214)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)

at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:202)

at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1$CatchThrowableRunnableWithProgress.run(DataModelWizard.java:211)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

[6934 byte] By [mojvaformega] at [2007-11-27 4:55:37]
# 1

In general, the "Unsupported major.minor version 49.0" is due to trying to use a class compiled as Java 5.0 in a 1.4 run-time. Took me ages to work out what was going on when I had the same problem with the Eclipse EJB wizard, because the offending project was hidden.

Why does this happen?

When you use Eclipse's bean-creation wizard, it generates some JET Engine classes in a project called .JETEmitters, which it then uses to do the actual bean code generation. This project is a normal Eclipse project, but you can't usually see it.

I don't know the full recreation steps, but it'll be something like this:

The Eclipse workbench runs in a JRE. The version of this JRE will depend on how you've set it up. I think it's down to your JAVA_HOME setting or which java executable is in your system path. Mine was C:\j2sdk1.4.2_07, so Eclipse was running in 1.4.2_07.

The compilation options for the .JETEmitters project depend on the settings for that project. If that project doesn't exist when the wizard is started, Eclipse automatically creates the project. At this point, the project's JDK is the default for the Eclipse workbench, which in my case was JDK 1.5.0 (quite why I had it set up like this was another story, but that's the way it was).

So when you run the bean-creation wizard, it creates some source files in .JETEmitters, compiles them according to that project's settings, and tries to run them. The end result in my case was that Eclipse tries to run the 5.0 .JETEmitters classes in its 1.4.2 JRE, resulting in the error you reported.

The error could occur for any generated JET classes, including:

org.eclipse.gmf.templates.messageDriven.FieldGenerator

org.eclipse.gmf.templates.messageDriven.TypeCommentGenerator

org.eclipse.gmf.templates.messageDriven.TypeStubGenerator

org.eclipse.jst.j2ee.ejb.gmf.templates.messageDriven.MethodGenerator

org.eclipse.jst.j2ee.ejb.gmf.templates.session.MethodGenerator

org.eclipse.jst.j2ee.ejb.gmf.templates.session.TypeCommentGenerator

org.eclipse.jst.j2ee.ejb.gmf.templates.session.TypeStubGenerator

To fix it:

I didn't try this one, but I think it would work in principle: Update your JAVA_HOME to point to a 1.5 JDK and restart Eclipse. Then it'll be able to run the 5.0-compiled classes. If this doesn't work then look up how to change the JRE version in which the workbench runs (I can't be bothered just now!)

Alternatively (and this is how I did it because I wanted to keep my JAVA_HOME as a 1.4.2 ), change the compiler settings on the .JETEmitters project:

1) make .JETEmitters visible: In Eclipse's navigator, there's a downward-pointing triangle at the top-right of the navigator folder list. Click this and select "Filters..." from the menu. Deselect ".JETEmitters" and ".*" and click OK.

2) Right-click the .JETEmitters project in navigator, and select properties.

3) Select Java Compiler, check "Enable project specific settings" and set compiler compliance level to 1.4. Click OK (it may rebuild the project at this point).

4) You can now reset the filters to your preferred values (reverse the changes in step 1).

Hopefully, the bean-generators will work now. Did for me.

MikeLauriea at 2007-7-12 10:10:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...