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.

Bug 193208 - com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to javax.lang.model.element.TypeElement
Summary: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to javax.lang.model...
Status: RESOLVED DUPLICATE of bug 192543
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-10 06:48 UTC by Chiana
Modified: 2010-12-10 11:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Base class (3.46 KB, application/octet-stream)
2010-12-10 06:53 UTC, Chiana
Details
Interface for base class (588 bytes, application/octet-stream)
2010-12-10 06:53 UTC, Chiana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2010-12-10 06:48:27 UTC
[ BUILD # : 20101208 ]
[ JDK VERSION : 1.6.22 ]

Been getting this latley; Previous reference and similarities found  : 114417,
185775, 187898
init:
UtilBib.init:
UtilBib.deps-jar:
Created dir: P:\UtilLib\UtilBib\build
Updating property file: P:\UtilLib\UtilBib\build\built-jar.properties
Created dir: P:\UtilLib\UtilBib\build\classes
Created dir: P:\UtilLib\UtilBib\build\empty
Compiling 12 source files to P:\UtilLib\UtilBib\build\classes
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
UtilBib.compile:
Created dir: P:\UtilLib\UtilBib\dist
Building jar: P:\UtilLib\UtilBib\dist\UtilBib.jar
UtilBib.jar:
utils.init:
utils.deps-jar:
Created dir: P:\reciete2\utils\build
Updating property file: P:\reciete2\utils\build\built-jar.properties
UtilBib.init:
UtilBib.deps-jar:
Updating property file: P:\reciete2\utils\build\built-jar.properties
UtilBib.compile:
UtilBib.jar:
Created dir: P:\reciete2\utils\build\classes
Created dir: P:\reciete2\utils\build\empty
Compiling 9 source files to P:\reciete2\utils\build\classes
Copied 1 empty directory to 1 empty directory under
P:\reciete2\utils\build\classes
utils.compile:
Created dir: P:\reciete2\utils\dist
Building jar: P:\reciete2\utils\dist\utils.jar
utils.jar:
deps-jar:
Created dir: P:\reciete2\reciete2-ejb\build\classes
Copying 3 files to P:\reciete2\reciete2-ejb\build\classes\META-INF
Created dir: P:\reciete2\reciete2-ejb\build\empty
Created dir: P:\reciete2\reciete2-ejb\build\generated-sources\ap-source-output
Compiling 25 source files to P:\reciete2\reciete2-ejb\build\classes
Note: Creating static metadata factory ...
Note: Building metadata class for round element: ent.EntityClasses.Artreg
Note: Building metadata class for round element: ent.EntityClasses.Kund
Note: Building metadata class for round element: ent.EntityClasses.Kvitton
Note: Building metadata class for round element: ent.EntityClasses.Service
Note: Building metadata class for round element: ent.EntityClasses.Servicerad
Note: Building metadata class for round element: ent.EntityClasses.Storage
Note: Building metadata class for round element: ent.Persistence
Note: Building metadata class for round element: ent.PersistentUtil
Note: Building metadata class for round element:
ent.exception.EntityNotInsertedException
Note: Building metadata class for round element: ent.manager.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(Ca
nonicalModelProcessor.java:400)
        at
com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacPro
cessingEnvironment.java:625)
        at
com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(Ja
vacProcessingEnvironment.java:554)
        at
com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProc
essingEnvironment.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.jav
a: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.GeneratedMethodAccessor349.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a: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.GeneratedMethodAccessor349.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a: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.GeneratedMethodAccessor349.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a: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.getMetadataC
lass(MetadataMirrorFactory.java:116)
        at
org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.getMetadataC
lass(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.getMetadataC
lass(MetadataMirrorFactory.java:125)
        at
org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.getMetadataC
lass(MetadataMirrorFactory.java:178)
        at
org.eclipse.persistence.internal.jpa.modelgen.visitors.ElementVisitor.visitType(
ElementVisitor.java:199)
        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.getMetadataC
lass(MetadataMirrorFactory.java:125)
        at
org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.setEnvironme
nts(MetadataMirrorFactory.java:266)
        at
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(Ca
nonicalModelProcessor.java:361)
        ... 46 more
P:\reciete2\reciete2-ejb\nbproject\build-impl.xml:502: The following error
occurred while executing this line:
P:\reciete2\reciete2-ejb\nbproject\build-impl.xml:197: Compile failed; see the
compiler error output for details.
BUILD FAILED (total time: 1 second)
Comment 1 Chiana 2010-12-10 06:53:01 UTC
Created attachment 103908 [details]
Base class
Comment 2 Chiana 2010-12-10 06:53:40 UTC
Created attachment 103909 [details]
Interface for base class
Comment 3 Chiana 2010-12-10 06:56:09 UTC
Think this is an annotation processor problem since it does not occur if you "hand compile" the supplied files. If you need more I can upload the entire EJB project, it is not that big at all, only about 30 classes (yet).
Comment 4 Sergey Petrov 2010-12-10 11:48:00 UTC

*** This bug has been marked as a duplicate of bug 192543 ***