The client is a pure-Java client, how to invoke session bean in oc4j server

I WOULD LIKE TO INVOKE MY SESSION BEAN FROM MY STRUT WEB PROJECT AS A PURE JAVA CLIENT . I SETUP THE JNDI INITIAL CONTEXT PROPERTY BUT I HAVE NO IDEA TO WHERE I SHALL PUT MY application-client.xml and orion-application-client.xml. MY APPLICATION THROW EXCEPTION
NamingException: StoreEJB not found
IF YOU ANY EXAMPLE PLEASE SEND ME
THIS IS MY CLIENT PROGRAME
package ejbs;
import java.io.*;
import javax.ejb.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.naming.*;
import javax.rmi.*;
import java.rmi.*;
import java.util.*;
public class StrutInt {
     * @param args
     public static void main(String[] args) {
          //System.out.print("The application Checkup");
          try
               Hashtable env = new Hashtable();
               env.put (Context.INITIAL_CONTEXT_FACTORY,
               "oracle.j2ee.naming.ApplicationClientInitialContextFactory");
               env.put (Context.SECURITY_PRINCIPAL, "oc4jadmin");
               env.put (Context.SECURITY_CREDENTIALS, "admin");
               //env.put (Context.PROVIDER_URL, "http://localhost:8888");
               env.put (Context.PROVIDER_URL, "ormi://localhost:23791/EjbIntegrationEAR");
               env.put ("dedicated.rmicontext", "true"); // for 9.0.2.1 and above
               Context context = new InitialContext (env);
               System.out.println("work up to this");
          Object homeObject =
context.lookup("StoreEJB");
          System.out.print("Hi Integration");
     StoreHome storeHome = (StoreHome) PortableRemoteObject
               .narrow(homeObject, StoreHome.class);
     Store exa= storeHome.create();
          String s =exa.foo("The foul guy");
          System.out.print(s);
     catch(NamingException e1) {
     System.err.println("NamingException: " + e1.getMessage());
     catch(RemoteException e2) {
     System.err.println("RemoteException: " + e2.getMessage());
     catch(CreateException e3) {
     System.err.println("FinderException: " + e3.getMessage());
     catch(Exception e4) {
     System.err.println("FinderException: " + e4.getMessage());
     }

Create the object of InitialContest class. Then pass in hashTable put WLContextFactory.
then lookup to the sessionJNDI. then call the create method u will get the remote object, from the remote object u can call to the business method

Similar Messages

  • Log4j doesn't create backup files in web-app, the same code in pure java ap

    Hi all,
    in my application I have a class DummyLogger, which is a superclass to all others. It provides them a log4j Logger.
    In the constructor it sets up the important attributes:
    log = Logger.getLogger(name+" (" + app + ") ");
    log.setLevel(Level.toLevel(level));
    PatternLayout defaultLayout = new PatternLayout("%p %c,line %L,%d{dd.MM.yyyy/HH:mm:ss},%m%n");
    RollingFileAppender rollingFileAppender = new RollingFileAppender();
    rollingFileAppender.setName(name);
    rollingFileAppender.setFile(path+app+".log", true, false, 0);
    rollingFileAppender.setMaxFileSize("10MB");
    rollingFileAppender.setMaxBackupIndex(5);
    rollingFileAppender.setLayout(defaultLayout);
    log.removeAllAppenders();
    log.addAppender(rollingFileAppender);
    log.setAdditivity(false);Formerly I had the application as a pure java app and everything worked fine. Now I've made it a web application (I run it on WebsphereAS 5.0) and it has stopped creating the backup files. However the code remained the same.
    Any ideas what has happend?
    Thanks a lot,
    Ondra

    I also have the same problem. Did you find a fix?

  • Unable to call exported client methods of EJB session bean remote interface

    I am unable to call client methods of a BC4J application module deployed as a Session EJB to Oracle 8i at the client side of my multi-tier application. There is no documentation, and I am unable to understand how I should do it.
    A business components project has been created. For instance, its application module is called BestdataModule. A few custom methods have been added to BestdataModuleImpl.java file, for instance:
    public void doNothingNoArgs() {
    public void doNothingOneArg(String astr) {
    public void setCertificate(String userName, String userPassword) {
    theCertificate = new Certificate(userName, userPassword);
    public String getPermission() {
    if (theCertificate != null)
    {if (theCertificate.getPermission())
    {return("Yes");
    else return("No, expired");
    else return("No, absent");
    theCertificate being a protected class variable and Certificate being a class, etc.
    The application module has been tested in the local mode, made remotable to be deployed as EJB session bean, methods to appear at the client side have been selected. The application module has been successfully deployed to Oracle 8.1.7 and tested in the remote mode. A custom library containing BestdataModuleEJBClient.jar and BestDataCommonEJB.jar has been created.
    Then I try to create a client basing on Example Oracle8i/EJB Client snippet:
    package bestclients;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import javax.naming.*;
    import oracle.aurora.jndi.sess_iiop.*;
    import oracle.jbo.*;
    import oracle.jbo.client.remote.ejb.*;
    import oracle.jbo.common.remote.*;
    import oracle.jbo.common.remote.ejb.*;
    import oracle.jdeveloper.html.*;
    import bestdata.client.ejb.*;
    import bestdata.common.ejb.*;
    import bestdata.common.*;
    import bestdata.client.ejb.BestdataModuleEJBClient;
    public class BestClients extends Object {
    static Hashtable env = new Hashtable(10);
    public static void main(String[] args) {
    String ejbUrl = "sess_iiop://localhost:2481:ORCL/test/TESTER/ejb/bestdata.BestdataModule";
    String username = "TESTER";
    String password = "TESTER";
    Hashtable environment = new Hashtable();
    environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    environment.put(Context.SECURITY_PRINCIPAL, username);
    environment.put(Context.SECURITY_CREDENTIALS, password);
    environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    BestdataModuleHome homeInterface = null;
    try {
    Context ic = new InitialContext(environment);
    homeInterface = (BestdataModuleHome)ic.lookup(ejbUrl);
    catch (ActivationException e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    System.exit(1);
    catch (CommunicationException e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    System.exit(1);
    catch (NamingException e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    System.exit(1);
    try {
    System.out.println("Creating a new EJB instance");
    RemoteBestdataModule remoteInterface = homeInterface.create();
    // Method calls go here!
    // e.g.
    // System.out.println(remoteInterface.foo());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    It doesnt cause any errors. However, how must I call methods? The public interface RemoteBestdataModule has no such methods:
    void doNothingNoArgs();
    void doNothingOneArg(java.lang.String astr);
    void setCertificate(java.lang.String userName, java.lang.String userPassword);
    java.lang.String getPermission();
    Instead of that it has the following methods:
    oracle.jbo.common.remote.PiggybackReturn doNothingNoArgs(byte[] _pb) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn doNothingOneArg(byte[] _pb, java.lang.String astr) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn customQueryExec(byte[] _pb, java.lang.String aQuery) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn setCertificate(byte[] _pb, java.lang.String userName, java.lang.String userPassword) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn getPermission(byte[] _pb) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    I cannot call those methods. I can see how they are called in BestdataModuleEJBClient.java file:
    public void doNothingNoArgs() throws oracle.jbo.JboException {
    try {
    oracle.jbo.common.remote.PiggybackReturn _pbRet = mRemoteAM.doNothingNoArgs(getPiggyback());
    processPiggyback(_pbRet.mPiggyback);
    if (_pbRet.isReturnStreamValid()) {
    return;
    catch (oracle.jbo.common.remote.ejb.RemoteJboException ex) {
    processRemoteJboException(ex);
    catch (java.rmi.RemoteException ex) {
    processRemoteJboException(ex);
    throw new oracle.jbo.JboException("Marshall error");
    However, I cannot call getPiggyback() function! It is a protected method, it is available to the class BestdataModuleEJBClient which extends EJBApplicationModuleImpl, but it is unavailable to my class BestClients which extends Object and is intended to extend oracle.jdeveloper.html.WebBeanImpl!
    It seems to me that I mustnt use RemoteBestdataModule interface directly. Instead of that I must use the public class BestdataModuleEJBClient that extends EJBApplicationModuleImpl and implements BestdataModule interface. It contains all methods required without additional arguments (see just above). However, how must I create an object of BestdataModuleEJBClient class? That is a puzzle. Besides my custom methods the class has only two methods:
    protected bestdata.common.ejb.RemoteBestdataModule mRemoteAM;
    /*This is the default constructor (do not remove)*/
    public BestdataModuleEJBClient(RemoteApplicationModule remoteAM) {
    super(remoteAM);
    mRemoteAM = (bestdata.common.ejb.RemoteBestdataModule)remoteAM;
    public bestdata.common.ejb.RemoteBestdataModule getRemoteBestdataModule() {
    return mRemoteAM;
    It looks like the remote application module must already exist! In despair I tried to put down something of the kind at the client side:
    RemoteBestdataModule remoteInterface = homeInterface.create();
    BestdataModuleEJBClient dm = new BestdataModuleEJBClient(remoteInterface);
    dm.doNothingNoArgs();
    Of course, it results in an error.
    System Output: null
    System Error: java.lang.NullPointerException
    System Error: oracle.jbo.common.PiggybackOutput oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyForRemovedObjects(oracle.jbo.common.PiggybackOutput) (ApplicationModuleImpl.java:3017)
    System Error: byte[] oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyfront(boolea
    System Error: n) (ApplicationModuleImpl.java:3059)
    System Error: byte[] oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyback() (ApplicationModuleImpl.java:3195)
    System Error: void bestdata.client.ejb.BestdataModuleEJBClient.doNothingNoArgs() (BestdataModuleEJBClient.java:33)
    System Error: void bes
    System Error: tclients.BestClients.main(java.lang.String[]) (BestClients.java:76)
    I have studied a lot of documents in vain. I have found only various senseless discourses:
    "Use the Application Module Wizard to make the Application Module remotable and export the method. This will generate an interface for HrAppmodule (HrAppmodule.java in the Common package) which contains the signature for the exported method promoteAllEmps(). Then, deploy the Application Module. Once the Application Module has been deployed, you can use the promoteAllEmps() method in your client-side programs. Calls to the promoteAllEmps() method in client-side programs will result in calls to the promote() method in the application tier."
    However, I have failed to find a single line of code explaining how it should be called.
    Can anybody help me?
    Best regards,
    Svyatoslav Konovaltsev,
    [email protected]
    null

    Dear Steven,
    1. Thank you very much. It seems to me that the problem is solved.
    2. "I logged into Metalink but it wants me to put in both a tar number and a country name to see your issue." It was the United Kingdom, neither the US nor Russia if you mean my issue.
    I reproduce the text to be written by everyone who encounters the same problem:
    package bestclients;
    import java.util.Hashtable;
    import javax.naming.*;
    import oracle.jbo.*;
    public class BestdataHelper {
    public static ApplicationModule createEJB()
    throws ApplicationModuleCreateException {
    ApplicationModule applicationModule = null;
    try {
    Hashtable environment = new Hashtable(8);
    environment.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    environment.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_EJB);
    environment.put(Context.SECURITY_PRINCIPAL, "TESTER");
    environment.put(Context.SECURITY_CREDENTIALS, "TESTER");
    environment.put(JboContext.HOST_NAME, "localhost");
    environment.put(JboContext.CONNECTION_PORT, new Integer("2481"));
    environment.put(JboContext.ORACLE_SID, "ORCL");
    environment.put(JboContext.APPLICATION_PATH, "/test/TESTER/ejb");
    Context ic = new InitialContext(environment);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup("bestdata.BestdataModule");
    applicationModule = home.create();
    applicationModule.getTransaction().connect("jdbc:oracle:kprb:@");
    applicationModule.setSyncMode(ApplicationModule.SYNC_IMMEDIATE);
    catch (NamingException namingException) {
    throw new ApplicationModuleCreateException(namingException);
    return applicationModule;
    package bestclients;
    import bestdata.common.*;
    import certificate.*;
    public class BestClients extends Object {
    public static void main(String[] args) {
    BestdataModule bestdataModule = (BestdataModule)BestdataHelper.createEJB();
    Certificate aCertificate = new Certificate("TESTER", "TESTER");
    //calling a custom method!!
    bestdataModule.passCertificate(aCertificate);
    Thank you very much,
    Best regards,
    Svyatoslav Konovaltsev.
    [email protected]
    null

  • Problem using application client for local stateful session bean

    Hi,
    I have deployed a local stateful session bean in Sun J2EE 1.4 application server.
    On running the applclient for the stateful session bean application client i get the following error:
    Warning: ACC006: No application client descriptor defined for: [null]
    cant we use application client for local stateful session beans. becoz the application runs smoothly when i changed the stateful sesion bean to remote.

    Hi,
    No, an ejb that exposes a local view can only be accessed by an ejb or web component packaged within the same application. Parameters and return values for invocations through the ejb local view are passed by reference instead of by value. That can't work for an application client since it's running in a separate JVM.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 2 local ejb and one remote session bean in same server - java client

    idea was -
    to create a new stateless session bean that will talk to the two entity beans. although the session bean will expose its method through a remote interface, the communication betweenn the session bean and the entity beans will be through a local interface. the assumptions is that all three ejbs are running in the same JVM.
    so -
    all three ejbs complied properly.
    but -
    when i tried to test with one 'sample test client' then this is the error i get.
    please please -
    can you look into the below error and let me know what possibly i'm doing wrong. i've been trying for last 4 days and can't figure out.
    thanks a lot.
    D:\jdev9052\jdk\bin\javaw.exe -ojvm -classpath D:\jdev9052\jdev\mywork\H&K\EJBApp\classes;D:\jdev9052\j2ee\home\lib\activation.jar;D:\jdev9052\j2ee\home\lib\ejb.jar;D:\jdev9052\j2ee\home\lib\jaas.jar;D:\jdev9052\j2ee\home\lib\jaxp.jar;D:\jdev9052\j2ee\home\lib\jcert.jar;D:\jdev9052\j2ee\home\lib\jdbc.jar;D:\jdev9052\j2ee\home\lib\jms.jar;D:\jdev9052\j2ee\home\lib\jndi.jar;D:\jdev9052\j2ee\home\lib\jnet.jar;D:\jdev9052\j2ee\home\lib\jsse.jar;D:\jdev9052\j2ee\home\lib\jta.jar;D:\jdev9052\j2ee\home\lib\mail.jar;D:\jdev9052\j2ee\home\lib\servlet.jar;D:\jdev9052\j2ee\home\oc4j.jar;D:\jdev9052\opmn\lib\optic.jar;D:\jdev9052\jdev\system9.0.5.2.1618\oc4j-config\.client;D:\jdev9052\lib\xmlparserv2.jar;D:\jdev9052\lib\xmlcomp.jar TeamStaffSessionEJBClient
    context initialized
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
         java.net.ConnectException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:153)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at TeamStaffSessionEJBClient.main(TeamStaffSessionEJBClient.java:17)
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:452)
         at java.net.Socket.connect(Socket.java:402)
         at java.net.Socket.<init>(Socket.java:309)
         at java.net.Socket.<init>(Socket.java:153)
         at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2216)
         at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java:1692)
         at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java:678)
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:134)
         ... 2 more
    Process exited with exit code 0.

    After you drop an ejb into the designer, you'll see a <ejb>Client1 instance created for the ejb in the backing bean (i.e. Page1.java). The client instance is a wrapper for the ejb. It contains all the remote methods available on your ejb. In your web app, you can invoke any methods on the client instance as if you're calling methods on a regular java object. The wrapper class knows how to invoke the corresponding methods on the ejb for you.
    -dongmei

  • Java.io.NotSerializableException  exception in session beans

    Hey experts,
    I have written the following code to call a session bean method from a portal application.
                   Object obj1 = context.lookup("applications/knet");
                   UserInfoHome userInfoHome =
                                       (UserInfoHome) javax.rmi.PortableRemoteObject.narrow(
                                       obj1,
                                       UserInfoHome.class);
                   UserInfo userInfo = userInfoHome.create();
                   Collection col =
                                  userInfo.getAllrooms();
                   out.println("The size is  " + col.size() + "<br>");
    The following is the implementation of the getAllrooms() method in the session bean
         public Collection getAllrooms() {
              Collection col = null;
              try {
                   InitialContext ctx = new InitialContext();
                   roomsHome = (RoomsLocalHome) ctx.lookup("java:comp/env/ejb/RoomsBean");
                   col = roomsHome.findAllRooms();
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (FinderException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return col;
    In the entity bean the following EJB QL has been used
    <EJB QL>
        select object(r) from Rooms r
    </<EJB QL>>
    I get the following error
    com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.io.NotSerializableException: com.sap.engine.services.ejb.entity.finder.EJBLocalCollection :
            at com.sap.engine.services.rmi_p4.server.P4ObjectBrokerServerImpl.getException(P4ObjectBrokerServerImpl.java:926)
            at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.replicateReturnValue(LocalInvocationHandler.java:115)
            at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.invokeInternal(LocalInvocationHandler.java:90)
            at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:50)
            at $Proxy180.getAllrooms(Unknown Source)
            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:324)
            at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
            at $Proxy181.getAllrooms(Unknown Source)
            at com.watercorp.BMS.test.EJBTest.doContent(EJBTest.java:120)
            at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
            at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
            at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
            ... 29 more
    Caused by: java.io.NotSerializableException: com.sap.engine.services.ejb.entity.finder.EJBLocalCollection
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
            at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.replicateReturnValue(LocalInvocationHandler.java:110)
            ... 42 more
    Please help

    Hi Sabbir,
    You are trying to expose a Collection of Entity local interfaces (RoomsLocal) that is the result of RoomsLocalHome.findAllRooms(), through the Session bean's remote interface method getAllrooms(). This is forbidden by the EJB specification and of course cannot work. You have to use remote interfaces of Entity beans when you want to expose them to remote clients - although this is not a good practice either since Entity beans are fine-grained components. Data transfer objects (<a href="http://en.wikipedia.org/wiki/Data_Transfer_Object">DTO</a>) with Session facades should be used for this purpose (you already have a Session facade - the UserInfo bean).
    Hope this clarifies it!
    -Vladimir
    Message was edited by:
            Vladimir Pavlov

  • Java.lang.NoSuchMethodError implementing stateless session bean

    Hello all,
    I am running Weblogic 5.1 on Windows 2000 using the JDK 1.2.2 and the
    J2SDKEE 1.2.1.
    I have created and successful deployed a state session bean as provided
    by the example given at this url:
    http://www.weblogic.com/docs51/examples/ejb/basic/statelessSession/index.html
    Upon running the client I get the following error:
    Beginning TraderClient...
    user: system
    Creating a trader
    There was an exception while creating and using the Trader.
    This indicates that there was a problem communicating with the server:
    java.rmi.RemoteException: ; nested exception is:
         weblogic.rmi.ServerError: A RemoteException occurred in the server method
    - with nested exception:
    [java.lang.NoSuchMethodError: weblogic.ejb.internal.EJBHomeImpl: method
    findMethodInfo(Ljava/lang/String;)Lweblogic/ejb/internal/MethodInfo; not
    found]
    End statelessSession.Client...
    Here is my classpath for starting the Trader Client:
    java -ms64m -mx128m -classpath
    %WEBLOGIC_HOME%\classes;%WEBLOGIC_HOME%\lib\weblogic510sp11.jar;%WEBLOGIC_HOME%\lib\weblogic510sp11boot.jar;%WEBLOGIC_HOME%\lib\weblogicaux.jar;%WEBLOGIC_HOME%\lib\weblogicbeans.jar;%WEBLOGIC_HOME%\lib\weblogic-tags-510.jar;%WEBLOGIC_HOME%\lib\rmiForMs;%J2SDK_HOME%/lib/j2ee.jar;D:\jdk1.2.2/lib/dt.jar;%PM_ROOT%/lib/hoejbserver.jar;%PM_ROOT%/lib/jcert.jar;%PM_ROOT%/lib/jndi.jar;%PM_ROOT%/lib/jnet.jar;%PM_ROOT%/lib/jsse.jar;%PM_ROOT%/lib/junit.jar;%PM_ROOT%/lib/ldap.jar;%PM_ROOT%/lib/pminput.jar;%PM_ROOT%/lib/pmipdr.jar;%PM_ROOT%/lib/pmopenview.jar;%PM_ROOT%/lib/pmtmn.jar;%PM_ROOT%/lib/pmtools.jar;%PM_ROOT%/lib/pmutil.jar;%PM_ROOT%/lib/pricemaker.jar;%PM_ROOT%/lib/providerutil.jar;%PM_ROOT%/lib/test.jar;%PM_ROOT%/lib/classes12.zip;%PM_ROOT%/lib/hoejbserver.jar;%PM_ROOT%/lib/hoejbclient.jar
    com.rii.pricemaker.ho.ejb.client.trader.TraderClient
    "t3://localhost:7001" "system" "weblogic"
    Here is my startup script for the web logic server:
    java -classpath c:\weblogic\classes\boot
    -Dweblogic.class.path=c:\weblogic\classes;c:\weblogic\license;c:\weblogic\lib\weblogicaux.jar;c:\weblogic\myserver\serverclasses
    -Djava.security.manager
    -Djava.security.policy==c:\weblogic\weblogic.policy
    -Dweblogic.system.home=c:\weblogic weblogic.Server
    Could anyone please give me a clue as to what I might be doing wrong?
    Thanks
    Bediako George

    Thanks alot Matthew, reordering my classpath as follows when starting
    the server did the trick:
    java -classpath
    c:\weblogic\lib\weblogic510sp11boot.jar;c:\weblogic\classes\boot;
    -Dweblogic.class.path=C:\weblogic\lib\weblogic510sp11.jar;c:\weblogic\classes;c:\weblogic\license;c:\weblogic\lib\weblogicaux.jar;c:\weblogic\myserver\serverclasses
    -Djava.security.manager
    -Djava.security.policy==c:\weblogic\weblogic.policy
    -Dweblogic.system.home=c:\weblogic weblogic.Server
    I am placing this here as a benefit to others.
    Thanks again,
    Bediako
    Matthew Shinn wrote:
    Hi,
    You might try running ejbc on the jar file again. Also, if your server has a service pack installed, make sure it is at the head of the classpath when invoking ejbc.
    - Matt
    Bediako George wrote:
    Hello all,
    I am running Weblogic 5.1 on Windows 2000 using the JDK 1.2.2 and the
    J2SDKEE 1.2.1.
    I have created and successful deployed a state session bean as provided
    by the example given at this url:
    http://www.weblogic.com/docs51/examples/ejb/basic/statelessSession/index.html
    Upon running the client I get the following error:
    Beginning TraderClient...
    user: system
    Creating a trader
    There was an exception while creating and using the Trader.
    This indicates that there was a problem communicating with the server:
    java.rmi.RemoteException: ; nested exception is:
    weblogic.rmi.ServerError: A RemoteException occurred in the server method
    - with nested exception:
    [java.lang.NoSuchMethodError: weblogic.ejb.internal.EJBHomeImpl: method
    findMethodInfo(Ljava/lang/String;)Lweblogic/ejb/internal/MethodInfo; not
    found]
    End statelessSession.Client...
    Here is my classpath for starting the Trader Client:
    java -ms64m -mx128m -classpath
    %WEBLOGIC_HOME%\classes;%WEBLOGIC_HOME%\lib\weblogic510sp11.jar;%WEBLOGIC_HOME%\lib\weblogic510sp11boot.jar;%WEBLOGIC_HOME%\lib\weblogicaux.jar;%WEBLOGIC_HOME%\lib\weblogicbeans.jar;%WEBLOGIC_HOME%\lib\weblogic-tags-510.jar;%WEBLOGIC_HOME%\lib\rmiForMs;%J2SDK_HOME%/lib/j2ee.jar;D:\jdk1.2.2/lib/dt.jar;%PM_ROOT%/lib/hoejbserver.jar;%PM_ROOT%/lib/jcert.jar;%PM_ROOT%/lib/jndi.jar;%PM_ROOT%/lib/jnet.jar;%PM_ROOT%/lib/jsse.jar;%PM_ROOT%/lib/junit.jar;%PM_ROOT%/lib/ldap.jar;%PM_ROOT%/lib/pminput.jar;%PM_ROOT%/lib/pmipdr.jar;%PM_ROOT%/lib/pmopenview.jar;%PM_ROOT%/lib/pmtmn.jar;%PM_ROOT%/lib/pmtools.jar;%PM_ROOT%/lib/pmutil.jar;%PM_ROOT%/lib/pricemaker.jar;%PM_ROOT%/lib/providerutil.jar;%PM_ROOT%/lib/test.jar;%PM_ROOT%/lib/classes12.zip;%PM_ROOT%/lib/hoejbserver.jar;%PM_ROOT%/lib/hoejbclient.jar
    com.rii.pricemaker.ho.ejb.client.trader.TraderClient
    "t3://localhost:7001" "system" "weblogic"
    Here is my startup script for the web logic server:
    java -classpath c:\weblogic\classes\boot
    -Dweblogic.class.path=c:\weblogic\classes;c:\weblogic\license;c:\weblogic\lib\weblogicaux.jar;c:\weblogic\myserver\serverclasses
    -Djava.security.manager
    -Djava.security.policy==c:\weblogic\weblogic.policy
    -Dweblogic.system.home=c:\weblogic weblogic.Server
    Could anyone please give me a clue as to what I might be doing wrong?
    Thanks
    Bediako George

  • How to get session.maintain property on server side?

    Is there a way to trap javax.xml.rpc.session.maintain property on the server side in JAX-RPC compliant web service implementation? I would like to know if the client has enabled session.maintain property to true (which false by default). If not, can I specify the web service to be of "Application" or "Session" scope during deployment time? It used to be the case for Apache SOAP processor. I do not see any mention of that in the JAX-RPC spec.
    Thanks for any pointers.
    -Anirban.

    When I first started to work with JAXRPC I had questions about how web services maintained session across multiple calls and also if it was
    possible to maintain session across multiple web services. I downloaded
    the JAXRPC runtime implementation source code and tell you what I found.
    There is a HttpClientTransport class that handles the actual HttpConnection to the server. It checks to see if maintain session is
    set to true or false. If it is set to true it appends the JSESSIONID to the header variables of the request.
    The very first call gets a response back with header variable
    Set-Cookie: JSESSIONID=blahblahblah
    The HttpClientTransport looks for it and if it finds it takes the cookie and stores it somewhere. Every call after that will check to see if session maintain is true or false. If true, it will send
    the header:
    Cookie: JSESSIONID=blahblahblah
    Hope that helps.
    Mike

  • How to deploy a BC4J application as a Session Bean to OC4J?

    I want to deploy a BC4J application as an Session Bean to Oracle9iAS Containers for J2EE instead to the 9iAS-DB (= Oracle8i database). How to package the EJB JAR(s), EAR(s), Client JAR(s) ...???
    The main question is: Is it generally possible to deploy/run a BC4J application as an Session Bean to/on Oracle9iAS Containers for J2EE???

    One of the cool things about BC4J framework is the way you can deploy the BC4J application.
    The BC4J application is independent of the deployment mode.
    Irrespective of which mode you actually deploy the applicaiton, you would still get all the framework services.
    It is also easily switchable from one deployment mode to another.
    Today you can decide to deploy it in the local mode and a later stage if you need to deploy it as EJB Session Bean you don't have rewrite your Appplication.
    All you do use the Design Time Wizards for the APplication Module and make it remotable as EJB Session Bean and everything is taken for you.
    BC4J white paper available on technet gives more details
    http://technet.oracle.com/products/jdev/info/techwp20/wp.html
    raghu

  • How to call session bean's method in JSP

    Hi All,
    I am working on a JSF web application by using sun studio creator.
    The first page have a button, the onClick javascript is as following, which bring up a alert box showing user login name.
    In JSP file, how can I call session bean's setUserName(String name) function (which I would like to store this UserName). So the following pages can use this information.
    If I can not do it this way, is there any other way to do it?
    Thanks in advance.
    var net = new ActiveXObject("wscript.network");
    alert(net.UserName);
    In managed-beans.xml
    <managed-bean>
    <managed-bean-name>BasicInfo</managed-bean-name>
    <managed-bean-class>treepractice.BasicInfo</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>

    You can find more information/details/examples at their own website.
    On the other hand, do you realize that that ActiveX stuff is IE proprietary? And that it is a browser configuration whether to allow them or not? And that this configuration is in IE7 defaulted to an (annoying) warning box before execution which is just bad for the user experience?
    With other words, forget that ActiveX garbage. Alternatives are Applets (not recommended) or Java Web Start (recommended).

  • How does a session bean find entity beans in EJB 3.0

    Hi,
    I am new to J2EE. I have difficulties finding out how a session bean locates the entity-manager for a group of entity beans. I understand that the entitymanager in the session bean is injected using the PersistenceContext annotation, but I dont see how it locates the intended EntityManager (which could be on another server).
    I realize this is probably trivial, but can any of you guys tell me what I am missing?
    Best Regards
    Thomas

    Hi Thomas,
    Good question. Each @PersistenceContext annotation is associated with a single Persistence Unit. A Persistence Unit is defined either at the module level or at the .ear level. Each persistence unit has a name associated with it. The unitName() attribute is used to map @PersistenceContext to the associated PersistenceUnit. Since the most common case is that an application will only define one persistence unit, the spec requires that if the unitName() is not specified, it will automatically map to that single persistence unit.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Java.security.PrivilegedActionException while invoking web service on OC4J

    Hi,
    I have a developed web service in Jdeveloper which is hosted on OC4J app server. I am able to invoke it properly and get results using the web service end point in browser window.
    Now I created a java proxy for this WS in Jdeveloper and tried invoking it inside another web service. I get the following error while the 1st WS is invoked:
    2010-03-09 17:15:04.607 WARNING Unable to connect to URL: <internal web service URL> due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
    10/03/09 17:15:04 java.rmi.RemoteException: ; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
    10/03/09 17:15:04      at autoauthorise.runtime.VehicleTypeSpecsWSSoapHttp_Stub.getVehicleTypeSpecs(VehicleTypeSpecsWSSoapHttp_Stub.java:91)
    10/03/09 17:15:04      at com.bt.vehtype.ws.VehicleTypeSpecsWSSoapHttpPortClient.getVehicleTypeSpecs(VehicleTypeSpecsWSSoapHttpPortClient.java:40)
    10/03/09 17:15:04      at com.bt.fleet.willow.ws.AutoAuthorise.autoAuthorise(AutoAuthorise.java:20)
    10/03/09 17:15:04      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10/03/09 17:15:04      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10/03/09 17:15:04      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10/03/09 17:15:04      at java.lang.reflect.Method.invoke(Method.java:585)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.ImplInvocationHandler.invoke(ImplInvocationHandler.java:126)
    10/03/09 17:15:04      at $Proxy0.autoAuthorise(Unknown Source)
    10/03/09 17:15:04      at com.bt.fleet.willow.ws.runtime.AutoAthoriseWSSoapHttp_Tie.invoke_autoAuthorise(AutoAthoriseWSSoapHttp_Tie.java:62)
    10/03/09 17:15:04      at com.bt.fleet.willow.ws.runtime.AutoAthoriseWSSoapHttp_Tie.processingHook(AutoAthoriseWSSoapHttp_Tie.java:161)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:287)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:356)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:283)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.JAXRPCProcessor.doRequestProcessing(JAXRPCProcessor.java:272)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:94)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.JAXRPCProcessor.doService(JAXRPCProcessor.java:128)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:170)
    10/03/09 17:15:04      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    Please help, I cant see any problem.
    Edited by: Ankit_Screen on Mar 11, 2010 6:27 AM

    can't anybody help me?

  • How to invoke a service on a server other than local bpel server?

    Hi,
    Im trying to invoke a service on a server other than the local bpel server thats installed by default. Any pointers to how this can be achieved? My jedevelper does not show "Bpel process Manager server" under the connections navigator and hence I cannot create a new connection to a different server(other than the default one). Appreciate yr help.
    Thanks,
    -L

    If you only want to just invoke the service, you dont need a new connection.
    Cant you just point to the wsdl of the service in the partnerlink ?
    If you need a new connection in jdeveloper to the other server, you first need to make the new applicationserver connection and after that the integrationserver connection.
    After this you can connect to an other bpelserver, besides the default.

  • How to configure JMS queue on OC4J server. Development in JDeveloper 10G

    Hi there,
    I have to configure a JMS for an Asynchronous process in my Application which will be running in Oracle 10G Application Server. Development Environment is Oracle JDeveloper 10G.
    I am facing a problem on how to configure JMS queue.
    Steps Followed are:
    in the <JDevloperHome>/j2ee/home/config
    1. Made the new queue and connection factory's JMS entry in jms.xml.
    2. Specifed the queue in oc4j-connectors.xml.
    3. played around with application.xml
    and tried all combinations, but the message producer always failed to lookup the queue.
    Need help on the steps to follow so that the producer can post the message in the queue.
    Also please help how to configure the MDB to listen to the queue.
    Thanx and Regards
    Subham

    If you were dealing with Oracle 10g app server as opposed to standalone, I might be better able to help you.
    One thing though, when you are configuring your MDB in the orion-ejb-jar.xml file, do not forget to specify attribute listener-threads, otherwise no matter how many beans you have in your MDB pool, only one bean will be listening to the queue. Many listener-threads equal to max number of beans in pool.

  • Java.io in J2ee stateless session bean, general questions about debugging

    Doing conventional Java IO (with java.io functions and classes such as
    PrintWriter and println) in a Enterprise bean has been discussed before
    in this and other forum. We know that the EJB specification says not to do it.
    (For example the EJB 2.0 spec, 24.1.2) says that an enterprise
    bean must not use the java.io package to attempt to access files and
    directories int he file system."
    The discussion in various forums including this one is that
    a) using java.io in a bean would impact portability, ability to
    move the bean for load balancing
    b) However, this is not always an an issue and it may be reasonable
    to use these functions anyway. e. g. see the response by "maozhoulu"
    on Jun 21, 2002.
    I tried it in Sun Application Server Nine in my stateless Session Bean:
    package RS;
    import RS.CourseHome;
    import RS.CoursePK;
    import java.rmi.RemoteException;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.rmi.PortableRemoteObject;
    import javax.ejb.EJBException;
    import java.io.*;
    public class AddCourseBean implements javax.ejb.SessionBean {
       public void ejbCreate(){};
       public void CreateCourse (int CourseNumber, String CourseName) {
        try {
         System.out.println("in Create Course");
         PrintWriter F = null;
         try {
          F = new PrintWriter (new FileOutputStream("/tmp/v/af"));
         catch (java.io.FileNotFoundException fe){}
         F.println ("here zero");F.flush();
         InitialContext jndiContext = new InitialContext();
         F.println ("here one");F.flush();
         Object o = jndiContext.lookup("ejb/X");
             ...I got a Null pointer exception on the line:
    "F.println("here zero"); Is there anyway one can do simple debugging with print lines in one's beans?
    Or is there something obviousthat I am overlooking? (I saw mention of doing
    debugging with System.out.println but to where would the bean write?)
    I tried using the Jakarta Commons Logging, but I got a
    java.lang.NoClassDefFoundError on org/apache/commons/logging/LogFactory
    Which logging system does one use in GlassFish, hopefully one with minimal
    configuration? I want to do some debugging, not set up logging for a full
    enterprise system.
    Thanks for your insight and advice.
    Dr. Laurence Leff, Associate Professor of Computer Science WIU ST447 61455
    Pager 309 367 0787, Fax 309 298 2302

    My apology for posting this message twice. I looked for it before and
    did not see it. I thought I forget to click the "Post message" button.
    Also, I did resolve one problem. System.out.println does go to
    the log file, which in my case turned out to be:
    /opt/j2ee/SUNWappserver/domains/domain1/logs/server.log
    (Obvously, the first part would vary based upon where you installed your
    Application Server Nine.)
    However, it would be nice if there was some way to use FILE I/O inside of
    beans. I am teaching some J2EE in the graduate software engineering course,
    and I believe this would be pedagogically sound even if other techniques
    would be appropriate for a production environment.
    Thanks for your patience with this problem and my duplicate post.

Maybe you are looking for

  • Music App Missing Artist Under "Artists", Exists Elsewhere

    I just backed up my iPhone 4S and restored that backup to my new iPhone 5. I tried to use the music app to play a song by an artist, let's use Kanye West as an example. Under Artist I no longer have any listings for songs by Kanye West. However, if I

  • Call of Duty with i915GM loki installer, not starting

    Hey, I just installed Call of Duty with the loki installer from liflg.org. But when i tried to run i get this error COD 1.3 build win-x86 Mar 2 2004 ----- FS_Startup ----- Current language: english Current search path: Z:\home\jordz\Games\CoD\main\pa

  • Query on Enhancement Pack Upgrade/ Installation-Business Functions install

    I am working on an Enhancement Pack Upgrade. I have the following questions from the Client, can you please help answer u2013 Scenario u2013 Upgrade from ECC 6.0 to ECC 6.0 EhP4 1 Using Business Function Prediction service, assume SAP recommends 10 B

  • MS Word for iPad won't connect to OneDrive

    I just downloaded MS Word for iPad (and I have a subscription to MS Office 365). The install went fine, but when I log in, it doesn't access my OneDrive folders. It shows two generic folders (Documents and Public), but if I click on Documents, for ex

  • Wrong email addres

    Please forgive me for the bad English. translate through an online translator. at registration have mistakenly incorrect e-mail address. please help me. so I can not enter the store. many thanks <E-mail Edited by Host>