Application client contents

I have a J2EE application consisting of several war modules, an EJB module, a number of client modules, and several helper class jars, all packaged in an ear file. When it is deployed, I noticed that one huge client jar is created which contains stub classes, contents of all helper jar files, ejb module, and client jars, and those jar files as well. To me, this seems purely nonsensical for several reasons:
1. If I packaged my clients in separate modules, it probably means I intend to use them separately, so the deployment process should produce separate clients as well
2. Why include both jar archives and their contents at the same time?
3. Why include all classes in the client jar? This is not only useless (since most of them are not used by clients anyway), but it might be dangerous as well. What if, in my application, I use a third-party library (together with a license)? Am I supposed to give this to all users of the application through the client jars? A more logical behaviour might have been to include in a client archive only the contents of those libraries requested by the client (through class path entries in the manifest file, for example)
If anybody can think of reasons to explain these, please let me know. I can't find any, myself.

Hi,
I don't think the huge client jar you are talking about is intended to represent your client application itself; rather it is what the server thinks a client would need to be able to communicate with your server application. This jar is produced at server deployment, regardless whether you put client modules in your app or not.
I think you're very right with the other two questions; it's illogical, to say the least, that my client jar is twice as big as my whole server application. It would be nice if someone from Sun would elaborate a little on the strategy behind it.

Similar Messages

  • Application Client to call JSP...

    Hi all,
    I am using Websphere to write EJB codes and JSP pages and print report based on data retrieved from database. Every morning, i need to manually print sales reports and copied it to a network folder. I found it very tedious. I planned to write an application client to automate the task at midnite. I managed to call the session bean using the client but how can I call the jsp page to print the report? Is it possible? Can I save the jsp page to network folder automatically? Thank you for your help.
    Regards,
    Dreon

    Here is some simple code to read from a url
    private String loadPage() throws Exception
              StringWriter      out;
              URL                url;
              URLConnection     conn;
              BufferedReader     reader;
              String               inputString;
              out = new StringWriter();
              if ( logLoads ) System.out.println("Running loadPage, for URL : " + url );
              conn = _url.openConnection();
              conn.connect();
              if (DEBUG) System.out.println(" connected to server...");
              _contentType = conn.getContentType();
              if (DEBUG) System.out.println(" got Content Type : " + conn.getContentType() );
              reader = new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
              if (DEBUG) System.out.println(" Ready to read data..." );
              while (true) {
                   inputString = reader.readLine();
                   int index = inputString.toUpperCase().indexOf("<HTML>");
                   if ( index >= 0 ) {
                        if (DEBUG) System.out.println(" found <HTML> tag in line : '" + inputString + "'");
                        out.write( inputString.substring( index, inputString.length() ).trim() + "\n" );
                        break;
              inputString = reader.readLine().trim();
              while ( inputString != null ) {
                   if ( inputString.length() > 0 )
                        out.write( inputString + "\n" );
                   inputString = reader.readLine();
              if (DEBUG) System.out.println(" finished.");
              return out.toString();
    }

  • How can I remove the applications form Content Administrator

    I had undeployed the applications from Content Administrator in two ways:
    A:
    1. Start the tool using the go.bat located in \usr\sap\<SID>\<Instance Name>\j2ee\admin folder
    2. Log in with an Administrator user.
    3. Under the Server node click Services-> Deploy.
    4. In the runtime tab, on the right hand side screen click on the Applications checkbox. The list of all deployed applications appears.
    5. Select the application and click on the Remove button.
    B:
    Undeploying using SDM remoteGUI.
    after I finished that,the application still exist in the browse of Content Administrator Web Dynpro.
    But it is'n invailable.When I click the application name,it throws exceptions:
    Failed to get the list of names of referenced deployable objects for deployable object 'local/Welcome'.
    Failed to get list of defined JCO clients for deployable object 'local/Welcome'.
    Failed to get the list of names of referenced deployable objects for deployable object 'local/Welcome'.
    Failed to get enable state for 'local/Welcome'.
    No resource bundles found for development component ''local/Welcome''.
    My question is , how can I remove it form the list.

    Hello,
         What is the version of the server you are using?
         The steps you have followed are perfectly fine and I don't see any issue there.
         I hope you refreshed the list on the Content Administrator before accessing the application.
    Kind Regards,
    Padma

  • How to create and run J2EE application client for Hello World EJB

    Hi
    I am new to NWDS EJB deployment.I have created a "Hello World" bean. But how to deploy it and run using a J2EE application client step by step.
    Also please help in the steps of the deploy tool.
    Thanks in Advance

    Hi Ananda
    Check this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/55/600e64a6793d419b82a3b7d59512a5/content.htm
    cheers
    Sameer

  • 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?

  • IO Error while deploying application client jar file ???????

    Hi,
    In my .ear file, one application-client jar(which contains all helper classes which are used in whole application) file is there. While deploying .ear file, all ejb are getting deployed well, while deploying application client jar file(Global.jar file here) it is giving the following message:
    IO Error deploying Global.jar: D:\oracle9ias\oc4j_extended\j2ee\home\applications\trainiumear\Global.jar
    Here is application-client.xml of Global.jar file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application-client_1_2.dtd'>
    <application-client>
    <display-name>TrainiumClientApp</display-name>
    <description>Application description</description>
    </application-client>
    My Environment: Oracle9iAS (9.0.3.0.0), Windows-NT
    Please let me know Why i am getting 'IO Error' , where i may done wrong ?
    Thanks in Advance
    Srinivas

    Srinivas,
    Before we continue, PLEASE tell me if you've looked through the available
    documentation, code samples, "how-to" documents, etc., for OC4J. It
    seems to me that you're mixing things up a bit. I use the "deploy"
    command to deploy my EARs, example (partial):
    java -jar admin.jar ormi://<host> admin <password> -deploy ...
    And my EAR file is not in the "application-deployments" directory
    when I issue that command.
    Perhaps you could also show me the contents of your "application.xml"
    file for this application you are having trouble with.
    But I repeat, please tell me if you have already looked at the
    available documents regarding OC4J!
    Thanks,
    Avi.

  • Combining single transaction between session bean & application client

    Hi All,
    The following transaction exception was encountered when trying to combine a EmployeeSessionBean.create(Employee) method in an application client:
    Application Client output
    SEVERE: null
    javax.transaction.SystemException: org.omg.CORBA.UNKNOWN: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.UNKNOWN: WARNING: IOP00010002: Unknown user exception thrown by the server - exception: org.eclipse.persistence.exceptions.DatabaseException; message:
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    Error Code: 0
    Call: INSERT INTO EmployeeDB.Project (ID, NAME) VALUES (?, ?)
    bind => [2 parameters bound]
    Query: InsertObjectQuery(domain.Project@19d2d53) vmcid: OMG minor code: 2 completed: Maybe
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:117)
    at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:126)
    ----------END server-side stack trace---------- vmcid: OMG minor code: 2 completed: Maybe
    at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:332)
    at com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate.commitDistributedTransaction(JavaEETransactionManagerJTSDelegate.java:184)
    at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:873)
    at com.sun.enterprise.transaction.UserTransactionImpl.commit(UserTransactionImpl.java:208)
    at applicationClient(*applicationClient.java:229*)
    GF 3.1 Server log
    WARNING: A system exception occurred during an invocation on EJB EmployeeSessionBean method public void ejb.EmployeeSessionBean.create(Employee) javax.ejb.EJBException
    Caused by: javax.persistence.TransactionRequiredException
    at ejb.EmployeeSessionBean.create(*EmployeeSessionBean.java:27*)
    SEVERE: RAR5027:Unexpected exception in resource pooling
    java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    WARNING: RAR7132: Unable to enlist the resource in transaction. Returned resource to pool. Pool name: [ mysqlPool ]
    WARNING: RAR5117 : Failed to obtain/create connection from connection pool [ mysqlPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    WARNING: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.]
    WARNING: Local Exception Stack:
    Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    Below is the code snippet of EmployeeSessionBean & client.applicationClient:
    @Stateless
    //@TransactionManagement(TransactionManagementType.BEAN)
    public class EmployeeSessionBean implements EmployeeService {   
        @PersistenceContext(unitName="EmployeeDB-PU")
        private EntityManager manager;
        public void create(Employee employee) {
            manager.persist(employee);  // line 27
    import javax.transaction.UserTransaction;
    public class applicationClient {
    @Resource UserTransaction tx;
    @EJB private static EmployeeService bean;
    try {
        tx.begin();
        Employee employee = new Employee()
            bean.create(employee);
    } finally {
           try {
                 tx.commit();  // line 229
    }How to relinguish transaction on EmployeeSessionBean so that all transaction could take place in applicationClient side only?
    I am trying to apply examples in Pro JPA 2 to a Java EE 6 ManyToMany application.
    Your assistance would be much appreciated.
    Thanks,
    Jack

    Hi r035198x,
    Thank you for some solid advice and would rather JPA take care of all the special cases such as keeping the records unique.
    Below are the changes made as suggested in ( 1 ), ( 2 ), ( 3 ):
    @Entity
    @IdClass(EmployeePK.class)
    @Table(name="EMPLOYEE", catalog="EmployeeDB", schema="")
    public class Employee implements Serializable {
        @Id
        @Column(name="FIRSTNAME")
        private String firstName;
        @Id
        @Column(name="SURNAME")
        private String surName;
        @Id
        @Column(name="DOB")
        @Temporal(TemporalType.DATE)
        private Date dob;
        @ManyToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}, fetch=FetchType.EAGER)
        @JoinTable(name="EMPLOYEE_PROJECT", catalog="EmployeeDB", schema="",
               joinColumns={@JoinColumn(name="FIRSTNAME_ID", referencedColumnName="FIRSTNAME"),
                            @JoinColumn(name="SURNAME_ID", referencedColumnName="SURNAME"),
                            @JoinColumn(name="DOB", referencedColumnName="DOB")},
               inverseJoinColumns={@JoinColumn(name="PROJECT_ID")})
            private Set<Project> projects = new HashSet<Project>();
    @Entity
    @Table(name="PROJECT", catalog="EmployeeDB", schema="")
    public class Project implements Serializable {
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column(name="ID")
        private int id;
        @ManyToMany(mappedBy="projects", cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}, fetch=FetchType.EAGER)
            @JoinTable(name="EMPLOYEE_PROJECT", catalog="EmployeeDB", schema="",
               joinColumns={@JoinColumn(name="PROJECT_ID", referencedColumnName="PROJECT_ID")},
               inverseJoinColumns={@JoinColumn(name="FIRSTNAME_ID", referencedColumnName="FIRSTNAME"),
                            @JoinColumn(name="SURNAME_ID", referencedColumnName="SURNAME"),
                            @JoinColumn(name="DOB_ID", referencedColumnName="DOB")})
        private Set<Employee> employees = new HashSet<Employee>();
    @Stateless
    public class EmployeeSessionBean implements EmployeeService {
        @PersistenceContext(unitName="EmployeeDB-PU") private EntityManager manager;
        public void create(Employee employee)
            manager.persist(employee);
    public class applicationClient {
        @EJB
        private static EmployeeService bean;
        public static void main(String[] args) {
        Employee employee = new Employee()
        bean.create(employee);   // line 209
    } I have diverged slightly from using simple primary key (EMPLOYEE_ID) to composite key class (FIRSTNAME, SURNAME, DOB) to resemble the actual application.
    Also gone back to using non - XADatasources since I am depending on JTA to do all the hardwork on the server side.
    Unfortunately, we have hit a snag once again with the following exception still:
    Application Client Output
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:432)
    at org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:182)
    at org.glassfish.appclient.client.AppClientGroupFacade.main(AppClientGroupFacade.java:65)
    Caused by: javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446347 Maybe; nested exception is:
    org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.MARSHAL: WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream vmcid: OMG minor code: 11 completed: Maybe
    Caused by: java.io.StreamCorruptedException: WARNING: ORBIO00013: Stream corrupted
    ----------END server-side stack trace---------- vmcid: OMG minor code: 11 completed: Maybe
    at ejb._EmployeeService_Wrapper.create(ejb/_EmployeeService_Wrapper.java)
    at applicationClient(applicationClient.java:209)
    GF 3.1 Server log
    WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream
    org.omg.CORBA.MARSHAL: WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream vmcid: OMG minor code: 11 completed: Maybe
    Caused by: java.lang.NullPointerException
    WARNING: ORBIO00013: Stream corrupted
    java.io.StreamCorruptedException: WARNING: ORBIO00013: Stream corrupted
    Your valuable input would be very appreciated.
    Thanks,
    Jack

  • EJB 3.0 Application Client threw Remote nested exception

    Hi All,
    I came across the following EJBException message when trying to retrieve an Employee record (entity bean in EJB 3.0) after having successfully added it into EMPLOYEE table using stateless session bean:
    *10/03/2009 8:53:14 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>*
    WARNING: ACC003: Application threw an exception.
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: null; nested exception is:
    java.lang.NullPointerException
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: null; nested exception is:
    java.lang.NullPointerException
    at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
    at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
    at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
    at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
    at ejb.__EmployeeRemote_Remote_DynamicStub.findEmployee(ejb/__EmployeeRemote_Remote_DynamicStub.java)
    at ejb._EmployeeRemote_Wrapper.findEmployee(ejb/_EmployeeRemote_Wrapper.java)
    at client.EmployeeApplicationClient.printEmployee(EmployeeApplicationClient.java:608)
    at client.EmployeeApplicationClient.main(EmployeeApplicationClient.java:55)
    Below is the code snippets of EmployeeApplicationClient.java:
    public class EmployeeApplicationClient {
        @EJB
        private static EmployeeRemote employeebean1;
        @EJB
        private static EmployeeRemote employeebean2;
        public EmployeeApplicationClient() {}
        public static void main(String[] args)
            EmployeeApplicationClient employee_application_client = new EmployeeApplicationClient();
            employee_application_client.addEmployee(1, John, Smith);
            employee_application_client.printEmployee(1);
        public void addEmployee(int id, String firstname, String surname)
            try {
                Employee employee1 = new Employee();
                employee1.setID(id);                       
                employee1.setfirstname(firstname);                       
                employee1.setsurname(surname);                       
                employeebean1.createEmployee(employee1);
            catch {.....}
        public void printEmployee(int employee_id)
           Employee employee2 =  employeebean2.findEmployee(employee_id);
           System.out.println("employee Id: " + employeebean2.getId());
           System.out.println("employee firstname: " + employeebean2.getfirstname());
           System.out.println("employee surname: " + employeebean2.getsurname());
    }Using employeebean1/employeebean2 in printEmployee() did not make any difference.
    The error message appears to indicate that I have incorrectly structured these methods.
    The deployment of EmployeeBean was successful and employee1 is in EMPLOYEE table via SQL query.
    I am using JDK1.6.07, Glassfish v2 with MySQL 5.0 and Netbeans 6.1 on Windows XP platform.
    Any assistance would be greatly appreciated.
    Thanks,
    Jack

    Hi Ataraxisme,
    Thank you for responding to this post.
    This is a J2EE Application Client that was created and deployed along as an Netbeans EAR (both Application Client and EJB) project which uses resource injection as opposed to JNDI lookup.
    I am trying to get employeeApplicationClient.java to work the same way as the following travelAgentApplicationClient.java example which has successfully retrieved its record record immediately after adding using resource injection:
    public class TravelAgentClient {
        @EJB
        private static TravelAgentRemote travelagent;
        public TravelAgentClient() {
        public static void main(String[] args) {
            TravelAgentClient client = new TravelAgentClient();
            client.doTravelAgent();
        public void doTravelAgent() {
            try {
                Cabin cabin_1 = new Cabin();
                cabin_1.setId(1);
                cabin_1.setName("Master Suite");
                cabin_1.setDeckLevel(1);
                cabin_1.setShipId(1);
                cabin_1.setBedCount(3);
                travelagent.createCabin(cabin_1);
                Cabin cabin_2 = travelagent.findCabin(1);
                System.out.println(cabin_2.getName());
                System.out.println(cabin_2.getDeckLevel());
                System.out.println(cabin_2.getShipId());
                System.out.println(cabin_2.getBedCount());
             ......Thanks,
    Jack

  • How to run a pure java application client with ear deployed on 9ias

    Hello all,
    We want to run a pure java application client which is packed with target bean in the same ear file. In the application-client.xml we refer to some EJBs.
    We deployed the ear file which contains ejb jar module and application client module to oracle 9ias 904 through enterprise manager on unix. The jndi.properties we used looks like this
    java.naming.factory.initial=com.evermind.server.rmi.ApplciationClientInitialContextFactory
    java.naming.provider.url=opmn:ormi://opmn_host:opmn_port:oc4j_instance_name/application_name
    java.naming.security.principal=test
    java.naming.security.credentials=test
    Is there anybody knows how to run such an application client? Do we need to provide such a jndi.properties or not at all?
    Thanks,
    9ias user

    Refer OpenEJB User - Oracle ADF Essential and TomEE+
    Also refer Bug in tomee 1.5.2. Fixed in 1.6.
    https://issues.apache.org/jira/browse/TOMEE-756

  • 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.

  • Application-client.xml - resourceBundle

    Hi..
    I have a problem creating a standalone application client...
    I have crated an application-client.xml file containing ejb-refs to 2 Sessionbeans : Like this ->
    <ejb-ref>
    <ejb-ref-name>bean/AdvisorProxy</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>app.common.proxy.AdvisorProxyHome</home>
    <remote>app.common.proxy.AdvisorProxy</remote>
    </ejb-ref>
    <ejb-ref>
    <ejb-ref-name>bean/AdminProxy</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>app.common.proxy.AdminProxyHome</home>
    <remote>app.common.proxy.AdminProxy</remote>
    </ejb-ref>
    When I try to run my app I get an exception when I try to get my bean through the context :
    java.util.MissingResourceException: Can't find bundle for base name com/evermind/client/assembler/Assembler, locale en_GB
    Is there something else I have to specify anywhere?
    Thanks...
    johan

    This fixed my problem:
    - JNDI initial context factory -
    com.evermind.server.rmi.RMIInitialContextFactory
    - jndi provider url -
    opmn:ormi://servername

  • Env-entry-mapping in orion-application-client not available in JNDI lookup

    I have an application client module in my EAR file that I've configured to auto-start.
    It has a few env-entry defined in it's application-client.xml.
    When I deploy the EAR file to OC4J 10.1.3, the application client module gets started and can access these env-entry properties from its JNDIContext.
    Now, comes the problem. During the deployment process, I edit the Deployment Plan, and change the env-entry property values, and then deploy the application.
    However, the application client module still gets the original values when it does the JNDI lookups of those env-entry names.
    I have checked to see that OC4J creates an orion-application-client.xml during deployment and it shows the env-entry-mapping elements with the updated values.
    Why is the JNDI lookup returning the values from application-client.xml and not the overriden values set in orion-application-client.xml?
    I have tried this on OC4J 10.1.3, as well as 10.1.3.1.0 - got same behavior.
    Is this a bug in OC4J? This seems to work fine with ejb modules, but not application client modules.
    Thanks,
    Kalpak

    Avi!
    Of course, I had tried it before I wrote the question. I put the modified xml file into the application area. After that AS restarts OC4J instance. And then I find my xml without any changes I made! I tried to do the same thing from the AS console. The same!
    Leonid

  • Distributing a Java EE Application Client (Thin Client)

    Hi,
    I'm following the instructions in Section 4 Developing a Java EE Application Client (Thin Client) in Oracle® Fusion Middleware Programming Stand-alone Clients for Oracle WebLogic Server, 11g Release 1 (10.3.1), Part Number E13717-01.
    I packaged the application client in an ear. If I set up my environment using C:\bea10\wlserver_10.3\server\bin\setWLSEnv.cmd. I can extract the application client using a command line like:
    java weblogic.ClientDeployer myear.ear myclient
    I can execute the client using a command line like:
    java weblogic.j2eeclient.Main myclient.jar t3://localhost:7003
    However, I would like to run the application client on a client machine (i.e., a machine without WebLogic installed). I thought I could use one of the wl*client.jar files such wlclient.jar, wlfullclient.jar, etc. I started with wlfullclient.jar.
    If I try to extract the application client with a command line like
    java -classpath wlfullclient.jar weblogic.ClientDeployer myear.ear myclient
    I get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/bea/xml/XmlException
    at weblogic.descriptor.BasicDescriptorManager.getMarshallerFactory(BasicDescriptorManager.java:143)
    at weblogic.descriptor.BasicDescriptorManager.getDescriptorFactory(BasicDescriptorManager.java:183)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:320)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
    at weblogic.application.ApplicationDescriptor.getApplicationDescriptor(ApplicationDescriptor.java:301)
    at weblogic.ClientDeployer.findAltDDUri(ClientDeployer.java:210)
    at weblogic.ClientDeployer.processClientJar(ClientDeployer.java:107)
    at weblogic.ClientDeployer.processClientJar(ClientDeployer.java:75)
    at weblogic.ClientDeployer.main(ClientDeployer.java:43)
    Caused by: java.lang.ClassNotFoundException: com.bea.xml.XmlException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 12 more
    Next I tried using the jar previously extracted on the server and tried to run it using:
    java -classpath wlfullclient.jar weblogic.j2eeclient.Main myclient.jar t3://localhost:7003
    I get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/j2ee/descriptor/wl/WeblogicApplicationClientBean
    at weblogic.j2eeclient.Main.fillEnvironment(Main.java:326)
    at weblogic.j2eeclient.Main.run(Main.java:185)
    at weblogic.j2eeclient.Main.main(Main.java:924)
    Caused by: java.lang.ClassNotFoundException: weblogic.j2ee.descriptor.wl.WeblogicApplicationClientBean
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 3 more
    Is it possible to extract and execute an application client on a machine without WebLogic server? If so, what jars do I need? If not, why not?
    I'm testing using WebLogic 10.3.1 on a Windows XP SP2 machine using JDK 1.6.0_05.
    Thanks in advance,
    Keith

    Hello,
    I tried doing pre-compilation of jsps using the weblogic.appc and getting the below exception.
    Can any one advise the jar file containing the below class file so that I can add in the classpath and try for it.
    java.lang.ClassNotFoundException: com.bea.xml.XmlException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at weblogic.descriptor.BasicDescriptorManager.getMarshallerFactory(BasicDescriptorManager.java:137)
    at weblogic.descriptor.BasicDescriptorManager.getDescriptorFactory(BasicDescriptorManager.java:171)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:303)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoa
    r2.java:788)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.ja
    :409)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorL
    der2.java:759)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java
    68)
    at weblogic.application.ApplicationDescriptor.getApplicationDescriptor(ApplicationDescriptor.java:311)
    at weblogic.application.compiler.CompilerCtx.setApplicationDescriptor(CompilerCtx.java:138)
    at weblogic.application.compiler.AppcUtils.setDDs(AppcUtils.java:142)
    at weblogic.application.compiler.flow.DescriptorParsingFlow.compile(DescriptorParsingFlow.java:57)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
    at weblogic.application.compiler.EARCompiler.compile(EARCompiler.java:49)
    at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:118)
    at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
    at weblogic.application.compiler.Appc.runBody(Appc.java:181)
    at weblogic.utils.compiler.Tool.run(Tool.java:158)
    at weblogic.utils.compiler.Tool.run(Tool.java:115)
    at weblogic.application.compiler.Appc.main(Appc.java:192)
    at weblogic.appc.main(appc.java:14)
    com.bea.xml.XmlException

  • BC4J and OAS with Java Application Client

    Could you show me an example about using the BC4J and OAS with Java Application client.
    The JDeveloper Help is not enough to solve this kind of problem.
    Configuration:
    Jdeveloper 3.1
    OAS 4.0.8.1
    Database 7.3.4
    null

    if you can logon with client tools then that should be an indication that the service account running the CMS IS working! Good news.
    So the problem is likely with the java portion (krb5/bsclogin or java options)
    If the files are in c:\winnt\ (if not copy them there) and perform c:\program files\business objects\javasdk\bin\kinit username
    then enter and password/enter again
    Probably get the same message. To note in your krb5.ini all domain info must be in CAPS (the .com appears to be in lower case)
    kinit works with just the krb5.ini, java SDK and AD (removing BO config and the service account from the picture). Once that works if your java options are specified properly you should be able to login to CMC/infoview.
    also 1 last point. Add udp_preference_limit = 1 to the krb5 lib defaults section
    libdefaults
    default_realm = BD.com
    dns_lookup_kdc = true
    dns_lookup_realm = true
    udp_preference_limit = 1
    Regards,
    Tim

  • J2EE Tutorial - Application Client

    Hi,
    I've been trying to work through the J2EE Tutorial and I've come to a complete standstill at the EJB section. I have a few problems.
    First of all my deployment tool does not have a JNDI Names Tag as shown in the Mapping The Enterprize Beans Section (Chapter 19). How do I do this?
    I am getting the following error when I try to run my J2EE Application Client.
    Caught an unexpected exception!
    java.lang.ClassCastException
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableR
    emoteObject.java:229)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at ConverterClient.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23
    7)
    at com.sun.enterprise.appclient.Main.<init>(Main.java:425)
    at com.sun.enterprise.appclient.Main.main(Main.java:97)
    Caused by: java.lang.ClassCastException
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableR
    emoteObject.java:212)
    Finally, can anybody recommend a good tutorial or book as I think the J2EE tutorial is unusually bad.

    http://docs.sun.com/source/819-0079/dgacc.html
    Finally, can anybody recommend a good tutorial or
    book as I think the J2EE tutorial is unusually bad.Search for Mastering EJB by Ed Roman. It should give a better understanding.

Maybe you are looking for