Home/Remote Interface and BeanName EJB in different Packages

Hi all,
I have a simple stateless session bean. Its Home and Remote interfaces are in X package and the BeanEJB in another. The files compile without any error. While I try to deploy it into J2EE ref implementation server using its deployment IDE, it throws up an rmic compilation error.
Error Details
File e:\j2sdkee1.3\repository\tejix\gnrtrTMP\POC2\General\SeabedHome_RemoteHomeImpl.java does not contain type General.SeabedHome_RemoteHomeImpl as expected. Please adjust the class path so that the file does not appear in the package General.
General is the package where the remote/home interfaces are located and Bean1 is where the BeanEJB.
Please suggest a solution
Thanks in advance
- Tejasvi

I think that there is no problem in having the remote and home interface in different packages. Are you sure there is no conflit between classes? I had the same problem because i had repeated classes in the same package. I know this looks stupid but it really happened.
miguel

Similar Messages

  • Home & remote interface

    i deployed EJB with ORACLE deployejb tool,it succeed,from the sess_sh shell,i can see the bean itself.But where should i put the home & remote interface class,is that the web server defined class path just like using a javabean.i use tomcat as my webserver.i didn't do above,and when i import the Home & remote interface in my jsp file,it says can not compile the Home & remote interface class,is that the reason.
    thanks

    it did work!thans!
    but i got another error in my jsp file:
    "javax.naming.CommunicationException: Can't find SerialContextProvider "
    it generate after the following code,can you tell me the reason:
    try{
    Hashtable env = new Hashtable();
    env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    env.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    ic = new InitialContext(env);
    thanks!
    null

  • Using CallRouter with EJB Home/Remote interface

    Hi,
    How do i Use my CallRouter class for EJB's.
    How to use rmic . please help
    thanx in adv.
    pradeep bhat

    You can specify the call-routers in weblogic-ejb-jar.xml.
    FWIW, what are you trying to do?
    -- Rob
    pradeep bhat wrote:
    Hi,
    How do i Use my CallRouter class for EJB's.
    How to use rmic . please help
    thanx in adv.
    pradeep bhat

  • Remotely add and remove Instances from different pages

    Similar to my other post, I have a form that has multiple pages, one being a calculator (OA_CALC) that shows every variable for calculation; the second (OA_PG1), customer facing showing only pertinent information. So both tables should add/remove and show the data being contolled from OA_CALC. I am able to addInstance and source the date to both pages, but for some reason removeInstance only works on the page where the button exists. So rows on OA_PG1 never delete, please advise.
    On OA_CALC i have an ADD ROW button with the following code:
    form1.OA_CALC.Table1.HeaderRow.#subform[0].AddRow::click - (JavaScript, client)
    OA_CALC.Table1.RowItems.instanceManager.addInstance(1);
    OA_PG1.ProjectSavingsGROUP.Table1.RowItems.instanceManager.addInstance(1);
    and a DELETE ROW with the following code:
    form1.OA_CALC.Table1.RowItems.#subform[0].DelRow::click - (JavaScript, client)
    var vIndex = this.parent.parent.index;
    OA_CALC.Table1.RowItems.instanceManager.removeInstance(vIndex);
    OA_PG1.ProjectSavingsGROUP.Table1.RowItems.instanceManager.removeInstance(vIndex);
    One thing that I tried was creating buttons on OA_PG1 with the code specific to that table, that seemed to work. So I know the syntax works, but cannot figure out how to control it from a different page. Please help.
    Thanks

    urgh, apparently I am still very close. I have used your sample, but it seems that the execEvent("click") is not working correctly or my syntax is wrong somewhere. Where am I going wrong?
    Button Code on first table:
    form1.OA_CALC.Table1.RowItems.deleteBtn::click - (JavaScript, client)
    var vCurrentRow = this.parent.index;
    OA_CALC.Table1._RowItems.removeInstance(vCurrentRow);
    xfa.resolveNode("OA_PG1.ProjectSavingsGROUP.Table1.RowItems[" + vCurrentRow + "]").deleteBtn.execEvent("click");
    Invisible Button Code on second table:
    form1.OA_PG1.ProjectSavingsGROUP.Table1.RowItems.deleteBtn::click - (JavaScript, client)
    OA_PG1.ProjectSavingsGROUP.Table1._RowItems.removeInstance(this.parent.index);
    Edit: Here is the Console report from the Acrobat JavaScript Debugger:
    xfa.resolveNode("OA_PG1.ProjectSavingsGROUP.Table1.RowItems[" + vCurrentRow + "]") is null
    7:XFA:form1[0]:OA_CALC[0]:Table1[0]:RowItems[1]:deleteBtn[0]:clickException in line 7 of function top_level, script XFA:form1[0]:OA_CALC[0]:Table1[0]:RowItems[1]:deleteBtn[0]:click
    TypeError: xfa.resolveNode("OA_PG1.ProjectSavingsGROUP.Table1.RowItems[" + vCurrentRow + "]") is null
    7:XFA:form1[0]:OA_CALC[0]:Table1[0]:RowItems[1]:deleteBtn[0]:click

  • Separating code and data in two different packages.

    Hi,
    I am trying to separate data and code that creates or consumes that data in two separate packages.
    package X contains class or applet x. This is my container for data.
    package Y contains applet y. The methods in this applet create and store data in x.
    I would like to be able to delete the current package Y and replace it with a newer version of the package Y. The newer version may contain patches or bug fixes.
    Please keep in mind that I want to keep package X untouched and keep on using the data which has been created or stored in it before Y was updated.
    I have tried different ways to achieve this but keep facing one of the following problems:
    1- when I delete package Y and replace it with the updated Y, the methods in Y loose the reference to the objects in X.
    2- Sometimes I cannot delete package Y at all. I guess because it is still referencing an object in X.
    I may post some code later, ... any ideas?
    Thanks,
    Hugo

    Hi,
    1- when I delete package Y and replace it with the updated Y, the methods in Y loose the reference to the objects in X.On the install method of the applet in Y, you need to lookup the AID object and SOI for the applet in X. You will already be doing this somewhere in your code, you just have to ensure that when you reinstall the applet that uses the interface that you get the references again.
    2- Sometimes I cannot delete package Y at all. I guess because it is still referencing an object in X.This is to do with static references. You should implement AppletEvent in your applet and ensure that all static references are cleaned up in the uninstall method.
    Cheers,
    Shane

  • Role of Remote Interface in EJB 2.0

    Hi,
    Recently I was working upon a sample application for developing Entity Bean, the Home interface had a method which provided Business functionality. The implementation of the method was given in the Bean Class by preceeding the name of the method by ejbHome.
    This method was callable by just looking up the Entity Bean, thus not requiring the need for the Remote Interface.
    Now my question is why was this kind of work around required? This totally removes the need for the remote interface, if the Bean Writer decides so.
    The practices suggest that any functionality to the client should be provided via remote interface, and Home interface should contain only the methods related to life cycle of the EJB, then why to have business methods in the Home Interface.
    Please clarify.

    Bhushan!,
    I hope you getting the whole context wrong!.
    As I said earlier if you want to operate on your persistent data, then you must either find an entity bean through ejbFind() or create a new one using ejbCreate ().
    However ejbHome methods provide a functionality which is independent of the persistent data that the bean represents. For ex. Suppose you have an entity bean User that maps to a user database then in order to operate on user data you will always need a remote interface.
    However if you need some information from the bean which is independent of user data then, for ex. you want to say Hello to your clients, you need to implement this functionality using ejbHome () methods.
    I hope this helps.
    VJ

  • Multiple inheritance in remote interfaces for EJB 3.0 session beans on Webl

    Hi All,
    We started migration from EJB 2.1(WLS 8.1) to EJB 3.0(WLS 10.3.2) and identified few serious problems. One of them is related with multiple business interfaces inheritance. I wrote simple example that presents point of the problem.
    we have session bean AImpl:
    +@Stateless(name="A")+
    +@Remote({A.class})+
    +@TransactionAttribute(TransactionAttributeType.REQUIRED)+
    +public class AImpl implements A {+
    +@Override+
    +public void writeA() {+
    System.out.println("A");
    +}+
    +@Override+
    +public void writeB() {+
    System.out.println("B");
    +}+
    +@Override+
    +public void writeC() {+
    System.out.println("C");
    +}+
    +}+
    with remote interface A:
    +@Remote+
    +@JNDIName(A.JNDI_NAME)+
    +public interface A extends B, C {+
    public static String JNDI_NAME = "A_JNDI_NAME";
    void writeA();
    +}+
    As you can see A extends B, and C. Definition of both interfaces is very simple:
    +public interface B {+
    void writeB();
    +}+
    +public interface C {+
    void writeC();
    +}+
    Everything looks nice until we want to invoke some method on AImpl bean. For above implementation code:
    A a = ctx.lookup(A. JNDI_NAME);
    a.writeA();
    a.writeB();
    a.writeC();
    writes down ”A \n B” and throws exception:
    caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeC()*
    at java.lang.Class.getMethod(Class.java:1605)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
    so.. in stub generated by WLS there is no method from interface C ! What more interesting after small change in interface A rely on change in interface implementation order from B, C to C, B (+public interface A extends C, B {+) server writes down only A and I have stack like below:
    Caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeB()*
    at java.lang.Class.getMethod(Class.java:1605)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
    After this experience I came up with suspicion that Weblogic 10.3 does not support inheritance from multiple interfaces in one “generation”. Instead of that it takes only the first interface from the list.
    Does anybody have some experience with such a situation? maybe someone have an idea how to work around this problem?

    This is Not Supported in WebLogic that the Remote Interface extends other Interfaces. Because Annotation Processor just looks up inside the implemented interface methods. The actual interface which is Implemented by the Bean Class. So the Methods declared inside the Interface B and Interface C will be ignored and will not be available as part of the generated Stubs. Thats why u are getting NoSuchMethodError.
    You can even contact Oracle Support on this...there are 3-4 Cases on it. And the Solution is Work As Designed.
    Workaround is : edit your interface A as following
    Declare all the Business Methods only in the Remote Interface and not inside it's Super Interfaces.
    Example:
    @Stateless(name="A")
    @Remote({A.class})
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class AImpl implements A {
    @Override
    public void writeA() {
    System.out.println("A");
    @Override
    public void writeB() {
    System.out.println("B");
    @Override
    public void writeC() {
    System.out.println("C");
    @Remote
    @JNDIName(A.JNDI_NAME)
    public interface A extends B, C {
    public static String JNDI_NAME = "A_JNDI_NAME";
    void writeA();
    void writeB();
    void writeC();
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

  • Location of stubs, skeletons, remote interface ,client and server files

    I have a question to the subject mentioned above :
    In a training example for RMI I red the following :
    .... stubs, remote interface and client files into
    client location
    ... skeletons, remote interfaces, server files and stubs
    into server location ....
    I understand that with the exception that the stubs must also be located at server side. My understanding is
    that it is enough if those reside only at client side. Is that
    right or wrong ?
    Thanks for your comment.
    Regards,
    Oskar

    The stubs must be available (in the classpath) on the server side. This is because when a remote server object is exported, the RMI runtime creates an instance of the stub (instead of the server) and sends it whenever a reference to the server is encountered. In order to create (and then serialize) the stub, its class file must be available on the server.

  • How to specify a base class for Remote Interface in Workshop 9.2? -- URGENT

    Hi,
    I am trying to create a UUP EJB in WebLogic 9.2 workshop. I am using @FileGeneration to create my home & remote interfaces. And the generated remote interface is extending javax.ejb.EJBObject;I want my remote interface to extend com.bea.p13n.property.EntityPropertyManager which in turn implements javax.ejb.EJBObject. Can someone tell how i can do it in Workshop?.
    I came across Predefined Variable: remote.baseClass and as per docume
    ntation..."If specified, the value of this variable will be used as the base class for all generated remote classes. Where i should specify it?. @FileGeneration does nt have any option for it. Any help is grtly appreciated.
    Following are my code snippets:
    IMPL Class
    @FileGeneration(remoteClass = Constants.Bool.TRUE,remoteHome = Constants.Bool.TRUE, localClass = Constants.Bool.FALSE, localHome = Constants.Bool.FALSE,remoteClassName = "MyEntityPropertyManager",remoteHomeName = "MyEntityPropertyManagerHome")
    public class MyEntityPropertyManagerImpl extends GenericSessionBean implements
              SessionBean {
    //code
    }

    This question was posted to both the bea.workshop.developer.general and weblogic.developer.interest.workshop (I had replied to the later on 10/19); after seeing an identical question today on this list want to include a reference to that reply here:
    http://forums.bea.com/bea/message.jspa?messageID=600044925&tstart=0
    -Rob

  • Ejb-link not working when i access ejb in different ear

    Hi All
    I am here trying to access ejb's which is in different ear, I am providing ejb-link inside web.xml of war file deployed inside deffirent ear file.
    I am using wls8.1sp5. I tried different combination with elb-link name , but its not working . <ejb-ref>
    <ejb-ref-name>ejb/AuditService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.audit.ejb.AuditServiceHome</home>
    <remote>com.onstar.audit.ejb.AuditService</remote>
    <ejb-link>ccarenewal.jar#AuditService</ejb-link>
    </ejb-ref>
    <ejb-ref>
         <ejb-ref-name>ejb/AccountService</ejb-ref-name>
         <ejb-ref-type>Session</ejb-ref-type>
         <home>com.onstar.account.ejb.AccountServiceHome</home>
         <remote>com.onstar.account.ejb.AccountService</remote>
         <ejb-link>ccarenewal.jar#AccountService</ejb-link>
         </ejb-ref>
    Exception:weblogic.management.ApplicationException: activate failed for sbwo Module: sbwo Error: weblogic.management.DeploymentException: Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct. at weblogic.deployment.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:658) at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:467) at weblogic.servlet.internal.CompEnv.init(CompEnv.java:123) at weblogic.servlet.internal.WebAppServletContext.activate
    I will appreciate any help.
    Rajiv

    Rob,
    Thanks for your reply.
    Below is all deployment descriptor entries i have(ejb-jar.xml, weblogic-ejb-jar.xml, web.xml, weblogic.xml)
    please correct me if i have wrong entries any where.
    ejb-jar.xml
    ejb-ref>
    <description />
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.account.ejb.AccountServiceHome</home>
    <remote>com.onstar.account.ejb.AccountService</remote>
    <ejb-link>AccountService</ejb-link>
    </ejb-ref>
    weblogic-ejb-jar.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <jndi-name>cca/AccountService</jndi-name>
    </ejb-reference-description>
    web.xml
    <ejb-ref>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.account.ejb.AccountServiceHome</home>
    <remote>com.onstar.account.ejb.AccountService</remote>
    <ejb-link>ccarenewal.jar#AccountService</ejb-link>
    </ejb-ref>
    weblogic.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <jndi-name>cca/AccountService</jndi-name>
    </ejb-reference-description>
    I appreciate your help.
    Thanks
    Rajiv

  • Implement multiple remote interfaces

    Hi there, I wanted to write an RMI application with an remote object which implement two different remote interfaces, each has its own remote methods.
    eg:
    public class TestImpl implements Test1, Test2 {
    I only want to allow client to call the methods from Test1 remote interface (without Test2.class in the package). But exception NoClassDefFound of Test2 is caught. The reason I want to do like this is because I have a method in Test2 to unexport the remote object, call by server, so I want to hide it from client.
    I implement the system with Activation, but I couldn't unexport the TestImpl from somewhere else on the same activation group by using Activatable.unexportObject(..). I only can unexport it inside TestImpl remote object itself by calling Activatable.unexportObject(this, true); otherwise, NoSuchObjectException is caught.
    Thanks,
    Jax

    If X and A are in the same activation group, X can
    unexport A as long as it has a reference to the actual
    object A not its stub (because unexportObject() takes
    an impl not a stub).Yes, it's true that X can unexport A because there are within the same JVM. But the problem is I can't get the actual object of A.
    For example:
    // assume this code is within X
    ActivationGroupID agi = ActivationGroup.currentGroupID();
    ActivationDesc desc = new ActivationDesc(agi, "A", location, data);
    ActivationID id = ActivationGroup.getSystem().registerObject(desc);
    Remote remote = id.activate(true);
    The code above will only return a stub.
    Even if I use Activatable.register(desc), it returns a stub as well.
    How do I get the actual object?

  • Remote and local interface on same ejb 3.0 bean instance

    Hi,
    Is it posible to get remote and local interface on same ejb 3.0 bean instance.
    For example get local interface of a bean and than pass it as remote to client.
    Both interfaces must operate on same bean instance.
    Thanks
    Zlaja

    yes. You can implement multiple interfaces on a single class, so you can add a local and a remote interface. One trick to avoid duplicate code is to simply make the remote interface extend the local interface; then you only have to add the @Remote annotation and you're done.
    For example get local interface of a bean and than pass it as remote to client.You don't pass an instances to a client, a client looks up a remote instance of the bean through JNDI.

  • Super interfaces on EJB 3.0 Remote interface in OC4J 10.1.3

    We are implementing (on OC4J 10.1.3) an EJB 3.0 Stateless Session Bean with 2 business interfaces (remote and local) both of which extend an inteface we have defined in our system.
    When we look up the local interface we see our interface in the bean.
    When we look up the remote interface we do not see our interface in the bean.
    Any ideas?
    Thanks,
    Ed Dirago
    Computer Sciences Corp.
    FAA TFMS System

    The EJB 3.0 Remote Business references are not directly stored in CosNaming. EJB 3.0 Remote references do not have the cross-vendor interoperability requirements that the EJB 2.x Remote view had.
    You can still access Remote EJB references from a different JVM as long as the client has access to SJSAS naming provider. Please see our EJB FAQ for more details :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • SJSAS 9.1 does not expose EJB 3.0 remote Interface via JNDI

    I have successfully deployed a simple Stateful EJB 3.0 bean (CartBean, like the one in the Java EE 5 tutorial remote interface Cart) on SJSAS 9.1, located on machine host1.
    After I deployed the CartBean, I browsed the SJSAS and noticed the existence of the following JNDI entries:
    ejb/Cart
    ejb/Cart__3_x_Internal_RemoteBusinessHome__
    ejb/Cart#main.Cart
    ejb/mgmt
    ejb/myOtherEJB_2_x_bean ( +myOtherEJB_2_x_bean+ is a different 2.x bean that I have deployed as well)So, I am trying to access the remote interface of the CartBean from a remote machine, host2. The client application is a Java-standalone client.
    I am using the Interoperable Naming Service syntax: corbaname:iiop:host1:3700#<JNDI name>
    The problem is that the remote interface of the bean does NOT seem to be available via JNDI. I get the javax.naming.NameNotFoundException when I try to do a lookup like:
    corbaname:iiop:host1:3700#ejb/Cart
    On the other hand, the following lookups succeed:
    corbaname:iiop:host1:3700#ejb/mgmt
    corbaname:iiop:host1:3700#myOtherEJB_2_x_bean
    and also the following succeeds:
    corbaname:iiop:host1:3700#ejb/Cart__3_x_Internal_RemoteBusinessHome__So it seems like the Remote interface is not available via JNDI, rather only some internal SJSAS implementation (the object returned from the ejb/Cart__3_x_Internal_RemoteBusinessHome__ lookup is of type: com.sun.corba.se.impl.corba.CORBAObjectImpl
    Why is this happening? I know there used to be a bug in Glassfish, but I thought it had been fixed since 2006.
    Many thanks in advance, any help would be greatly appreciated.

    The EJB 3.0 Remote Business references are not directly stored in CosNaming. EJB 3.0 Remote references do not have the cross-vendor interoperability requirements that the EJB 2.x Remote view had.
    You can still access Remote EJB references from a different JVM as long as the client has access to SJSAS naming provider. Please see our EJB FAQ for more details :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • 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

Maybe you are looking for