This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using the wizard to create a session facade results in the project failing to compile. This worked in 6.9 and it looks like the generated source code is the same. Also, it seems that if you create the EJB in 6.9 and then open the project in 7.0 and try to build, the build succeeds. To reproduce: 1. Create EJB project, target GF 3.0. 2. Create simple entity class in EJB. 3. Use the Session Beans from Entity Classes wizard for the entity. 4. Build project. Product Version: NetBeans IDE Dev (Build 201011260001) Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM 17.1-b03-307 System: Mac OS X version 10.5.8 running on x86_64; MacRoman; en_US (nb) Userdir: /Applications/NetBeans/userdirs/7.0-201001126 The output displays the following: Compiling 3 source files to /Users/nb/Documents/nbtemp-project/70-temp2/EJBModule1/build/classes Note: Creating static metadata factory ... Note: Building metadata class for round element: ejb.AbstractFacade error: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to javax.lang.model.element.TypeElement An annotation processor threw an uncaught exception. Consult the following stack trace for details. java.lang.RuntimeException: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to javax.lang.model.element.TypeElement at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:400) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:625) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:554) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:699) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) at com.sun.tools.javac.main.Main.compile(Main.java:353) at com.sun.tools.javac.main.Main.compile(Main.java:279) at com.sun.tools.javac.main.Main.compile(Main.java:270) at com.sun.tools.javac.Main.compile(Main.java:69) 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:597) at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56) at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1097) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906) at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:136) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor383.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor383.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor383.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397) at org.apache.tools.ant.Project.executeTarget(Project.java:1366) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1249) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154) Caused by: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to javax.lang.model.element.TypeElement at org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.getMetadataClass(MetadataMirrorFactory.java:116) at org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.getMetadataClass(MetadataMirrorFactory.java:178) at org.eclipse.persistence.internal.jpa.modelgen.visitors.TypeVisitor.visitDeclared(TypeVisitor.java:77) at org.eclipse.persistence.internal.jpa.modelgen.visitors.TypeVisitor.visitDeclared(TypeVisitor.java:39) at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:696) at org.eclipse.persistence.internal.jpa.modelgen.visitors.ElementVisitor.visitType(ElementVisitor.java:214) at org.eclipse.persistence.internal.jpa.modelgen.visitors.ElementVisitor.visitType(ElementVisitor.java:50) at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:832) at org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.getMetadataClass(MetadataMirrorFactory.java:125) at org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.setEnvironments(MetadataMirrorFactory.java:266) at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:361) ... 46 more /Users/nb/Documents/nbtemp-project/70-temp2/EJBModule1/nbproject/build-impl.xml:480: The following error occurred while executing this line: /Users/nb/Documents/nbtemp-project/70-temp2/EJBModule1/nbproject/build-impl.xml:197: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 0 seconds)
Looks like known issue, already resolved on eclipselink side, will be resolved in nb after update eclipselink to milestone nexte to M5. As a workaround if no annotation processor features is used, it's possible to remove eclipselink-modelgen library from project processor path libraries.
It's new similar issue, and likely need to be resolved on eclipselink side too.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=331343
(In reply to comment #3) > https://bugs.eclipse.org/bugs/show_bug.cgi?id=331343 How it this Eclipse issue related to this problem? 331343 was about NPE but this one is ClassCastException, no?
yes, looks strange, may be Guy decide it's related, need to test daly eclipselink
Created attachment 103465 [details] Exception for the latest daily build of EL The relationship is: when you try this scenario with the latest daily build of EclipseLink (as opposed to the M4 build that we bundle), you will not get the ClassCastException, but you will get the attached NPE.
verified with eclipselink-2.2.0.v20101201-r8590 and see neither classcase nor nullpointer, build is successful.
*** Bug 193208 has been marked as a duplicate of this bug. ***
for dev/beta etc it sould be fixed http://hg.netbeans.org/web-main/rev/e9e05f2b5559 will test after build. for release it should be updated.
Integrated into 'main-golden', will be available in build *201012160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/e9e05f2b5559 User: Sergey B. Petrov <sj-nb@netbeans.org> Log: fix #192543 update to 2.2.0 m6
fixed