Common EJBs

I'm working on deploying common EJBs on Sun 7 app server. I have two or three EJBs that I would like all of my applications to access. But, I don't want to put them in the application ear files.
With ias6.5, we could do this. The common EJB classes had to be in the server classpath (not my favorite solution), but it worked.
With Sun 7, we can't even get the application deployed. I've deployed the common EJB, but when I try to deploy the application, it chokes. It says "Error - unresolved: <ejb link> commonEJB " I tried to take the ejb link property out of the xml, but it didn't like that either.
Is it even possible to deploy standalone EJBs and have multiple applications access them?

The ejb link and ejb references must be within the same application (for standards based deployment).

Similar Messages

  • Where do I deploy common EJB helper and utility classes

    Hi,
    I have a number of EJBs that each use a common set interfaces, exceptions and Value beans. If I deploy using the iasdeploy command line, then I must package up all these common classes within each of the EJB modules - leading to a lot of duplicate code.
    Is there a smarter a way of packaged the common classes so that I can include them in the .EAR file but only in one module.
    Note: I would prefer to only argument the IAS classpath with 3rd party classes that rarely change and not these common classes e.g. Jlog
    cheers
    Daniel

    Hi,
    Try to put all the EJB's in a single package and import the package. I
    can think of this solution right now, will keep posting for updates.
    Regards
    Raj
    Daniel Westerdale wrote:
    Hi,
    I have a number of EJBs that each use a common set interfaces,
    exceptions and Value beans. If I deploy using the iasdeploy command
    line, then I must package up all these common classes within each of
    the EJB modules - leading to a lot of duplicate code.
    Is there a smarter a way of packaged the common classes so that I can
    include them in the .EAR file but only in one module.
    Note: I would prefer to only argument the IAS classpath with 3rd party
    classes that rarely change and not these common classes e.g. Jlog
    cheers
    Daniel
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Sharing common libraries and ejbs between multiple ears

    Hi
    I have been going through various articles at O'Reilly and discussions at serverside
    (some outdated) on the packaging options in J2EE.
    http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html?page=2
    http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
    http://www2.theserverside.com/home/thread.jsp?thread_id=7530
    I am still undecided as to what is the best way to package and deploy
    - a set of EJBs (Stateless Session beans) and
    - utility libraries
    that need to be shared by multiple ears.
    We have a set of components - 4 session ejbs and 15 utility classes like log4java,
    xerces, custom utilities etc... which need to be shared by all applications running
    on the server (in a clustered environment).
    There are over 22 applications and these will be packaged in individual ear files.
    If we choose to put the common EJBs and utilities in each of the application's
    ear, then for every change to this common library all the applications will need
    to be repackaged and redeployed, which obviously is not desirable.
    If we choose to use the 'Class-Path' option in manifest file, from what I understand
    the path to be specified is a relative path within the ear i.e. the path cannot
    point to archives outside the .ear file, which does not serve our purpose. Am
    I right in this understanding?
    What is the best way to package and deploy these common components under these
    circumstances?
    Has anybody tried something like this before?
    Would appreciate your comments on this.
    Thank you.

    "Kumar" <[email protected]> wrote in message
    news:[email protected]...
    In My opinion,
    I would be packaging the all utilities into a single jar file and be using
    in the application server class path directly. whenever I want to change
    this jar file I can change at one shot and package this jar file and keepit
    in the classpath again. This works very well, if and only if each EAR file
    is not using its own version of a libary of utility jar file. All earfiles
    should be using a single and common library.In this case when you update the .jar file, you would have to restart the
    server. I am not aware of any good solution which alleviates this.
    >
    If I include this utility jar file into all ear files, the following arethe
    difficulties we need to handle in the future.
    - What if utility library has been changed frequently, it leads to
    re-package all .ears and re-deployment
    - Unnecessarily adding a copy of a single jar file to all ear files,
    increases complexity
    - Any new application needed to be deployed, again which uses utility, we
    need add the utility jar file to ear file
    - There is no logical separation and simplicity
    Thanks
    Kumar
    "Kiran P" <[email protected]> wrote in message
    news:[email protected]...
    Hi
    I have been going through various articles at O'Reilly and discussions
    at
    serverside
    (some outdated) on the packaging options in J2EE.
    http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html?page=2
    http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
    http://www2.theserverside.com/home/thread.jsp?thread_id=7530
    I am still undecided as to what is the best way to package and deploy
    - a set of EJBs (Stateless Session beans) and
    - utility libraries
    that need to be shared by multiple ears.
    We have a set of components - 4 session ejbs and 15 utility classes likelog4java,
    xerces, custom utilities etc... which need to be shared by allapplications running
    on the server (in a clustered environment).
    There are over 22 applications and these will be packaged in individualear files.
    If we choose to put the common EJBs and utilities in each of theapplication's
    ear, then for every change to this common library all the applicationswill need
    to be repackaged and redeployed, which obviously is not desirable.
    If we choose to use the 'Class-Path' option in manifest file, from what
    I
    understand
    the path to be specified is a relative path within the ear i.e. the pathcannot
    point to archives outside the .ear file, which does not serve our
    purpose.
    Am
    I right in this understanding?
    What is the best way to package and deploy these common components underthese
    circumstances?
    Has anybody tried something like this before?
    Would appreciate your comments on this.
    Thank you.

  • Using common jars containing EJBs in multiple ears

    I was wondering if there was an easy way to have references to jars that is contained in one ear in another ear. The main question is that if we have some EJBs that are commonly used in multiple ears then is there a way to have those common EJBs in a single ear and have the other ears that need these EJBs reference them in some way without having to copy them into those ears? Thanks ahead of time

    If you think about it carefully, one .ear file represents one enterprise application. In other words, a .ear file represents a packaged unit that must be deployable by itself.
    If one desires to use some reusable business component in one's enterprise application, all dependencies that that component might be having will need to be included in the deployable unit, i.e. the .ear file, for that application.
    On similar lines, the following is an extract from the Enterprise JavaBeans specification 1.1 (pay particular attention to the first paragraph therein)...
    The ejb-jar file must also contain the class files for all the classes and interfaces that the enterprise bean
    class, and the remote and home interfaces depend on. This includes their superclasses and superinter-faces,
    and the classes and interfaces used as method parameters, results, and exceptions.
    An ejb-jar file does not have to include the class files of the home and remote interfaces of an enterprise
    bean that is referenced by an enterprise bean in the ejb-jar, or other classes needed by the referenced
    enterprise bean, if the referenced enterprise bean or needed classes are defined in another jar file that is
    named in the Class-Path attribute in the Manifest file of the referencing ejb-jar file, or the transitive clo-sure
    of such Class-Path references. Note that this Class-Path mechanism only works with JDK 1.2 and
    later.
    You can extrapolate a similar notion for enterprise archives also.
    I guess, the simplest way to put this is, when deploying one application one cannot assume the existence of another application.

  • Error connecting to JServer/EJB

    Hi all,
    I've successfully deployed a BC4J Application Module as EJB Session Bean into Oracle8i 8.1.6. The test on this Application Module works fine.
    The client code that calls the EJB is:
    package ricercalista.client;
    import java.util.Hashtable;
    import javax.naming.*;
    import oracle.jbo.*;
    import ricercalista.client.ejb.LoginModuleEJBClient;
    import oracle.jbo.client.remote.ejb.*;
    import oracle.jbo.common.remote.*;
    import oracle.jbo.common.remote.ejb.*;
    import ricercalista.common.ejb.*;
    import ricercalista.common.*;
    public class LoginClient {
    final String AMDefName = "ricercalista.LoginModule";
    final String username = "omero";
    final String password = "omero";
    final String dbUrl = "jdbc:oracle:thin:omero/omero@localhost:1521:OMERO";
    public LoginClient() {
    try {
    Hashtable env = new Hashtable(10);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_ORACLE8I);
    env.put(JboContext.SECURITY_PRINCIPAL, username);
    env.put(JboContext.SECURITY_CREDENTIALS, password);
    env.put(JboContext.HOST_NAME, "bacco08.csr.unibo.it");
    env.put(JboContext.CONNECTION_PORT, "2481");
    env.put(JboContext.ORACLE_SID, "OMERO");
    env.put(JboContext.APPLICATION_PATH, "test/omero/ejb");
    Context ic = new InitialContext(env);
    LoginModuleHome home = (LoginModuleHome) ic.lookup(AMDefName);
    LoginModuleEJBClient myejb = (LoginModuleEJBClient) home.create();
    myejb.getTransaction().connect(dbUrl, username, password);
    myejb.setUser("turronic", "chris");
    System.out.println((String) myejb.getCognome());
    System.out.println((String) myejb.getNome());
    ricercalista.UserProfile up = myejb.getUserProfile();
    for (int i = 0; i < up.size(); i++) {
    System.out.println("dominio = " + up.getCodeDomain(i) + " grado = " + up.getInterestDegree(i));
    myejb.getTransaction().disconnect();
    myejb.remove();
    catch (java.rmi.RemoteException re) {
    System.out.println("Remote exception in creating " + AMDefName);
    re.printStackTrace();
    catch (javax.ejb.CreateException ce) {
    System.out.println("Unable to create ejb " + AMDefName);
    ce.printStackTrace();
    catch (NamingException ne) {
    System.out.println("Unable to find application " + AMDefName);
    ne.printStackTrace();
    catch (oracle.jbo.ApplicationModuleCreateException e) {
    System.out.println("Unable to create application module " + AMDefName);
    e.printStackTrace();
    public static void main(String[] args) {
    new LoginClient();
    When I run this client, an error occurs on the statement:
    LoginModuleHome home = (LoginModuleHome) ic.lookup(AMDefName);
    The error is:
    System Error: javax.naming.NamingException: Unknown reasons. Root exception is java.lang.ClassNotFoundException: ricercalista.common.ejb.LoginModuleHomeHelper
    System Error: void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.initRemoteHome() (AuroraApplicationModuleHome.java:167)
    System Error: void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.<init>(oracle.jbo.JboContext, java.lang.String) (AuroraApplicationModuleHome.java:75)
    System Error: oracle.jbo.common.JboHome oracle.jbo.client.remote.corba.aurora.AuroraInitialContext.createJboHome(java.lang.String) (AuroraInitialContext.java:47)
    System Error: java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String) (JboInitialContext.java:72)
    System Error: java.lang.Object javax.naming.InitialContext.lookup(java.lang.String) (InitialContext.java:349)
    System Error: void ricercalista.client.LoginClient.<init>() (LoginClient.java:51)
    System Error: void ricercalista.client.LoginClient.main(java.lang.String[]) (LoginClient.java:89)
    Have you ever got this error? Is the client code right?
    Thanks a lot!

    java.lang.ClassNotFoundException:ricercalista.common.ejb.LoginModuleHomeHelper
    It's saying Call Not Found and I'm guessing that ricercalista.common.ejb.LoginModuleHomeHelper
    is your class? Did your classes(jar file) get to the server in the right place? to be found? Is the Classpath set?
    I'm not a EJB programmer though.

  • EJB Helper class not created

    Dear Sirs,
    I am following the example in the "Enterprise Java Beans manual" to use Jdeveloper to create the Hello World EJB described in appendix B.
    My EJB is deployed successfully but when I run the client I get "ClassNotFoundException: hello.HelloHomeHelper".
    I imagine that the computer is trying to load the HelloHomeHelper.narrow method to properly case the call to the create method of my EJB. But such class only gets created when you use the wizard "Generate CORBA Server classes". But I cannot do that since I am not extending org.omg.CORBA.Object object. Rather the EJB I am implementing implements the "SessionBean".
    So why I am having CORBA-related problems with EJB?
    thanks.

    Hi,
    I have the same problem with bc4j deployed on Oracle 8.1.7 as session EJB.
    I'm testing the deployed bc with a client code. I have the following problem on the lookup method:
    avax.naming.NamingException: Unknown reasons. Root exception is
    java.lang.ClassNotFoundException: vebs.jbo.common.ejb.VeAppModuleHomeHelper
    void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.initRemoteHome()
    void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.<init>(oracle.jbo.JboContext, java.lang.String)
    oracle.jbo.common.JboHome oracle.jbo.client.remote.ejb.aurora.AuroraEJBInitialContext.createJboHome(java.lang.String)
    java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void bctest.main(java.lang.String[])
    but if I see in the Oracle db, the class is exported.
    Help me!!

  • Stateless ejb doesn't insert row

    Hi
    When I generate stateless jsp pages for AM deployed on 8i ejb, it cannot insert a new record. However if I make statefull pages - everything is fine. Also it works in tester.
    Also with Local deployment both types of jsp generation (statefull and stateless) works fine.
    Please help.
    Err message that I am getting is:
    Error Message: Caught RuntimeException in remote method; nested exception is: java.lang.NullPointerException:null Remote Stack Trace: java.lang.NullPointerException at java.lang.String.length(String.java) at java.io.DataOutputStream.writeUTF(DataOutputStream.java) at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java) at oracle.jbo.common.PiggybackExceptionEntry.writeObject(PiggybackExceptionEntry.java:96) at java.lang.reflect.Method.invoke(Method.java) at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java) at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java) at oracle.jbo.common.PiggybackOutput.getPiggybackStream(PiggybackOutput.java:128) at oracle.jbo.server.remote.ejb.EJBApplicationModuleImpl.processException(EJBApplicationModuleImpl.java:1893) at oracle.jbo.server.remote.ejb.EJBApplicationModuleImpl.riRowOperation(EJBApplicationModuleImpl.java:536) at oracle.aurora.ejb.gen._test_scott_ejb_colojbo101.colo.EjbObject_Remotecolo.riRowOperation(oracle/aurora/ejb/gen/_test_scott_ejb_colojbo101/colo/EjbObject_Remotecolo:3228) at colojbo101.common.ejb._tie_Remotecolo.riRowOperation(_tie_Remotecolo.java:1807) at oracle.jbo.common.remote.ejb._RemoteApplicationModuleImplBase._execute(_RemoteApplicationModuleImplBase.java:3109) at colojbo101.common.ejb._RemotecoloImplBase._execute(_RemotecoloImplBase.java:151) at com.visigenic.vbroker.orb.SkeletonDelegateImpl.execute(SkeletonDelegateImpl.java) at oracle.aurora.server.GiopProtocolAdapter.doRequest(GiopProtocolAdapter.java) at com.visigenic.vbroker.orb.GiopProtocolAdapter.dispatchMessage(GiopProtocolAdapter.java) at oracle.aurora.server.ThreadSessionDispatcher.run(ThreadSessionDispatcher.java) at oracle.aurora.server.VCIiopConnection.processRequest(VCIiopConnection.java) at oracle.aurora.server.GiopServer._service(GiopServer.java) at oracle.aurora.server.GiopServer.service(GiopServer.java) at oracle.aurora.net.VirtualCircuit.processRequest(VirtualCircuit.java) at oracle.aurora.net.Presentation.handleRequest(Presentation.java)
    null

    Hi,
    We had the same problem.
    1. Permissions.
    2. Growth of the User table space not catered for. (Too small)
    Hope this helps.
    Buks

  • 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

  • Java.rmi.RemoteException: Error initializing ejb-module java.lang.NoClassDe

    Hi,
    I have an ear file which has ejb jar and war file. Application is running fine through Jdeveloper but when am trying to deploy it in Oracle Application Server 10g getting following error. Any help in this would be appreciated.
    Deployment failed: Nested exception
    Resolution:
    Base Exception:
    java.rmi.RemoteException
    deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Error loading class 'ge.model.common.ejb.ReserveAccountBean': java.lang.NoClassDefFoundError: ge/common/exception/dao/GEDAOException. deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Error loading class 'ge.model.common.ejb.ReserveAccountBean': java.lang.NoClassDefFoundError: ge/common/exception/dao/GEDAOException
    Thanks and Regards,
    Ujwala

    Ujwala,
    I don't think classes in the "ejb.jar" file can access classes in the WAR file (and vice-versa). Perhaps you can put this class in a separate JAR file and put that JAR file in the "applib" subdirectory (of your OC4J installation). Then it will be accessible to all your J2EE applications deployed to OC4J.
    Good Luck,
    Avi.

  • Call an Application Module deployed as EJB into JServer from a client

    Hi all,
    I've successfully deployed a BC4J Application Module as EJB Session Bean into Oracle8i 8.1.6.
    The deployment descriptor (file LoginModule.dd) starts with the foolowing lines:
    Session Bean ricercalista.server.ejb.LoginModuleServerEJB
    BeanHomeName = "/test/omero/ejb/ricercalista.LoginModule";
    HomeInterfaceClassName = ricercalista.common.ejb.LoginModuleHome;
    RemoteInterfaceClassName = ricercalista.common.ejb.RemoteLoginModule;
    The client code that calls the EJB is:
    import oracle.jbo.*;
    import java.util.Hashtable;
    import javax.naming.*;
    import oracle.jbo.JboContext;
    import ricercalista.common.*;
    import ricercalista.common.ejb.*;
    import ricercalista.UserProfile;
    public class ProvaEJBLogin {
    public static void main(String[] args) throws Exception {
    final String AMDefName = "ricercalista.LoginModule";
    final String Username = "omero";
    final String Password = "omero";
    final String DBUrl = "jdbc:oracle:thin:omero/omero@localhost:1521:OMERO";
    try {
    Hashtable env = new Hashtable(10);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_ORACLE8I);
    env.put(JboContext.HOST_NAME, "bacco08.csr.unibo.it");
    env.put(JboContext.CONNECTION_PORT, "2481");
    env.put(JboContext.ORACLE_SID, "OMERO");
    env.put(JboContext.APPLICATION_PATH, "test/omero/ejb");
    env.put(JboContext.SECURITY_PRINCIPAL, Username);
    env.put(JboContext.SECURITY_CREDENTIALS, Password);
    Context ic = new InitialContext(env);
    LoginModuleHome home = (LoginModuleHome) ic.lookup(AMDefName);
    LoginModule myejb = (LoginModule) home.create();
    myejb.getTransaction().connect(DBUrl, Username, Password);
    myejb.setUser("turronic", "chris");
    System.out.println((String) myejb.getCognome());
    System.out.println((String) myejb.getNome());
    UserProfile up = myejb.getUserProfile();
    for (int i = 0; i < up.size(); i++) {
    System.out.println("dominio = " + up.getCodeDomain(i) + " grado = " + up.getInterestDegree(i));
    myejb.getTransaction().disconnect();
    myejb.remove();
    catch (NamingException ne) {
    System.out.println("Unable to find application " + AMDefName);
    ne.printStackTrace();
    catch (ApplicationModuleCreateException e) {
    System.out.println("Unable to create application module " + AMDefName);
    e.printStackTrace();
    When I run this client, I find the following error:
    "D:\Program Files\Oracle\JDeveloper 3.1.1.2\java1.2\jre\bin\javaw.exe" -classpath "D:\Program Files\Oracle\JDeveloper 3.1.1.2\myclasses;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbojdbcpatch.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboorasql.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbodatum12.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jdev-rt.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\jdbc\lib\oracle8.1.6\classes12.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\connectionmanager.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbomt.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboremote.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jndi.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\xmlparserv2.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\javax_ejb.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboremoteejb.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora_client.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjorb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjapp.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbohtml.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboo8i.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\jswdk-1.0.1\lib\servlet.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Test.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Jelly.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Juggler.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Misc.jar;D:\Program Files \Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Molecule.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\samples\borland\samples\bdk\Buttons.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\classgen.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboejb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora_client.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjorb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjapp.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\javax_ejb.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjtools.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbj30ssl.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\sqlj\lib\translator.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jboremote.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbo8iclient.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\aurora_client.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjorb.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\aurora\lib\vbjapp.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jndi.jar;D:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jbodatum12.zip;D:\Program Files\Oracle\JDeveloper 3.1.1.2\java1.2\jre\lib\rt.jar" ricercalista.ProvaEJBLogin
    Diagnostics: Silencing all diagnostic output (use -Djbo.debugoutput=console to see it)
    Unable to find application ricercalista.LoginModule
    [Root exception is java.lang.ClassNotFoundException: ricercalista.common.ejb.LoginModuleHomeHelper]javax.naming.NamingException: Unknown reasons
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.initRemoteHome()
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.<init>(oracle.jbo.JboContext, java.lang.String)
    oracle.jbo.common.JboHome oracle.jbo.client.remote.corba.aurora.AuroraInitialContext.createJboHome(java.lang.String)
    java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void ricercalista.ProvaEJBLogin.main(java.lang.String[])
    What's wrong in my code? Are the Context Properties set correctly? The test on this Application Module works fine. So what's the problem?
    I need your help!
    Tnx!
    null

    I've added libraries LoginModuleEJBClient.jar and EJBGenerated.jar to the client project.
    The error isn't the same, but the following:
    Diagnostics: Silencing all diagnostic output (use -Djbo.debugoutput=console to see it)
    Unable to find application ricercalista.LoginModule
    javax.naming.NamingException. Root exception is java.lang.ClassCastException
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.initRemoteHome()
    void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.<init>(oracle.jbo.JboContext, java.lang.String)
    oracle.jbo.common.JboHome oracle.jbo.client.remote.corba.aurora.AuroraInitialContext.createJboHome(java.lang.String)
    java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void client.LoginClient.<init>()
    void client.LoginClient.main(java.lang.String[])
    Why is there a ClassCastException?
    Tnx in advance for your help.

  • Ejb, bc4j, client, NamingException

    JDeveloper 3.1.1.2
    Oracle 8i EJB
    I have successfully deployed my appModule to the database (test worked)
    Now I try to connect to the deployed module from my client application.
    I made following changes to my code:
    sessionInfo1.setAppModuleInfo(new ModuleInfo("dbcPck", "MtnCountriesAppModule"));
    sessionInfo1.setConnectionInfo(new EjbConnection("IIOP_DBC",
    "test/IPS_DBC/ejb"));
    javax.naming.NamingException: Unknown reasons. Root exception is java.lang.ClassNotFoundException: dbcPck.common.ejb.MtnCountriesAppModuleHomeHelper
    void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.initRemoteHome()
    etc
    I put the two generated jars in a lib and added the lib to the project
    Any suggestions?
    Lonneke

    Never mind, I forgot to include the generated clientjar in my clientproject...
    null

  • EJB Design Query

    We have App A and App B which both need to access some common business objects. These business objects contain logic required to perform a specific function. Currently these are POJO's, and the access to them is done remotely by the applications via Stateless Session Beans. Currently we have 1 SSB per application. Some of these SSB's make the same method invocations on the business objects. It was a design assumption that when application logic was required it would be placed in the application specific SSB. Is this correct?, or should the SSB be generic ? containing generic methods to access the business objects? If there should be generic methods, how do we cater for the situation in which App B required different functionality to App B?

    To try and make my query more specific, lets look at 2
    scenarios.
    Well you said you had POJOs. If you are converting to EJBs then the code should probably be the same unless you intend to run different servers.
    Scenario 1:
    Lets assume that both apps call seperate EJB's with
    the same method signature but the implementation
    differs. Are you saying that this is OK, but not OK if
    we provide special cases within a shared/common EJB
    for the two applications?.
    For an EJB you would add a different signature. For POJOs then there is nothing at all shared so the point should not even come up.
    Scenario 2:
    Assume that the two seperate EJB's have the same
    method signatures and have the same implementation,
    which is to simply call methods in the common java
    business objects. In this case should the EBJ's be a
    common/shared EJB, even if we do not know if in the
    future they will differ (as in scenarion 1)?.For an EJB then you should be using the same server and thus the same EJB.
    For POJO if there is only one shared method in all of the code then I would keep them seperate. If you have hundreds then you need to start considering whether a common code base is needed (given the points I listed before.)

  • Error when deploying EJB Session Info to 8.1.7 DB

    Hi all,
    I'm trying to make a deploy of BC4J project into Oracle 8.1.7 database with JDeveloper 3.2.2. When I try to deploy all the project, I get an oracle error and I'm disconnected from the database: "end of file on communication channel". java_pool_size paramete has a value of 70 Mbytes in database.
    But when I'm trying to make a deploy of files generated by deployment profile, I get oracle's errors in <appModuleName>OrcleServerEJB.prf file deployment:
    Error while granting to <package>/common/ejb/<appMod>Home
    ORA-04042: package, procedure or function does not exists.
    Error while resolving class <package>/common/ejb/<appMod>Home
    ORA-04043: object /6d1c81a7_<appModName>ModuleHome does not exist.
    Any ideas?
    Thanx in advance.

    Reason: database keeps a reference of the class in JAVA$CLASS$MD5$TABLE table. This table keeps a refrence to all java classes loaded in database, and is present in each schema you deploy classes. That's the reason why if you change the application module name, you can load this classes. It instead keeps a reference if you use DROP JAVA CLASS command to drop a java class from de database. Use DROP JAVA command to clear the reference of the dropped classes when dropping it.
    You can see this table as a class dictionary of the database, and you don't have to handle this records manually.

  • EJB deployment problems

    I'm trying to deploy my business component as an EJB to Oracle 8.1.7. Actually, it deploys with no errors. When I test the module by setting the middle tier type to Local, it works fine. But, when I set the middle tier type to EJB, I can't see any data when I try to show my business component view.
    So, I tried to deploy my applet and run it against the EJB, but I get an error in a Panic dialog box that says "Unknown service::session0". The details say
    "DAC-405: SessionInfo:Application module creation failed; className: MyBcModule
    Unknown service::session0
    At the same time, the message view shows the following:
    oracle.dacf.dataset.DataSourceOperationException: SessionInfo: Application module creation failed; className: MyBcModule
    void oracle.dacf.dataset.ProducerObject.open(boolean)
    void oracle.dacf.dataset.SessionInfo.publishSession()
    void EISGui2.EISGuiApplet2.init()
    void sun.applet.AppletPanel.run()
    void java.lang.Thread.run()
    The applet will run just fine when I set the session object to a local deployment type. I went through the trouble shooting stuff in the online help made sure my java_pool_size was set to at least 50MB, and that I have no unresolved java classes on the server. But, it still won't work. Are there any suggestions on what else I can try?

    Of course, now I have other problems. After successfully redeploying my new business component as an EJB, and testing the application module successfully as an EJB middle tier server type, I created a new project as described in the online help under "Testing a Business Components EJB Deployed to Oracle8i with a Code Client." I followed the online help's instructions dilligently. Does it work? Of couse not. I'm turning on debugoutput with -Djbo.debugoutput=console so I can get more information, but that information isn't helping me. Refering back to the online help's code, it's crashing on the "ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(DeployedMod)" line. Here's my exception stack:
    [00] Diagnostic Properties: Timing:false Functions:false Linecount:true Threshold:6
    [01] CommonMessageBundle (language base) being initialized
    [02] Stringmanager using default locale: 'null'
    [03] BC4JDeployPlatform: Ejb
    [04] Connected to Service:sess_iiop://fredws:2481:ORCL
    [05] Logging in...
    javax.naming.NamingException: Unknown reasons. Root exception is
    java.lang.ClassNotFoundException: EisBc.common.ejb.EisBcModuleHomeHelper
    void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.initRemoteHome()
    void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.<init>(oracle.jbo.JboContext, java.lang.String)
    oracle.jbo.common.JboHome oracle.jbo.client.remote.ejb.aurora.AuroraEJBInitialContext.createJboHome(java.lang.String)
    java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void tester.EisBcTester.main(java.lang.String[])
    Now, how can the EJB tester work, but my code can't find the helper class? I know my JNDI path is correct. I've checked to make sure that the EisBc.common.ejb.EisBcModuleHomeHelper class actually exists in the database and is valid. I've run java2perm.sql to grant permissions to my user. And, my java_pool_size is over 60MB.
    This is frustrating. Did I see a thread about someone wanting to go back to VB...

  • Unable to deploy an EJB session Bean

    I run with JDeveloper 3.1, Oracle8.1.6 on windows NT.
    All steps to deploy the Business Logic Tier work fine except the last one when to deploy
    using the deployment profile; I' ve got the following error in the debug window:
    (last lines of the debug)
    Generating Jar File...done
    Loading EJB Jar file and Comm Stubs Jar file...done
    Generating EJBHome and EJBObject on the server...
    An exception occurred during code generation: Class not found: DpltBcPkg.common.ejb.DpltBcPkgModuleHome.class
    *** Errors occurred while deploying the EJB to JServer ***
    *** Deployment completed ***
    Help will be greatly appreciated, thanks in advance

    Jean-Yves,
    The class that the deployment wizard can't find should have been created when you made your application module remotable. So you should check the following:
    - Did you make your application module remotable? (edit the application module and select the "Remote" tab; complete instructions are in the online help).
    - Did you rebuild your application after making your application module remotable?
    When you make your application module remotable, the node for Common->ejb->DpltBcPkgModuleHome.java should show in the navigator pane.
    Blaise

Maybe you are looking for

  • "multiple users" on the same computer

    I'd like to access the same project with different users on the same computer. Getting the permissions setup for the folders and files was not a problem. But ... FCPX is not "seeing" the projects and events created by the other user; 1) They don't sh

  • Moving music from old PC to new Macbook

    Just got a new home PC, so all my music was deleted from it. I also just got a new MacBook. All my music is on my ipod, is there anyway I can transfer the music from my ipod to my mac, bearing in mind it is formatted for a PC?

  • Acrobat 8.0 Printing Problem?

    I am having a problem using Acrobat 8.0, updated, and printing a pdf document from IE 8 or 9.  I am using Windows Vista, updated. The problem I am having is when I attempt to print a web page thru the Adobe printer the titling and oulining of the pag

  • Dynamic file and variable substitution

    Hi Experts, I am working on a scenario where filename is reading from payload.based on header value ,i am creating file along with item records.I did variable substitution also.whenever header value changes ,a new file shud be created. I placed two r

  • Html code for quicktime audio stream

    I am looking for the html code to play mp3-audio files on a website. I used to write it with the <embed>-tag, but this does not work in modern browsers like firefox 8 or opera 11.5. Perhaps someone can help me. Thanks in advance.