Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7555245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:33:23+00:00 2026-05-30T11:33:23+00:00

I’m trying to unit test a simple EJBModule project under NetBeans 7.1, but I

  • 0

I’m trying to unit test a simple EJBModule project under NetBeans 7.1, but I am receiving one warning and an initialization error. I’m using GlassFish version 3.1.1. I’m hoping someone is familiar with this type of issue and can give me some suggestions on how to resolve it.

In project one we have a remote interface like this:

@Remote
public interface CredentialEJBRemote {

//Stuff     

}

Then in a second project we are implementing the interface like this:

@Stateless
@LocalBean
public class CredentialEJB implements CredentialEJBRemote {

//@Override stuff 

}

And finally in the unit test I am doing this:

private static EJBContainer ec = EJBContainer.createEJBContainer();
private static Context ctx = ec.getContext();
CredentialEJBRemote instance = (CredentialEJBRemote)ctx.lookup("java:global/classes/CredentialEJB");
//Do stuff with instance

When I run the unit test I receive the warning and the error.

The warning is:

WARNING: multiple versions of ant detected in path for junit
jar:file:/C:/Program%20Files/NetBeans%207.1/java/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
and  jar:file:/C:/Program%20Files/glassfish3.1.1/glassfish/modules/ant.jar!/org/apache/tools/ant/Project.class

Followed by this error on the test case:

Testcase: initializationError(trefliq.persistence.CredentialEJBTest):   Caused an ERROR
Absent Code attribute in method that is not native or abstract in class file javax/ejb/embeddable/EJBContainer
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ejb/embeddable/EJBContainer
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(   
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791) ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
    at java.lang.Class.getDeclaredFields(Class.java:1760)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

Any ideas what may be causing this?

Thanks so much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:33:25+00:00Added an answer on May 30, 2026 at 11:33 am

    This error turned out to be caused by having Netbean’s javaee-api-6.0.jar on the classpath. This jar does not contain the method bodies, so the elusive and seemingly rare “Absent code” error was being thrown. The Ant.jar warning was resolved by renaming the Ant.jar in GlassFish’s modules folder. It was conflicting Netbean’s Ant.jar because they are two different versions of Ant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.