dev@glassfish.java.net

Re: [v3] runtime errors during deployment - Class cast exception

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 22 Feb 2008 01:14:20 +0530

Sahoo wrote:
>
>
> Amy Roh wrote:
>> Jerome Dochez wrote:
>>> seems like you have a bad build, somehow your webtier deployer is
>>> not found by HK2...
>>> do you have modules/web/webtier-10.0-SNAPSHOT.jar file ?
>> Yes. Not sure why I had a bad build because I tried fresh svn
>> checkout, mvn clean, (even remove my local .m2), and mvn -U install -
>> shouldn't that ensure I have the latest build?
>>
>> I no longer have this problem though.
>>
> I am facing the same issue. I updated both my HK2 and v3 workspace,
> rebuilt my HK2 workspace, removed all org.glassfish.* and javax.*
> artifacts from my local maven repo before running 'mvn clean && mvn
> install'. Now when I deploy a simple war, I get the same error that
> Amy reported.
>
> I don't think it is related to build. Seems to be caused by some
> change to SecurityDeployer.java and ApplicationLifecycle.java.
>
> Thanks,
> Sahoo
>
I was wrong. It has indeed something to do with build. hk2-maven-plugin
was not generating META-INF/inhabitants file for my
webtier-$version.jar. SO, WebSniffer was never being picked by the
runtime. I recreated webtier...jar and now again it is working.
Now I know what's happening. Look at the log below. During
hk2:hk2-compile goal execution of webtier, it actually encountered a
fatal error, but instead of causing a build failure, it went ahead and
produced an *incomplete* webtier-10.0-SNAPSHOT.jar. What a waste of
time. I would never have come to this conclusion, had I not accidentally
seen the output. Some build system this is...

[INFO] [hk2:hk2-compile]
[INFO] Compiling 660 source files to
/space/ss141213/WS/gf/v3/web/webtier/target/classes


The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
        at com.sun.tools.javac.code.Scope.<init>(Scope.java:87)
        at
com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:1268)
        at
com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:1380)
        at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1586)
        at
com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1535)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
        at
com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:612)
        at
com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:550)
        at
com.sun.tools.javac.code.Types$AsSuperFcn.visitClassType(Types.java:1440)
        at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:482)
        at
com.sun.tools.javac.code.Types$AsSuperFcn.asSuper(Types.java:1417)
        at
com.sun.tools.javac.code.Types$AsSuperFcn.visitClassType(Types.java:1434)
        at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:482)
        at
com.sun.tools.javac.code.Types$AsSuperFcn.asSuper(Types.java:1417)
        at com.sun.tools.javac.code.Types.asSuper(Types.java:1407)
        at
com.sun.tools.javac.code.Types$IsSubTypeFcn.visitClassType(Types.java:429)
        at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:482)
        at
com.sun.tools.javac.code.Types$IsSubTypeFcn.isSubType(Types.java:353)
        at com.sun.tools.javac.code.Types.isSubType(Types.java:331)
        at com.sun.tools.javac.code.Types.isSubTypeUnchecked(Types.java:311)
        at com.sun.tools.javac.code.Types.isConvertible(Types.java:278)
        at com.sun.tools.javac.code.Types.isAssignable(Types.java:1630)
        at com.sun.tools.javac.comp.Check.checkType(Check.java:325)
        at
com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:122)
        at
com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:705)
        at
com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:39)
        at
com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:686)
        at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:94)
        at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:86)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:477)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:433)
        at
com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:445)
    
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [hk2:package]
[INFO] Building jar:
/space/ss141213/WS/gf/v3/web/webtier/target/webtier-10.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing
/space/ss141213/WS/gf/v3/web/webtier/target/webtier-10.0-SNAPSHOT.jar to
/space/ss141213/maven2rep/org/glassfish/web/webtier/10.0-SNAPSHOT/webtier-10.0-SNAPSHOT.jar


Thanks,
Sahoo