Netbeans 6.9 Glassfish server 3 EJB application client deployment error

I have an example that I downloaded from the Netbeans docs and whenever I try to run it on my machine, the application client that is supposed to print out a hello message gives me the following error.
post-dist:
dist-directory-deploy:
pre-run-deploy:
Initial deploying EntAppClient to D:\SCT400\LIFESPRING EE\EntAppClient\dist\gfdeploy\EntAppClient
Completed initial distribution of EntAppClient
deploy?path=D:\SCT400\LIFESPRING EE\EntAppClient\dist\gfdeploy\EntAppClient&name=EntAppClient&force=true failed on GlassFish Server 3
D:\SCT400\LIFESPRING EE\EntAppClient\nbproject\build-impl.xml:257: The module has not been deployed.
BUILD FAILED (total time: 1 second)
The full example of the project is found in the following url [Netbeans project|http://netbeans.org/kb/docs/javaee/javaee-gettingstarted.htm]
my JDK is 6 update 21 and I'm using Java EE6. Help me through this because my project is anchored on being distributed and I cannot proceed until I get this right.

I got the same problem, the error log detail is below, I have checked the gf-client.jar, it is right in the folder.
SEVERE: Exception while loading the app
java.lang.RuntimeException: java.io.FileNotFoundException: C:\Program%20Files\glassfish-3.0.1\glassfish\modules\gf-client.jar (The system cannot find the path specified)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo$1.run(JavaWebStartInfo.java:259)
at org.glassfish.appclient.server.core.jws.JavaWebStartState.transition(JavaWebStartState.java:84)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.start(JavaWebStartInfo.java:253)
at org.glassfish.appclient.server.core.AppClientServerApplication.start(AppClientServerApplication.java:134)
at org.glassfish.appclient.server.core.AppClientServerApplication.start(AppClientServerApplication.java:126)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: C:\Program%20Files\glassfish-3.0.1\glassfish\modules\gf-client.jar (The system cannot find the path specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:97)
at org.glassfish.appclient.server.core.jws.JWSAdapterManager.getGFClientModuleClassPath(JWSAdapterManager.java:612)
at org.glassfish.appclient.server.core.jws.JWSAdapterManager.addStaticSystemContent(JWSAdapterManager.java:243)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.addSignedSystemContent(JavaWebStartInfo.java:497)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.initClientStaticContent(JavaWebStartInfo.java:478)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.addClientContentToHTTPAdapters(JavaWebStartInfo.java:420)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.startJWSServices(JavaWebStartInfo.java:312)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.access$100(JavaWebStartInfo.java:96)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo$1.run(JavaWebStartInfo.java:257)
... 35 more
WARNING: Exception while cleaning module 'org.glassfish.internal.data.EngineRef@f185b0'java.lang.NullPointerException
java.lang.NullPointerException
at org.glassfish.appclient.server.core.AppClientDeployer.clean(AppClientDeployer.java:265)
at org.glassfish.internal.data.EngineInfo.clean(EngineInfo.java:114)
at org.glassfish.internal.data.EngineRef.clean(EngineRef.java:171)
at com.sun.enterprise.v3.server.ApplicationLifecycle$1.actOn(ApplicaPEa�POST /forums/post!post.jspa?forumID=972, I got the same problem, the error log detail is below, I have checked the gf-client.jar, it is right in the folder.
SEVERE: Exception while loading the app
java.lang.RuntimeException: java.io.FileNotFoundException: C:\Program%20Files\glassfish-3.0.1\glassfish\modules\gf-client.jar (The system cannot find the path specified)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo$1.run(JavaWebStartInfo.java:259)
at org.glassfish.appclient.server.core.jws.JavaWebStartState.transition(JavaWebStartState.java:84)
at org.glassfish.appclient.server.core.jws.JavaWebStartInfo.start(JavaWebStartInfo.java:253)
at org.glassfish.appclient.server.core.AppClientServerApplication.start(

Similar Messages

  • EJB Application Client clarification

    Hi EJB Guru,
    I would like some clarification on accessing Remote/Local Session Bean using an Application Client. In other word,
    there appears to be more than one approach to the same Session bean. Let's start by declaring the Converter EJB:
    package converter.ejb;
    import java.math.BigDecimal;
    import javax.ejb.Remote;
    @Remote
    public interface Converter {
        public BigDecimal dollarToYen(BigDecimal dollars);
        public BigDecimal yenToEuro(BigDecimal yen);
    package converter.ejb;
    import java.math.BigDecimal;
    import javax.ejb.Stateless;
    @Stateless
    public class ConverterBean implements converter.ejb.Converter {
        private BigDecimal euroRate = new BigDecimal("0.0070");
        private BigDecimal yenRate = new BigDecimal("112.58");
        public BigDecimal dollarToYen(BigDecimal dollars) {
            BigDecimal result = dollars.multiply(yenRate);
            return result.setScale(2, BigDecimal.ROUND_UP);
        public BigDecimal yenToEuro(BigDecimal yen) {
            BigDecimal result = yen.multiply(euroRate);
            return result.setScale(2, BigDecimal.ROUND_UP);
    }I have two method to accessing this bean.
    ( i ) Lookup JNDI using the following set of code:
    package converter.client;
    import converter.ejb.Converter;
    import java.math.BigDecimal;
    import javax.ejb.EJB;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    public class ConverterClient {
        public static void main(String[] args) {
            try {
                InitialContext ctx = new InitialContext();
                ConverterRemote jndiconverter = (ConverterRemote) ctx.lookup("converter.ejb.ConverterRemote");
                BigDecimal param = new BigDecimal("100.00");
                BigDecimal yenAmount = jndiconverter.dollarToYen(param);
                System.out.println("$" + param + " is " + yenAmount + " Yen.");
                BigDecimal euroAmount = jndiconverter.yenToEuro(yenAmount);
                System.out.println(yenAmount + " Yen is " + euroAmount + " Euro.");
                System.exit(0);
            } catch (javax.naming.NamingException ne) {
                System.err.println("Caught an unexpected exception!");
                ex.printStackTrace();
    }( ii ) Application Client lookup?
    package converter.client;
    import converter.ejb.Converter;
    import java.math.BigDecimal;
    import javax.ejb.EJB;
    public class ConverterClient {
        @EJB
        private static Converter converter;
        /** Creates a new instance of Client */
        public ConverterClient(String[] args) {
        public static void main(String[] args) {
            ConverterClient client = new ConverterClient(args);
            client.doConversion();
        public void doConversion() {
            try {
                BigDecimal param = new BigDecimal("100.00");
                BigDecimal yenAmount = converter.dollarToYen(param);
                System.out.println("$" + param + " is " + yenAmount + " Yen.");
                BigDecimal euroAmount = converter.yenToEuro(yenAmount);
                System.out.println(yenAmount + " Yen is " + euroAmount + " Euro.");
                System.exit(0);
            } catch (Exception ex) {
                System.err.println("Caught an unexpected exception!");
                ex.printStackTrace();
    }It is the first time I come a cross method ( ii ) and could not get it to work properly. The error message
    received were:
    SJSAS server side
    **RemoteBusinessJndiName: converter.ejb.Converter; remoteBusIntf: converter.ejb.Converter
    LDR5010: All ejb(s) of [converter] loaded successfully!
    Registering ad hoc servlet: WebPathPath: context root = "/converter", path = "/converter-app-client'
    Java Web Start services started for application com.sun.enterprise.appclient.jws.ApplicationContentOrigin@c91c07
    registration name=converter
        [email protected]3900 registration name=converter, context
    root=/converter/converter-app-client, module name=
    , parent=converter
    WEB0100: Loading web module [converter:converter-war.war] in virtual server [server] at [/converter]
    Class [ Lconverter/ejb/Converter; ] not found. Error while loading [ class converter.client.ConverterClient ]
    Error in annotation processing: java.lang.NoClassDefFoundError: Lconverter/ejb/Converter;
    deployed with moduleid = converter-app-client
    Converter-app-client side
    Caught an unexpected exception!
    java.lang.NullPointerException
            at converter.client.ConverterClient.doConversion(ConverterClient.java:59)
            at converter.client.ConverterClient.main(ConverterClient.java:53)Here is the JNDI listing in ASADMIN:
    C:\>asadmin
    Use "exit" to exit and "help" for online help.
    asadmin> list-jndi-entries
    Jndi Entries for server within root context:
    converter.ejb.Converter: javax.naming.Reference
    converter.ejb.Converter#converter.ejb.Converter: javax.naming.Reference
    jbi: com.sun.enterprise.naming.TransientContext
    jdbc: com.sun.enterprise.naming.TransientContext
    UserTransaction: com.sun.enterprise.distributedtx.UserTransactionImpl
    ejb: com.sun.enterprise.naming.TransientContext
    converter.ejb.Converter__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
    Command list-jndi-entries executed successfully.
    asadmin>My questions are:
    ( a ) Why does the error occur?
    ( b ) what is the architecture difference in accessing the same bean? Does JNDI lookup allows one to access EJB from remote host as opposed the method ( ii ) which is only restricted to local access on the same JVM/Container?
    ( c ) What are the pros & cons between the two?
    I am using Application Client to lookup these Session Beans on Netbeans 5.5, SJSAS 9.0, SDK 1.5.0_11 on Windows XP platform.
    Any guideance/advice would be very much appreciated.
    Thanks alot,
    Henry

    Hi, may be you can help me with a similar problem that I have, I transcript the post in the netbeans forum, I really hope that you or someone can help me with this. Thanks in advance!
    I hope that somebody can help me solving this issue.
    Environment:
    NetBeans 6.0 beta1 + glassfish b58g fresh installed
    Windows XP
    Make a new enterprise application with application client. Run the empty Main and it runs ok.
    Now create a Stateless Session Bean with hello method.
    In the Application Client Main insert a reference to the EJB using the wizard. (@EJB etc...)
    invoke the hello method from the main().
    right click on libraries from application client and add the application-ejb project
    Deploy and it deploys ok, but when you run it throws an exception:
    client:
    java.lang.NullPointerException
    server:
    Error in annotation processing: java.lang.NoClassDefFoundError: Lorg/arautos/revista/sacrae/server/business/SACRAEFacadeRemote;
    java.io.FileNotFoundException: C:\opt\glassfish-v2-b58g\domains\domain1\applications\j2ee-modules\SACRAE-app-client\SACRAE-ejb.jar (El sistema no puede hallar el archivo especificado)
    Remember we added the project to the appclient libraries. If I place the missing file in the applications directory of glassfish it wont work, because when you run it, deploying on the server will erase it again. But, if you copy the jar file in the directory and open it with 7zip or any other application that can keep the file open, when you run it again it will work (because the server is not able to delete the file).
    Although this is a workaround, there should be something I am doing wrong to cause this behavior, now when I try to use Java Web Start to execute the client it fails (surprisingly) with this exception:
    java.lang.reflect.InvocationTargetException
    Caused by: java.lang.NoClassDefFoundError: org/arautos/revista/sacrae/server/business/SACRAEFacadeRemote
    at org.arautos.revista.sacrae.client.desktop.Main.main(Main.java:30)
    ... 21 more
    And I don't know where in the domain1 directory place the jar, worse, I don't know how to solve the issue with the ejb-jar in the first place, does anybody has an idea, link, same problem? I have googled, netbeans-ed and java.net-ed a lot but didn't find anything :(
    Thanks in advance for any help.
    Best Regards.

  • Application client deployment

    i studied the roles and resposibility of EJB
    bean provider - will create beans, remote and home interface.
    app assembler - will assemble beans
    I am not able to understand who is responsible for deploying Application Client .I think Deployer will deploy only beans and not application client..correct me if iam wrong.

    i studied the roles and resposibility of EJB
    bean provider - will create beans, remote and home
    interface.
    app assembler - will assemble beansGreat!
    I am not able to understand who is responsible for
    deploying Application Client .I think Deployer
    will deploy only beans and not application
    client..correct me if iam wrong.Nope, you aren't wrong. The role of the Deployer is only to deploy the EJBs and be done with it. The application client will be deployed by some fucking nut who wants to use those EJBs. He will certainly know what to do with the EJB but nothing related to how it is deployed.
    Did I say a word too much?
    Rich.

  • ACME Video EJB Oracle 8i deployment error.

    An error occurs while stub compilation.
    Tested using both 1.1.8 and 1.2.2 versions.
    How can I solve this?
    Thanks,
    Sean
    AppAccelerator(tm) 1.1.8 for Java (JDK 1.1), x86 version.
    Copyright (c) 1997-1998 Borland International. All Rights
    Reserved.
    Copyright (c) 1997-1999 Oracle Corporation. All Rights Reserved.
    Reading Deployment Descriptor...done
    Verifying Deployment Descriptor...done
    Gathering users...done
    Generating Comm
    Stubs.............................................done
    Compiling Stubs...Errors compiling the communication stubs
    AppAccelerator(tm) 1.1.8 for Java (JDK 1.1), x86 version.
    Copyright (c) 1997-1998 Borland International. All Rights
    Reserved.
    Copyright (c) 1997-1999 Oracle Corporation. All Rights Reserved.
    java.lang.NoClassDefFoundError: java/util/ArrayList
    at sun.tools.util.CommandLine.parse
    (CommandLine.java:42)
    at sun.tools.javac.Main.compile(Compiled Code)
    at sun.tools.javac.Main.main(Compiled Code)
    *** Errors occurred while deploying the EJB to JServer ***
    *** Deployment completed ***
    null

    When I add java 1.2 rt.jar to library list of deployment, this
    problem can be solved.
    However, then, insufficient privelege error occurs when
    deployment program seems to try to load rt.jar file to the
    Oralce 8i JServer.
    How should I configure environment to make ACME video EJB sample
    to run?
    Thanks,
    Sean
    Sean (guest) wrote:
    : An error occurs while stub compilation.
    : Tested using both 1.1.8 and 1.2.2 versions.
    : How can I solve this?
    : Thanks,
    : Sean
    : AppAccelerator(tm) 1.1.8 for Java (JDK 1.1), x86 version.
    : Copyright (c) 1997-1998 Borland International. All Rights
    : Reserved.
    : Copyright (c) 1997-1999 Oracle Corporation. All Rights
    Reserved.
    : Reading Deployment Descriptor...done
    : Verifying Deployment Descriptor...done
    : Gathering users...done
    : Generating Comm
    : Stubs.............................................done
    : Compiling Stubs...Errors compiling the communication stubs
    : AppAccelerator(tm) 1.1.8 for Java (JDK 1.1), x86 version.
    : Copyright (c) 1997-1998 Borland International. All Rights
    : Reserved.
    : Copyright (c) 1997-1999 Oracle Corporation. All Rights
    Reserved.
    : java.lang.NoClassDefFoundError: java/util/ArrayList
    : at sun.tools.util.CommandLine.parse
    : (CommandLine.java:42)
    : at sun.tools.javac.Main.compile(Compiled Code)
    : at sun.tools.javac.Main.main(Compiled Code)
    : *** Errors occurred while deploying the EJB to JServer ***
    : *** Deployment completed ***
    null

  • Entity Bean EJB 2.0 Deployment error

    Hi !!!
    I am new in EJB .
    I have developed an Entity Bean (EJB 2.0) and using IDE MyEclipse and JBoss Server.
    while I deploying the Application I getting the following Exceptions :
    --- MBeans waiting for other MBeans ---
    ObjectName: jboss.j2ee:service=EjbModule,module=EntityExample.jar
    State: FAILED
    Reason: org.jboss.deployment.DeploymentException: No abstract accessors for field named 'id' found in entity class account.AccountEJB
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: jboss.j2ee:service=EjbModule,module=EntityExample.jar
    State: FAILED
    Reason: org.jboss.deployment.DeploymentException: No abstract accessors for field named 'id' found in entity class account.AccountEJB
    can any one give suggetion on it what i am doing incorrect.
    thanks in Advance

    There should be some error in looking up the Jndi..
    In weblogic server I have been using the following code:
         try
              Context ctx = getContext.getInitialContext();
              HelloHome home = (HelloHome)ctx.lookup("MyHello");
              Hello hello = home.create();
              System.out.println(hello.display());
         catch(Exception e)
              System.out.println("Error :");
              e.printStackTrace();
         static String user = null;
         static String password = null;
         static String url = "t3://localhost:7001";
         * Gets an initial context.
         * @return Context
         * @exception java.lang.Exception if there is
         * an error in getting a Context
         static public Context getInitialContext() throws Exception
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, url);
              if (user != null)
         System.out.println ("user: " + user);
         p.put(Context.SECURITY_PRINCIPAL, user);
                   if (password == null)
                        password = "";
         p.put(Context.SECURITY_CREDENTIALS, password);
    return new InitialContext(p);
    this works fine in weblogic..
    also check if ur classpath is ok..

  • Glassfish appication server + application client onj ipad.

    Hello All!
    I'm not sure my topic is proper here.
    I have written an enterprise application on glassfish v2 application server with java application client. This application client is running on PCs with windows/linux OS. On server side I'm using EJBs. The task is to adopt additionally the client on ipads without/with minimal backend changes. And there are some options for that purpose. Which of there options is best choice? Or are there any other options?
    - to integrate Sun Glassfish Mobility Platform with Glassfish Enterprise v2 server on server side and to use Java ME on client side.
    - just to create an web module.
    - to develop client application using Objective-O/Cocoa and to provide its interaction with glassfish server. In this case it's impossible to use EJBs. I found out this integration is able with SOAP, but how it's works I don't know.
    Any opinion will be very helpful!
    Thanks!
    Astghik

    Astghik wrote:
    Yes, ipads are able to support Java ME.Can you show a reliable source that proves this? Because I certainly can't find one. As far as I can tell you have to use an Apple approved SDK and you are only allowed to use Apple approved API calls even - nothing related to Java.

  • How to run application client of an EJB application?

    Hi,
    My EJB application is deployed on websphere. I have written a small java client program to interact with an EJB which is working fine if I compile and run it in websphere studio environment.
    However I am getting runtime exception when I tried to run it at command line.
    RemoteConn.java
    import java.util.Hashtable;
    import com.deque.HelloJavaHome;
    import com.deque.HelloJava;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.ejb.EJBHome;
    import javax.ejb.EJBObject;
    public class RemoteConn {
    public static void main(String[] ar) throws Exception{
    String name="Paruchuri!!";
    String greeting = "";
    try{
    Hashtable env = new Hashtable();
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ws.naming.util.WsnInitCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://localhost:2809");
    InitialContext initContext = new InitialContext(env);
    Object obj = initContext.lookup("ejb/HelloJavaHome");
    HelloJavaHome home = (HelloJavaHome) javax.rmi.PortableRemoteObject.narrow(obj, HelloJavaHome.class);
    HelloJava remote = home.create();
    greeting = remote.getGreeting(name);
    catch(Exception e){
    e.printStackTrace();
    System.out.println("Greeting::"+ greeting);
    I have set the application ejb client jar in the class path of client program.
    The exception I am getting at runtime is
    Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.CORBA.iiop.GlobalORBFactory
    at com.ibm.ejs.oa.EJSORBImpl.class$(EJSORBImpl.java:44)
    at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:195)
    at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:93)
    at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:65)
    at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:385)
    at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:284)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:369)
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:112)
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:422)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:143)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at RemoteConn.main(RemoteConn.java:38)
    Initially I thought I shuold set some jar file of websphere in the classpath of client. But I did not find such a jar containing the above class in websphere studio.
    Basically the error is generated at the below statement at runtime.
    Object obj = initContext.lookup("ejb/HelloJavaHome");
    The only difference I discovered was that the client application has a descriptor file (application-client.xml ) available to it when it ran in websphere studio,. I guess the same META-INF should be provided to client when it runs at command line.
    Right now I am not using any client descriptor file to run the client program. If the above error is due to not supplying META-INF to the client application, how should I make this folder available to client at runtime?
    I greatly appreciate if I could get help ASAP.
    Thanks

    Hey got what is going on. In order to invoke EJB, deployed on WebSpehre App Server, from application client we need to install either WebSphere Application Pluggable Client or WebSphere Thin client on the workstation. Pluggable client is a wrapper to SUN JRE where as Thin Client uses IBM JRE.

  • Startup class/process for EJB application

    Hi,
    I have an EJB module deployed on WebLogic8.1. My requirement is I would like to have a startup/shutdown class which is called when the EJB application is deployed. I have made some research and have found I can write startup/shutdown classes when for the server life cycle or for application life cycle events. Can anyone tell me write/deploy a startup/shutdown class for the EJB module life cycle.
    Thanks,
    Faizulla

    Hi,
    For Server life cycle events you can write server startup/shutdown classes.(You can see it from the console application)
    For application life cyccle events, please go through:
    http://e-docs.bea.com/wls/docs81/programming/app_xml.html#1007582
    You can specify it <listener> part of application.xml.
    This is impossible in J2EE standard. But perhaps this can be achieved by some app. server specific extensionYes,in earlier versiobns there was weblogic-ejb-extensions.xml file in which you can specify startup/shutdown class, like:
    <!DOCTYPE weblogic-ejb-extensions SYSTEM "weblogic-ejb-extensions.dtd" >
    <weblogic-ejb-extensions>
    <module-initializer-classs>
    <moduleinitializer-class-name>com.dcons.iss.ejb.MUTBStatusObject</moduleinitializer-class-name>
    </module-initializer-class>
    </weblogic-ejb-extensions>
    But it's no longer in use.
    I am still findind out a way for my EJB module initializer class.
    Regards,
    Faizulla

  • Application client / jndi

    hello
    how can i get access to a bean running on a application server from a application client that doesn't run i a container ( is not statred e.g. with suns runclient -client... ). what do i have to write in my lookup(..) call? lookup(java:comp/env/ejb...) doesn't work. ( errormessage: " can use java:comp/env only from a j2ee component".)
    thanks

    You can use the following code to get the reference to Context
    * url - url of the app server
    * username - username for accessing the appserver
    * password - password for accessing the appserver
    public static Context getInitialContext(String url, String username, String password)
    Context context = null;
    try
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL, url);
    prop.put(Context.SECURITY_PRINCIPAL, username);
    prop.put(Context.SECURITY_CREDENTIALS, password);
    context = new InitialContext(prop);
    catch (NamingException ne)          
    ne.printStackTrace();     
    return context;          
    "weblogic.jndi.WLInitialContextFactory" is a class specific to WebLogic. You should refer to the documentation for the app server you are using for this fully qualified class name

  • Application Client Enity Manager cannot find Persistence Unit with JWS

    I have an Enterprise Application Project in Netbeans 6.7.1.
    The enterprise application client module has the business code and the
    persistence unit (TopLink) defined in the app-client.jar. I can run this
    application clinet from NB without a problem. I can also run it with JWS
    if I remove the EnityManager.
    I'm using JPA (EnityManager) in a Java SE environment.
    When I try and run the app-client from Java Web Start I get an error
    that the EnityManager cannot find the PU. The persistence unit is packaged in the app.ear->app-client.jar->META-INF->persistence.xml.
    There's not a wealth of information, that I could find on the net, but this
    seems to be correct.
    The error I get is:
    INFO: ACC009: Load Application Class: [jws.Main]
    hello world! From JWS
    Dec 3, 2009 11:44:21 AM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    javax.persistence.PersistenceException: No Persistence provider for EntityManager named JWS-app-clientPU: The following providers:
    oracle.toplink.essentials.PersistenceProvider
    oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
    Returned null to createEntityManagerFactory.
    Any ideas on what I need to do to properly package the PU for an Enterprise Application Client ??
    Thanks,
    David

    I solved this problem.
    When we call resources from EAR application, WebLogic adds "Cache-Control=private, no-cache, no-store, s-maxage=0, must-revalidate" to all responses header.
    It was the reason of error occurence.
    I used filter from http://flavio.tordini.org/http-headers-filter to remove Cache-Control from header when calling jar resources.
    After that, applicatiom started to work again.

  • J2EE Application Client

    I used Sun Java Studio Enterprise to create a stateful session bean (Cart as in the J2ee Tutorial) and deployed it to Sun Application Server (v7). Then in the same application, I creaed a New EJB Test Application (web based test application) called Cart_TestApp by highlighting the Cart (EJB) node and clicking "Create New EJB Test Application" . Everything is perfect and I could use this Cart_TestApp (once again it is web based test app) to test each function defined in the CartHome, Cart. After that, I created another application client to test this Cart bean. The way I did is that I created another J2EE Application Client called CartTestClient by using Templates-->J2EE--->Application Client. Then in the property sheet of this Application Client, I specified two properties:
    1. Application Server----- Server1 (localhost:8080)
    2. EJB Reference----
    2.1 Reference Name---- ejb/Cart
    2.2 Reference EJB Name----Cart
    2.3 Type---Session
    2.4 Home Interface ----CartHome
    2.5 Remote Interface ---Cart
    After that, I built this Application Client and executed the Application Client, but Studio prompts the following error message:
    You must either set a target application, or provide a client stub jar path in the Sun Java System AS tab on the client property sheet!
    In this case, I clicked ellipse for the "Target Application" on the property sheet, which finally only allows me to specify "Cart_TestApp" , note not Cart(EJB), as the Target Application. And I did it. Finally it works just fine for the Application Test.
    Now my questions are:
    1. How to get the EJB client stub jar in the studio for this Cart (EJB)?
    2. Why does the Application Client work just fine after I specified the "Target Application" item in the property sheet as "Cart_TestApp" since "Cart_TestApp" is only a web based test application for the Cart (EJB)? It seems to me that the EJB Application Client has nothing to do with "Cart_TestApp" since both of them are just test clients (one is web based, another standalone java client). Any insights??
    Thanks.
    Yang

    I have figured it out now and actually Cart_TestApp is just an enterprise application generated by Studio with Cart(EJB) inside. Got confused it with SJSAS v8.

  • Using JAAS on an Application Client Container

    I am trying to authenticate users who are going to be accessing
    EJBs from an Application Client Container developed using AWT/Swing.
    I am able to authenticate users accessing these EJBs via the Web Client.
    But some how I get the following error when I run the ACC client:
    Nov 11, 2004 3:47:30 PM com.sun.enterprise.security.auth.login.PasswordLoginModule login
    SEVERE: SEC1105: A PasswordCredential was required but not provided.
    I have tried lc.login with/without the subject and/or principal with the same result.
    Here is the login code
    // Obtain a LoginContext, needed for authentication. Tell
    // it to use the LoginModule implementation specified by
    // the entry named "jdbcRealm" in the JAAS login
    // configuration file and to also use the specified
    // CallbackHandler.
    LoginContext lc = null;
    NameCallback namecb = new NameCallback( "Enter User name: " );
    PasswordCallback passwdcb = new PasswordCallback( "Enter password: ", true );
    Callback[] callbackparm = new Callback[2];
    callbackparm[0] = namecb;
    callbackparm[1] = passwdcb;
    try {
    System.out.println( "entering atUser: login()" );
    //TextCallbackHandler callback = new TextCallbackHandler();
    DialogCallbackHandler callback = new DialogCallbackHandler();
    callback.handle( callbackparm );
    //lc = new LoginContext( "jdbcRealm", callback );
    System.out.println( "entering atUser: login() namecb.getName() = " + namecb.getName() );
    System.out.println( "entering atUser: login() passwdcb.getPassword() = " +
    passwdcb.getPassword() );
    PasswordCredential pwd = new PasswordCredential (namecb.getName(), passwdcb.getPassword() );
    System.out.println( "entering atUser: login() PasswordCredential pwd = " + pwd );
    Subject subject = new Subject();
    //subject.getPrincipals().addAll(tempPrincipals);
    if (!subject.getPrincipals().contains(pwd)) {
    Principal principal = new X500Principal( "CN=JdbcRealm,OU=AkanTech,O=Akan Technology, C=US" );
    subject.getPrincipals().add( principal );
    System.out.println( "entering atUser: login() subject.getPrincipals().add(pwd) = " +
    subject.getPrincipals() );
    if (!subject.getPrivateCredentials().contains(pwd)) {
    subject.getPrivateCredentials().add( pwd );
    subject.getPublicCredentials().add( pwd );
    System.out.println( "entering atUser: login() subject.getPrivateCredentials().add(pwd) = " +
    subject.getPrivateCredentials() );
    System.out.println( "entering atUser: login() subject.getPrivateCredentials().add(pwd) = " +
    subject.getPrivateCredentials() );
    lc = new LoginContext( "jdbcRealm", subject, callback );
    System.out.println( "entering atUser: login() loginContext = " + lc );
    System.out.println( "entering atUser: login() lc.getSubject() = " + lc.getSubject() );
    } catch (LoginException le) {
    System.err.println("atUser login() LoginException: Cannot create LoginContext: " +
    le.getMessage());
    System.exit( -1 );
    } catch (SecurityException se) {
    System.err.println("atUser login() SecurityException: Cannot create LoginContext: " +
    se.getMessage());
    System.exit( -1 );
    //} catch (UnsupportedCallbackException se) {
    //System.err.println("atUser login() UnsupportedCallbackException: Cannot create LoginContext: " +
    se.getMessage());
    //System.exit( -1 );
    } catch (Exception se) {
    System.err.println("atUser login() Exception: Cannot create LoginContext: " + se.getMessage());
    System.exit( -1 );
    try {
    // attempt authentication
    lc.login();
    } catch (LoginException le) {
    System.err.println( "atUser login() LoginException Authentication failed: " + le.getMessage() );
    System.exit( -1 );
    System.out.println( "atUser login() Authentication succeeded!" );
    Here is the content of: appclientlogin.conf
    /* Copyright 2004 Sun Microsystems, Inc. All rights reserved. */
    /* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */
    default {
         com.sun.enterprise.security.auth.login.ClientPasswordLoginModule required debug=false;
    certificate {
         com.sun.enterprise.security.auth.login.ClientCertificateLoginModule required debug=false;
    jdbcRealm {
         com.akantech.security.jdbcrealm.JDBCLoginModule required debug=false;
    Here is the content of sun-acc.xml.
    I have tried with/without the client-credential entry with the same result.
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2004 Sun Microsystems, Inc. All rights reserved.
    SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    -->
    <!DOCTYPE client-container PUBLIC "-//Sun Microsystems Inc.//DTD Application Server 8.0 Application Client Container//EN" "http://www.sun.com/software/appserver/dtds/sun-application-client-container_1_0.dtd">
    <client-container>
    <target-server name="winxppro" address="winxppro" port="3700"/>
    <log-service file="C:/Sun/AppServer/lib/appclient/logs/client.log" level="WARNING"/>
    <auth-realm classname="com.akantech.security.jdbcrealm.JDBCRealm" name="jdbc">
    <property name="dbdrivername" value="com.ibm.db2.jcc.DB2Driver"/>
    <property name="auth-type" value="jdbccustomrealm"/>
    <property name="dburl" value="jdbc:db2://localhost:50000/authuser"/>
    <property name="jaas-context" value="jdbcRealm"/>
    </auth-realm>
    <client-credential user-name="admin" password="akantech" realm="jdbc"/>
    </client-container>
    What am I missing?
    I have read the following documentation but cant seem to figure out what I am missing.
    http://docs.sun.com/source/819-0079/dgdesc.html#wp130029
    http://docs.sun.com/source/819-0079/dgsecure.html
    http://docs.sun.com/source/819-0079/dgsecure.html#wp32713
    http://java.sun.com/security/jaas/doc/api.html
    http://java.sun.com/security/jaas/doc/module.html
    http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/tutorials/index.html
    I added a lot of log info in the JDBCLoginModule : authenticate() method.
    It seems to me like the authenticate() method is never called. Because nothing is
    logged from this method.
    Thanks a million
    Stephen

    I have not been able to figure this one out yet so put it on the
    back burner.
    I am still waiting for an answer.
    Did you find the answer?

  • EJB QL (deployment error)

    I'm trying to deploy an application containing 2.0 style CMPs to OC4J 9.0.3...
    One of the CMP beans has a EJB-QL finder method. I packaged the application using Ant and tried deploying it to OC4J.
    From ejb-jar.xml:
    <query>
    <query-method>
    <method-name>findByCompany</method-name>
    <method-params>
    <method-param>long</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(a) FROM Address AS a WHERE a.coNum = $1]]></ejb-ql>
    </query>
    Deploy Error:
    Encountered "a . coNum = $1" at line 1, column 7.
    Was expecting one of:
    "NOT" ...
    "IdentificationVar" "." "CmpField" "NOT" ...
    "IdentificationVar" "." "CmpField" "IN" ...
    "IdentificationVar" "." "CmpField" "LIKE" ...
    "IdentificationVar" "." "CmpField" "IS" ...
    "+" ...
    "IdentificationVar" "." "CmpField" "*" ...
    "IdentificationVar" "." "CmpField" "/" ...
    "IdentificationVar" "." "CmpField" "+" ...
    "IdentificationVar" "." "CmpField" "-" ...
    "IdentificationVar" "." "CmpField" "BETWEEN" ...
    "IdentificationVar" "." "SingleValuedCmrField" ...
    "IdentificationVar" "." "CollectionValuedCmrField" ...
    "IdentificationVar" "NOT" ...
    "IdentificationVar" "MEMBER" ...
    "IdentificationVar" "." "CmpField" "=" "+" ...
    "IdentificationVar" "." "CmpField" "=" "-" ...
    "IdentificationVar" "." "CmpField" "=" "IdentificationVar" ...
    "IdentificationVar" "." "CmpField" "=" <CHAR_LITERAL> ...
    "IdentificationVar" "." "CmpField" "=" <STRING_LITERAL> ...
    "IdentificationVar" "." "CmpField" "=" <INPUT_PARAM> ...
    "IdentificationVar" "." "CmpField" "=" <INTEGER_LITERAL> ...
    "IdentificationVar" "." "CmpField" "=" <FP_LITERAL> ...
    "IdentificationVar" "." "CmpField" "=" "TRUE" ...
    "IdentificationVar" "." "CmpField" "=" "FALSE" ...
    "IdentificationVar" "." "CmpField" "=" "CONCAT" ...
    "IdentificationVar" "." "CmpField" "=" "SUBSTRING" ...
    "IdentificationVar" "." "CmpField" "=" "LOCATE" ...
    "IdentificationVar" "." "CmpField" "=" "LENGTH" ...
    "IdentificationVar" "." "CmpField" "=" "ABS" ...
    "IdentificationVar" "." "CmpField" "=" "SQRT" ...
    "IdentificationVar" "." "CmpField" "=" "(" ...
    EJB QL statement : 'SELECT OBJECT(a) FROM Address AS a WHERE a.coNum = $1'
    EJB QL method : public abstract java.util.Collection com.insuresuite.company.ejb.AddressEBHome.findByCompany(long) throws javax.ejb.FinderException
    com.sun.ejb.ejbql.EjbQLQuery com.sun.ejb.ejbql.parser.EjbQLParser.parse(com.sun.ejb.ejbql.SymbolTable, com.sun.enterprise.deployment.PersistenceDescriptor, java.lang.reflect.Method, java.lang.String)
    com.sun.ejb.ejbql.EjbQLQuery com.sun.ejb.ejbql.EjbQLDriver.parse(com.sun.enterprise.deployment.PersistenceDescriptor, java.lang.reflect.Method, java.lang.String)
    void com.sun.ejb.sqlgen.SQLGenerator.generateSQLForEjbQLQueries(com.sun.enterprise.deployment.PersistenceDescriptor, com.sun.ejb.ejbql.EjbQLDriver)
    void com.sun.ejb.sqlgen.SQLGenerator.generateSQL(com.sun.enterprise.deployment.EjbBundleDescriptor, com.sun.enterprise.deployment.ResourceReferenceDescriptor, boolean, com.sun.ejb.sqlgen.DBInfo)
    void com.evermind.server.ejb.deployment.EJBPackage.init(byte[], int, int, boolean)
    void com.evermind.server.ServerComponent.init()
    com.evermind.server.ejb.deployment.EJBPackage com.evermind.server.ejb.EJBPackageDeployment.getPackage()
    java.util.Map com.evermind.server.administration.ServerApplicationInstallation.finish(java.util.Map)
    java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
    void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
    void com.evermind.util.ThreadPoolThread.run()
    Any help is greatly appreciated.
    - Ranga

    * I modified the query a bit and was able to deploy the application.
    * This is what I have now:
    <![CDATA[SELECT OBJECT(a) FROM Address AS a WHERE a.coNum IS NULL]]>
    * It somehow doesn't like the $1 notation.
    * Are there any workarounds for this?

  • Getting the InitialContext in an application client

    I have an application client deployed in my application. When I run the client like this:
    java -jar reconcile-client/reconcile-client.jar
    It is failing with this exception when trying to look up anything through the InitialContext object:
    Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
            at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
            at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
            at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at aoc.arkansas.ReconcileClient.main(ReconcileClient.java:26)Is there another way I should be running the client? According to this link I shouldn't have to supply any information to the constructor of the InitialContext object. http://download.oracle.com/docs/cd/B32110_01/web.1013/b28221/servjndi011.htm

    You missed the part where it says you have to use "oracle.j2ee.naming.ApplicationClientInitialContextFactory" and that you should see "Configuring an Oracle Initial Context Factory" (http://download.oracle.com/docs/cd/B32110_01/web.1013/b28221/servjndi011.htm#CIACBCHB). Follow that link and you'll find you have to pass in a map with the "java.naming.factory.initial" property set to that factory, and with the "java.naming.provider.url" property set up to point to the OC4J server.

  • Java Server Proxy---Deployment error?

    I am trying the scenario from this blog
    /people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy
    I am getting deployment error
    May 30, 2006 1:39:34 PM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] ERROR:
    [003]Deployment aborted
    Settings
    SDM host : sapep
    SDM port : 50018
    URL to deploy : file:/C:/DOCUME1/ADMINI1/LOCALS~1/Temp/temp57679JPS_EAR.ear
    Deployment exception : Server sapep did not accept login request as apiadmin on port 50018 - CmdXmlFactory could not find Top Element within String: "null".
    Inner exception was :
    Server sapep did not accept login request as apiadmin on port 50018 - CmdXmlFactory could not find Top Element within String: "null".
    Help me
    Thanks

    Hi Saru,
    It seems u dont have the correct sdm password or someone has changed the sdm password.It has not accepted the credentials u have given during deployment.
    Check with all Sap enterprise portal settings in the prefernces/NWDS
    The host name,alias,port
    If not done with
    Try to change the sdm password using this Password trouble in SDM
    restart server again after changes
    even try
    - Stop nd restart the sdm from yor NWDS and deploy once again
    Thanks,
    Swathi
    Do offer pts:-)

Maybe you are looking for