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 6855453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:45:37+00:00 2026-05-27T01:45:37+00:00

I’m trying to call a simple stateless session bean from a Java SE (Simple

  • 0

I’m trying to call a simple stateless session bean from a Java SE (Simple class).

Here’s my bean

import javax.ejb.Stateless;

/**
 *
 * @author MMRUser
 */
@Stateless
public class CapitalBean implements CapitalBeanRemote {

    public String greetingsEjb(String name) {
        return "Hello " + name;
    }
} 

Remote interface

import javax.ejb.Remote;

/**
 *
 * @author MMRUser
 */
@Remote
public interface CapitalBeanRemote {

    public String greetingsEjb(String name);
}

From my client side I used stand-alone java class to call the session bean using JNDI as follows

import ejb.CapitalBeanRemote;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author MMRUser
 */
public class CallEjbClass {

    public static void main(String[] args) {
        try {
            Context context = new InitialContext();
            CapitalBeanRemote bean = (CapitalBeanRemote)
            context.lookup("java:global/CapitalApplication/CapitalBean");
            context.close();
        } catch (NamingException ex) {
            ex.printStackTrace();
        }


    }
} 

Things are pretty straight forward, but when I ran this application I’m getting an exception saying

avax.naming.NameNotFoundException: CapitalBean not found  

I’m using Glassfish 3.1.1 as my application server and Netbeans 7.0.1 as my IDE. Already added these jar files to my classpath:

CapitalApplication-ejb.jar

appserv-rt.jar

gf-client.jar

I also tried different JNDI naming conventions like:

java:global/CapitalApplication!ejb.CapitalBean

but nothing seems to work here.

Here’s the full stack trace

run:
Nov 20, 2011 6:14:58 PM com.sun.enterprise.iiop.security.SecurityMechanismSelector postConstruct
SEVERE: IIOP1005: An exception has occured in the ejb security initialization.
org.jvnet.hk2.component.ComponentException: injection failed on org.glassfish.api.invocation.InvocationManagerImpl.invHandlers with class [Lorg.glassfish.api.invocation.ComponentInvocationHandler;
    at org.jvnet.hk2.component.InjectionManager.error_injectionException(InjectionManager.java:277)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:159)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat.getByContract(Habitat.java:1042)
    at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:777)
    at com.sun.enterprise.iiop.security.SecurityMechanismSelector.postConstruct(SecurityMechanismSelector.java:166)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1048)
    at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1029)
    at com.sun.hk2.component.InjectInjectionResolver.getComponentInjectValue(InjectInjectionResolver.java:159)
    at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:90)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:141)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1048)
    at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1029)
    at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:779)
    at com.sun.enterprise.iiop.security.Lookups._getSecurityContextUtil(Lookups.java:97)
    at com.sun.enterprise.iiop.security.Lookups.getSecurityContextUtil(Lookups.java:92)
    at com.sun.enterprise.iiop.security.SecClientRequestInterceptor.<init>(SecClientRequestInterceptor.java:119)
    at com.sun.enterprise.security.appclient.AppclientIIOPInterceptorFactory.getClientInterceptorInstance(AppclientIIOPInterceptorFactory.java:127)
    at com.sun.enterprise.security.appclient.AppclientIIOPInterceptorFactory.createClientRequestInterceptor(AppclientIIOPInterceptorFactory.java:96)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBInitializer.post_init(GlassFishORBInitializer.java:132)
    at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.postInitORBInitializers(PIHandlerImpl.java:915)
    at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.initialize(PIHandlerImpl.java:265)
    at com.sun.corba.ee.impl.orb.ORBImpl.postInit(ORBImpl.java:643)
    at com.sun.corba.ee.impl.orb.ORBImpl.set_parameters(ORBImpl.java:704)
    at com.sun.corba.ee.impl.orb.ORBImpl.setParameters(ORBImpl.java:691)
    at com.sun.corba.ee.spi.osgi.ORBFactory.initialize(ORBFactory.java:107)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.initORB(GlassFishORBManager.java:581)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.getORB(GlassFishORBManager.java:263)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBFactoryImpl.createORB(GlassFishORBFactoryImpl.java:93)
    at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:152)
    at com.sun.enterprise.naming.impl.SerialContext.getORB(SerialContext.java:365)
    at com.sun.enterprise.naming.impl.SerialContext.getProviderCacheKey(SerialContext.java:372)
    at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:402)
    at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:347)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:504)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at firstjavaapp.CallEjbClass.main(CallEjbClass.java:21)
Caused by: org.jvnet.hk2.component.ComponentException: Failed to create class com.sun.enterprise.resource.pool.PoolManagerImpl
    at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:71)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:80)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
    at java.util.AbstractList$Itr.next(AbstractList.java:358)
    at java.util.AbstractCollection.toArray(AbstractCollection.java:188)
    at com.sun.hk2.component.InjectInjectionResolver.getArrayInjectValue(InjectInjectionResolver.java:113)
    at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:81)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:141)
    ... 55 more
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(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.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
    at java.lang.Class.getConstructor0(Class.java:2714)
    at java.lang.Class.newInstance0(Class.java:343)
    at java.lang.Class.newInstance(Class.java:325)
    at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:65)
    ... 65 more

javax.naming.NamingException: Lookup failed for 'java:global/CapitalApplication/CapitalBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NameNotFoundException: CapitalBean not found]
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at firstjavaapp.CallEjbClass.main(CallEjbClass.java:21)
Caused by: javax.naming.NameNotFoundException: CapitalBean not found
    at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:248)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:215)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:219)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:219)
    at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:77)
    at com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:144)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:174)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:528)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:199)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
BUILD SUCCESSFUL (total time: 3 seconds)

UPDATE

Tried changing the JNDI naming convention to this:

java:global/CapitalApplication/CapitalApplication-ejb/CapitalBean!ejb.CapitalBeanRemote

and now I’m getting a different exception:

run:
Nov 20, 2011 7:08:52 PM com.sun.enterprise.iiop.security.SecurityMechanismSelector postConstruct
SEVERE: IIOP1005: An exception has occured in the ejb security initialization.
org.jvnet.hk2.component.ComponentException: injection failed on org.glassfish.api.invocation.InvocationManagerImpl.invHandlers with class [Lorg.glassfish.api.invocation.ComponentInvocationHandler;
    at org.jvnet.hk2.component.InjectionManager.error_injectionException(InjectionManager.java:277)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:159)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat.getByContract(Habitat.java:1042)
    at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:777)
    at com.sun.enterprise.iiop.security.SecurityMechanismSelector.postConstruct(SecurityMechanismSelector.java:166)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1048)
    at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1029)
    at com.sun.hk2.component.InjectInjectionResolver.getComponentInjectValue(InjectInjectionResolver.java:159)
    at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:90)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:141)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1048)
    at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1029)
    at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:779)
    at com.sun.enterprise.iiop.security.Lookups._getSecurityContextUtil(Lookups.java:97)
    at com.sun.enterprise.iiop.security.Lookups.getSecurityContextUtil(Lookups.java:92)
    at com.sun.enterprise.iiop.security.SecClientRequestInterceptor.<init>(SecClientRequestInterceptor.java:119)
    at com.sun.enterprise.security.appclient.AppclientIIOPInterceptorFactory.getClientInterceptorInstance(AppclientIIOPInterceptorFactory.java:127)
    at com.sun.enterprise.security.appclient.AppclientIIOPInterceptorFactory.createClientRequestInterceptor(AppclientIIOPInterceptorFactory.java:96)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBInitializer.post_init(GlassFishORBInitializer.java:132)
    at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.postInitORBInitializers(PIHandlerImpl.java:915)
    at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.initialize(PIHandlerImpl.java:265)
    at com.sun.corba.ee.impl.orb.ORBImpl.postInit(ORBImpl.java:643)
    at com.sun.corba.ee.impl.orb.ORBImpl.set_parameters(ORBImpl.java:704)
    at com.sun.corba.ee.impl.orb.ORBImpl.setParameters(ORBImpl.java:691)
    at com.sun.corba.ee.spi.osgi.ORBFactory.initialize(ORBFactory.java:107)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.initORB(GlassFishORBManager.java:581)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.getORB(GlassFishORBManager.java:263)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBFactoryImpl.createORB(GlassFishORBFactoryImpl.java:93)
    at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:152)
    at com.sun.enterprise.naming.impl.SerialContext.getORB(SerialContext.java:365)
    at com.sun.enterprise.naming.impl.SerialContext.getProviderCacheKey(SerialContext.java:372)
    at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:402)
    at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:347)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:504)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at firstjavaapp.CallEjbClass.main(CallEjbClass.java:20)
Caused by: org.jvnet.hk2.component.ComponentException: Failed to create class com.sun.enterprise.resource.pool.PoolManagerImpl
    at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:71)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:80)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
    at java.util.AbstractList$Itr.next(AbstractList.java:358)
    at java.util.AbstractCollection.toArray(AbstractCollection.java:188)
    at com.sun.hk2.component.InjectInjectionResolver.getArrayInjectValue(InjectInjectionResolver.java:113)
    at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:81)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:141)
    ... 55 more
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(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.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
    at java.lang.Class.getConstructor0(Class.java:2714)
    at java.lang.Class.newInstance0(Class.java:343)
    at java.lang.Class.newInstance(Class.java:325)
    at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:65)
    ... 65 more

Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ejb/RemoveException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(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.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
    at java.lang.Class.privateGetPublicMethods(Class.java:2562)
    at java.lang.Class.privateGetPublicMethods(Class.java:2572)
    at java.lang.Class.privateGetPublicMethods(Class.java:2572)
    at java.lang.Class.getMethods(Class.java:1427)
    at com.sun.corba.ee.impl.presentation.rmi.IDLTypesUtil.validateRemoteInterface(IDLTypesUtil.java:96)
    at com.sun.corba.ee.impl.presentation.rmi.IDLNameTranslatorImpl.<init>(IDLNameTranslatorImpl.java:226)
    at com.sun.corba.ee.impl.presentation.rmi.IDLNameTranslatorImpl.<init>(IDLNameTranslatorImpl.java:65)
    at com.sun.corba.ee.impl.presentation.rmi.IDLNameTranslatorImpl$2.run(IDLNameTranslatorImpl.java:169)
    at com.sun.corba.ee.impl.presentation.rmi.IDLNameTranslatorImpl$2.run(IDLNameTranslatorImpl.java:167)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.corba.ee.impl.presentation.rmi.IDLNameTranslatorImpl.get(IDLNameTranslatorImpl.java:166)
    at com.sun.corba.ee.impl.presentation.rmi.PresentationManagerImpl$ClassDataImpl.<init>(PresentationManagerImpl.java:153)
    at com.sun.corba.ee.impl.presentation.rmi.PresentationManagerImpl$1.lookup(PresentationManagerImpl.java:103)
    at com.sun.corba.ee.impl.presentation.rmi.PresentationManagerImpl$1.lookup(PresentationManagerImpl.java:100)
    at com.sun.corba.ee.spi.orbutil.misc.WeakCache.get(WeakCache.java:114)
    at com.sun.corba.ee.impl.presentation.rmi.PresentationManagerImpl.getClassData(PresentationManagerImpl.java:131)
    at com.sun.corba.ee.impl.presentation.rmi.StubFactoryFactoryDynamicBase.createStubFactory(StubFactoryFactoryDynamicBase.java:91)
    at com.sun.corba.ee.impl.util.Utility.loadStub(Utility.java:835)
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:252)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:153)
    at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:406)
    at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:75)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
    at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:556)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:514)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at firstjavaapp.CallEjbClass.main(CallEjbClass.java:20)
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds)
  • 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-27T01:45:38+00:00Added an answer on May 27, 2026 at 1:45 am

    I had the same problem and just found the solution here.

    Check the final post. It seems that the key is the order of the JAR files in the classpath. Make sure you include gf-client.jar before javaee-api-6.0.jar.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
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
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; 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.