NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Awful error with CDI and hot deployment "Absent Code attribute in method that is not native or abstract in class file <error>"

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
cayhorstmann



Joined: 13 Nov 2009
Posts: 5

PostPosted: Tue Jun 22, 2010 11:37 pm    Post subject: Awful error with CDI and hot deployment "Absent Code attribute in method that is not native or abstract in class file <error>" Reply with quote

am trying to put together a lab for a summer class where I foolishly
agreed to use NetBeans 6.9, Glassfish 3.0.1 and CDI. I am getting the
following error:
java.lang.ClassFormatError: Absent Code attribute in method that is
not native or abstract in class file com/horstmann/qq/beans/<error>
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:920)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)
at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:192)
at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:102)
at org.glassfish.weld.DeploymentImpl.<init>(DeploymentImpl.java:118)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:315)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:99)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
...

It effectively kills the app server. Deploying anything else doesn't even show any messages in the log.

This is with hot deployment inside NetBeans. When I deploy the WAR
manually, the problem doesn't arise. Unfortunately, that's not an
option for my lab.

I looked into the build/web/WEB-INF/classes directories, and sure enough, there was a file <error>.class.

I tried wiping the file and redeploying, and it came back. Who makes this? Is there anything I can do to troubleshoot it?

Thanks,

Cay
Back to top
Ludo
Posted via mailing list.





PostPosted: Wed Jun 23, 2010 1:10 am    Post subject: Re: Awful error with CDI and hot deployment "Absent Code attribute in method that is not native or abstract in class file <error>" Reply with quote

On 6/22/10 4:38 PM, cayhorstmann wrote:
Quote:
am trying to put together a lab for a summer class where I foolishly
agreed to use NetBeans 6.9, Glassfish 3.0.1 and CDI. I am getting the
following error:
java.lang.ClassFormatError: Absent Code attribute in method that is
not native or abstract in class file com/horstmann/qq/beans/<error>
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:920)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)
at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:192)
at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:102)
at org.glassfish.weld.DeploymentImpl.<init>(DeploymentImpl.java:118)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:315)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:99)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
...

It effectively kills the app server. Deploying anything else doesn't even show any messages in the log.

This is with hot deployment inside NetBeans. When I deploy the WAR
manually, the problem doesn't arise. Unfortunately, that's not an
option for my lab.

I looked into the build/web/WEB-INF/classes directories, and sure enough, there was a file<error>.class.

I tried wiping the file and redeploying, and it came back. Who makes this? Is there anything I can do to troubleshoot it?

Thanks,

Cay





I guess you are using Maven, and for some reasons the stripped jar for
the Java EE 6 APIs.
This jar does not have any byte code for the implementation, making sure
you are not trying to *run* classes without having a real compliant
application server implementing these apis...
See old blog
http://weblogs.java.net/blog/ludo/archive/2007/01/java_ee_5_apis.html
Same for EE 6 maven apis.
Ludo
Back to top
cayhorstmann



Joined: 13 Nov 2009
Posts: 5

PostPosted: Wed Jun 23, 2010 12:09 pm    Post subject: Reply with quote

No, I am not using Maven. I pointed NetBeans to a directory with src and web subdirectories and it generated the usual Ant script.

For some reason, NetBeans sometimes makes a file <error>.class.
Back to top
sivakumart



Joined: 23 Jun 2010
Posts: 1

PostPosted: Wed Jun 23, 2010 2:26 pm    Post subject: Reply with quote

Do you have a set of steps to reproduce the issue? From your description it appears to happen only during hot-deployment from within NetBeans? Could you confirm this? Would you be able to file a NetBeans issue around this so that we can track this [you could copy me (sivakumar_t)]?

Thanks
--Siva.
Back to top
cayhorstmann



Joined: 13 Nov 2009
Posts: 5

PostPosted: Wed Jun 23, 2010 6:24 pm    Post subject: Reply with quote

I'll try to reproduce it, but it seems a bit elusive. If I succeed, I'll file a bug report.

I am still curious who produces a file named <error>.class. That really should never happen. And I also wonder why the file never got deleted. It was quite a bit older than the other class files in the hot deploy directory.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo