Create session bean using interfaces, not implementation classes

Hi,
I'm using interfaces and session beans for my persistence/data layer in my adf application.
I've created a data control for my session bean and during creation of this data control, javabean.xml files are created for the different interfaces that are used in my session bean.
If I create bindings on these methods, interfaces in jspx-documents I will get errors because he can't find the impl-classes that implement these interfaces.
When using interfaces in your session bean (as return values or parameters) instead of classes you need to manually create javabean.xml files for the implementation classes.
It's required by the databindings/datacontrol that the implementation-classes are described in a javabean-format as well? Is this a spec we need to adhere to?
Could someone verify that you need to create javabean.xml-files for as well the interfaces as the classes when you're working with interfaces in your session beans?
regards,
Nathalie

A patch was released by Oracle to be able to work with Interfaces and so it's not required to work with implementation-classes.
Patch for 5726754(Base bug 5657179)

Similar Messages

  • Retrieve used interface from implementation class

    Hi to everyboby
    I have a remoteObject that implement 2 interface (I1, I2). These interfaces are child of common father interface (I0).
    This remote object is received unmarshalled and casted to one of the to directly implemented interface I1 or I2,
    After that I want to execute a method declared into the interface I0 on the server side, that prints out the name of the interface used during casting after the unmarshall operation on the client side.
    How can I retrieve the name of the current interface used to refer the object into the client side, from the server side?
    Anyone as suggestions?
    thank you very much
    Edited by: dj3mb3 on Jun 10, 2010 5:49 AM

    I'll try to explain in a better way ...
    I have a server with 2 different client and each client communicate to the server with a different interface.
    My needs are to recognize from the server, the type of the client that are operating, and to do this I was thinking to recognize the interface used from the client to interact with the server
    An other option is that, from the client, after retrieving the server and it's cast, a can call a method to pass to the server object, the type of the interface actually used.
    But I think this makes a bit of nonsense because When I receive the marshalled object in my opinion doesn't make sense that i have to say the object it's type (the interface used).
    the object is already alive and I think it has to know the interface used to refer it even if is on another VM
    The cast operation doesn't store nothing into the current object instance?
    local code example (I don't know if with JRMI the situation is different because the different JVM)
    Map foo = new HashTable();
    I need a method like
    foo.curretUsedInterface() ... that return "Map"
    instead of
    foo.getClass().getName() that return "HashMap"
    It's possible to obtain this information or I have to try another idea to make the server distinguish the client type?
    thank you very much for your comprehension

  • Pattern b/w Remote interface & Container implementation  class

    Which pattern is followed by EJB Remote interface & Container implementation class of that interface?Is there anyting mentioned in specs?
    This questoin was asked to me by many people.I think it is Command design pattern as it hides away all the details of actual business implementation.but at same time I doubt if it is Facade?
    Anyone who knows about this?
    Thanx in advance
    Sidhu

    Rarely is software represent a single pattern, it typically represents multiple patterns.
    Which pattern is followed by EJB Remote interfaceThe remote interface is an example of a facade pattern. This presents a public interface which is an abstraction of the real interface.
    Container implementation class of that interface? The implementation is an example of what I think of as a double proxy pattern. That is acting as two distinct proxies. The first being the the remote callingof EJB standard functions via the Skelton implementation. I.E. The underlying EJB/RMI interface. The Second being a application level proxying of the business logic seen in most RL implementation.
    The use of an UID ID beans is an example of a memento.
    I think it is Command design pattern as it hides away all the
    details of actual business implementation.Not directly, though an AppServer programmer may use the Command Pattern to resolve the remote connections. The User Application Programmer may also use this pattern. The key element of Command Pattern is the Invoker executing an concrete class via abstraction or interface of a polymorphic class. You can think of this as a specialisation of the
    Martin

  • Error when Create Session Bean in JDeveloper

    Hi All,
    I followed the steps in the SRDemo tutorial to create Session bean SRPublicFacade. I used Create Session Bean wizard. Step 1 was ok. Step 2 when it's supposed to show all the POJOs and all methods (from Queries) it hang there, and skipped to Step 3 and so on... As a result I had an empty Session Bean with only class name and no methods in it. I do have correct database connection, and I have another project with similar Session Bean sucessfully. I just don't know what happened to this project or the way I created session bean this time. Any conflict when create Session Bean to the same database or something(?) Anyone has any idea please let me know.
    Thank you very much,
    John

    Frank,
    Yes, I compiled the project before building the session facade. I used JDeveloper 10.1.3.3.0
    The thing is I once created successfully the session facade in another project, like SRdemo. Now I would like to repeat that in another project say SRdemo2, then it went wrong. It skipped step 2 in the wizard and look like it cannot detect the tables and named queries.
    Thanks,
    John

  • Could not access Local Session Bean using JNDI lookup

    Hi EJB Guru,
    I am quite new to EJB 3.0 but have had a good deal of success including using JNDI to lookup Remote Stateless Session Bean in EJB 3.0. However, looking up local Stateless Session Bean prove more challenging with I had anticipated.
    Here is my code
    as follows:
    public interface Calculator {
        public int add(int x, int y);
        public int subtract(int x, int y);
    import javax.ejb.Remote;
    @Remote
    public interface CalculatorRemote extends Calculator {
    import javax.ejb.Local;
    @Local
    public interface CalculatorLocal extends Calculator {
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import bean.CalculatorLocal;
    import bean.CalculatorRemote;
    @Stateless
    public class CalculatorBean implements CalculatorRemote, CalculatorLocal {
        public int add(int x, int y) {
            return x + y;
        public int subtract(int x, int y) {
            return x - y;
    import bean.*;
    import bean.Calculator;
    import bean.CalculatorLocal;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class ClientAccessLocalCalculator {
        public static void main(String[] args) throws NamingException {
            InitialContext ctx = new InitialContext();
            CalculatorLocal calculator = (CalculatorLocal) ctx.lookup("CalculatorBean/local");
            System.out.println("1 + 1 = " + calculator.add(1, 1));
            System.out.println("1 - 1 = " + calculator.subtract(1, 1));    }
    import bean.Calculator;
    import bean.CalculatorRemote;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class ClientAccessRemoteCalculator {
        public static void main(String[] args) throws NamingException {
            InitialContext ctx = new InitialContext();
            CalculatorRemote calculator = (CalculatorRemote) ctx.lookup("CalculatorBean/remote");
            System.out.println("1 + 1 = " + calculator.add(1, 1));
            System.out.println("1 - 1 = " + calculator.subtract(1, 1));    }
    }Output when running ClientAccessRemoteCalculator gives
    1 + 1 = 2
    1 - 1 = 0
    Output when running ClientAccessLocalCalculator on JBoss AS 4.0.5 gives:
    Exception in thread "main" javax.ejb.EJBException: Invalid invocation of local interface (null container)
    at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
    at $Proxy0.add(Unknown Source) at ClientAccessLocalCalculator.main(ClientAccessLocalCalculator.java:14)
    JNDIView in JMX-Console in JBoss:
    +- CalculatorBean (class: org.jnp.interfaces.NamingContext)
    | +- local (proxy: $Proxy84 implements interface bean.CalculatorLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
    | +- remote (proxy: $Proxy83 implements interface bean.CalculatorRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    Output when running ClientAccessLocalCalculator on SJSAS 9.0 gives:
    Exception in thread "main" javax.naming.NameNotFoundException: bean.CalculatorLocal not found
    C:\>asadmin
    Use "exit" to exit and "help" for online help.
    asadmin> list-jndi-entries
    Jndi Entries for server within root context:
    bean.CalculatorRemote: javax.naming.Reference
    jbi: com.sun.enterprise.naming.TransientContext
    jdbc: com.sun.enterprise.naming.TransientContext
    UserTransaction: com.sun.enterprise.distributedtx.UserTransactionImpl
    bean.CalculatorRemote__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
    bean.CalculatorRemote#bean.CalculatorRemote: javax.naming.Reference
    ejb: com.sun.enterprise.naming.TransientContext
    Command list-jndi-entries executed successfully.
    asadmin>I am using Application Client to lookup these Session Beans on Netbeans 5.5, JBoss AS 4.0.5 (EJB3 installer)/SJSAS
    9.0, SDK 1.5.0_11 on Windows XP platform.
    Any assistance would be much appreciated.
    Many thanks,
    Henry

    Hi Henry,
    Any direct global JNDI lookup is not portable. It works in some cases but not in others, which
    is why we recommend using the portable Java EE approach of declaring an ejb dependency
    and looking up that dependency via the bean's component environment (java:comp/env).
    This is true whether you're dealing with Remote or Local ejb dependencies.
    Local ejbs are not supported in the Application Client tier at all. In the server tier, there is no
    guarantee that a Local EJB even is assigned a global JNDI name since there's no requirement
    that it be available outside of the application in which the ejb is defined.
    You can find more information on these ejb access topics in our EJB FAQ :
    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

  • How to run a client program in Session bean using weblogic 8.1

    Hi
    I am new to weblogic server 8.1. I sucessfully deployed session ejb Session Bean. I created sessionbean jar file and put it it classpath also.
    and also i created sessiobeanclient jar file, it included in class path.
    While running client program it throws exception like noclass def found exception
    plz tell me the right way to run the session ejb program.
    bye

    Hi,
    You have to follow the given steps before you are going to run the client program that invokes the session bean .
    1)set the Weblogic Environment using the tool setWLSEnv
    2)place the Session bean jar file in classpath
    3)run the client program
    Note:If the client has to execute on remote machine we need to copy client class,remote interface, home interface and other classes which are used as
    parameters and return types.
    Regards
    Anilkumar kari

  • Stateful session Bean in Model not working

    I made a sample application very very simple, and the weblogic server cant find the @stateful annotation on the class. is it there another possibility? here i post the error i get:
    [Running application MyTest1 on Server Instance IntegratedWebLogicServer...]
    [09:48:51 PM] ---- Deployment started. ----
    [09:48:51 PM] Target platform is (Weblogic 10.3).
    [09:48:52 PM] Retrieving existing application information
    [09:48:52 PM] Running dependency analysis...
    [09:48:52 PM] Deploying 3 profiles...
    [09:48:53 PM] Wrote Web Application Module to /home/issanllo/.jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/MyTest1/ViewWebApp.war
    [09:48:53 PM] Wrote EJB Module to /home/issanllo/.jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/MyTest1/ModelEJB.jar
    [09:48:53 PM] Wrote Enterprise Application Module to /home/issanllo/.jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/MyTest1
    [09:48:53 PM] Deploying Application...
    <03-jun-2010 21H48' CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1275594533727' for task '2'. Error is: 'weblogic.application.ModuleException: Exception preparing module: EJBModule(ModelEJB.jar)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..'
    weblogic.application.ModuleException: Exception preparing module: EJBModule(ModelEJB.jar)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: java.io.IOException: No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:219)
         at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
         at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1210)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:382)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         Truncated. see log file for complete stacktrace
    >
    <03-jun-2010 21H48' CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'MyTest1'.>
    <03-jun-2010 21H48' CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Exception preparing module: EJBModule(ModelEJB.jar)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: java.io.IOException: No EJBs found in the ejb-jar file {0}. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:219)
         at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
         at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1210)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:382)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         Truncated. see log file for complete stacktrace
    >
    #### Cannot run application MyTest1 due to error deploying to IntegratedWebLogicServer.
    [09:48:54 PM] #### Deployment incomplete. ####
    [09:48:54 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    [Application MyTest1 stopped and undeployed from Server Instance IntegratedWebLogicServer]
    and the very simple class with a Local and Remote interfaces at Model project in jDeveloper 11g (11.1.1.3)
    package test.core;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateful;
    @Stateful(name = "ControlSessionBean", mappedName = "MyTest1-Model-ControlSessionBean")
    public class ControlSessionBean implements ControlSessionRemote,
    ControlSessionLocal
    private String username;
    private String password;
    public ControlSessionBean()
    public List simple()
    List <String> s = new ArrayList();
    s.add(username);
    s.add(password);
    return s;
    any suggestions why it is not working??
    sincerely
    Israel S Llorens

    not working... i tried to make the stateful session bean Control.. and is still not working the error i get now is this one:
    <04-jun-2010 16H29' CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1275661769594' for task '9'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160200]Error resolving ejb-ref 'gecu.view.LoginBean/controlBean' from module 'GeCU_Web_view_root' of application 'GeCU_Web'. The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because no EJBs in the application were found to implement the 'gecu.model.ControlSession' interface. Please link or map this ejb-ref to its target EJB and ensure the interfaces declared in the ejb-ref are correct.
         at weblogic.deployment.BaseEnvironmentBuilder.autowireEJBRef(BaseEnvironmentBuilder.java:427)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:502)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    <04-jun-2010 16H29' CEST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'GeCU_Web'.>
    <04-jun-2010 16H29' CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'GeCU_Web'.>
    <04-jun-2010 16H29' CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160200]Error resolving ejb-ref 'gecu.view.LoginBean/controlBean' from module 'GeCU_Web_view_root' of application 'GeCU_Web'. The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because no EJBs in the application were found to implement the 'gecu.model.ControlSession' interface. Please link or map this ejb-ref to its target EJB and ensure the interfaces declared in the ejb-ref are correct.
         at weblogic.deployment.BaseEnvironmentBuilder.autowireEJBRef(BaseEnvironmentBuilder.java:427)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:502)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    [04:29:35 PM] #### Deployment incomplete. ####
    [04:29:35 PM] Remote deployment failed

  • Making AQ usage transactional across session beans, using mosly JMS syntax

    I need to determine what I need to have in place in order for JMS/AQ messages to be "fully transactional".
    I have a J2EE server application that will send JMS/AQ messages to a queue. I have a standalone application that reads messages from the queue, does some work, and then makes calls on multiple session beans (hosted in the original J2EE server application). Actually, it would likely be multiple calls to the same session bean method.
    Once the standalone application reads a message from the queue, I need to ensure that if any action performed as a result of that message fails, that all the operations performed, including the removal of the message from the queue, are rolled back.
    First of all, if I use an Oracle XA-compliant datasource, if one of the session bean calls fail, I can rollback the current transaction, but will this properly roll back any work that earlier session bean calls (made on the same transaction) did, even if they were successful (at the time)? Note that I have two JVMs, one running the J2EE application, and the other a standalone application reading from the queue.
    Second, on committing or rolling back the message retrieval itself, I noticed from examples in the Oracle AQ Application Developer's Guide that if I create my QueueSessions with "AQDriverManager.createAQSession()", that I can pass a Connection object, and then later "commit" or "rollback", manually, perhaps if I got an EJBException from a session bean call.
    However, I am trying to write my JMS/AQ code so that it uses as little of the direct AQ api as possible, staying with the standard JMS api. As a result, I'm using the JMS version of this, which is "QueueConnection.createQueueSession()". When I do this, however, it seems as if I lose control over the transaction.

    Ok, I think I've answered some of this for myself, but I still have some concerns.
    I see that the QueueSession object that I get back from "queueConnection.createQueueSession()" is likely going to actually be an instance of the "AQjmsSession" class, so I can cast to that, and then I can call "commit" or "rollback".
    What is unclear from the javadoc description is what happens when "close()" is called on the session object. Does this do an implicit "commit()", perhaps unless "rollback()" has already been called?
    I'm still a little uncertain about whether the scope of my transaction will be wide enough to protect everything that needs to be protected.
    For instance, I assume that my transaction starts when my consumer (not in an application server) reads the message from the queue. At that point, my consumer does some "screen-scraping" work. When it's done, it will call a session bean on the application in the application server (separate JVM, in other words), which will create some EJB entity objects and also insert raw database rows. The session bean will then return, and then the original method which read a message from the queue will be completed.
    What I need to know is what will happen if ANYTHING in that process fails, either in the external consumer, or in the session bean, or creating EJB entities? That is, will the entire transaction be rolled back, undoing the EJB entity creations AND the removal of the message from the message queue?
    If this can possibly work, I'm assuming this would be utilizing an XA datasource, or a non-emulated data source (which I think means the same thing).

  • Question about the Create Session Bean Wizard

    Hi,
    I'm using the Session Bean Wizard to generate a session facade in EJB 3.0. In step 2 «choose methods to expose through this facade», I only see 2 methods generated for each entity: findAll and remove.
    When I click Help on this page, the documentation specify the following:
    «Use the tree control to specify the core methods and entity methods you want to generate. Core Facade Methods Theese methods are used for basic CRUD (create, read, update, delete) functionality. »
    So why is the wizard only offering to generate findAll and remove?
    Also the remove method generated does not seem to delete anything as in the following :
    public void removeDcaRole(DcaRole dcaRole) {
    final EntityManager em = getEntityManager();
    try {
    final EntityTransaction et = em.getTransaction();
    try {
    et.begin();
    dcaRole = em.find(DcaRole.class, new DcaRolePK(dcaRole.getDcaNo(), dcaRole.getTRoleCode()));
    et.commit(); // where is the delete ???
    } finally {
    if (et != null && et.isActive()) {
    et.rollback();
    } finally {
    if (em != null && em.isOpen()) {
    em.close();
    Can I use the remove method as a starting point to an update ?
    Any comment on this would be appreciated.

    There are update and insert methods under the "core" section/
    See this image : http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/images/b20105.gif
    You might want to follow this tutorial to see how it works:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm#t4

  • Help creating session bean

    Hi, I am trying to create a stateful session bean which connects to a database and returns the result set from a table. Can you please give me some steps to 1. How to create a stateful session bean 2. How to connect to a database 3.write a query 4. Display the result set 4. How to deploy it on the EJB server. It will be very helpful for me if there is any example. Thanks.

    Return types and parameters types of an EJB mothod must implement java.io.Serializable interface, and java.sql.ResultSet doesn't implements this interface.So you cant use it as an EJB method's return type.
    Fil

  • Problem calling entity bean from session bean using sun one app server

    Hi,
    I am getting the following exception while calling entity bean(bmp) from stateless session(cmp)bean.
    SEVERE: IOP5012: Some runtime exception ocurred in IIOP: [javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: Unable to create reference org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 1015 completed: No]
    SEVERE: IOP5013: Unable to create reference: [org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 1015 completed: No]
    SEVERE: EJB5029: Exception getting ejb context : [CustomerEJB]
    SEVERE:
    WARNING: CORE3283: stderr: javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
    WARNING: CORE3283: stderr: org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
    WARNING: CORE3283: stderr: at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:114)
    WARNING: CORE3283: stderr: at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.wrapException(Util.java:358)
    WARNING: CORE3283: stderr: at javax.rmi.CORBA.Util.wrapException(Util.java:277)
    WARNING: CORE3283: stderr:
    My primary key implementation is
    public class CustomerEJBKey implements java.io.Serializable {
    static final long serialVersionUID = 3206093459760846163L;
    public String customerId;
    public DBConfigBean dbConfigBean;
    * Creates an empty key for Entity Bean: CustomerEJB
    /*public CustomerEJBKey() {
    public CustomerEJBKey(String customerId,DBConfigBean dbConfigBean){
    this.customerId = customerId;
    this.dbConfigBean = dbConfigBean;
    public String getCustomer(){
    return customerId;
    public DBConfigBean getDBConfigBean(){
    return dbConfigBean;
    * Returns true if both keys are equal.
    public boolean equals(Object key) {
    if(key instanceof CustomerEJBKey)
    return this.customerId.equals(((CustomerEJBKey)key).customerId) &&
    this.dbConfigBean.equals(((CustomerEJBKey)key).dbConfigBean);
    else
    return false;
    * Returns the hash code for the key.
    public int hashCode() {
    return customerId.hashCode() + dbConfigBean.hashCode();
    and entity bean method invocation is,
    homeFactory = EJBHomeFactory.getInstance();
    home = (CustomerEJBHome) homeFactory.lookup(CustomerEJBHome.class);
    remote = (CustomerEJB) PortableRemoteObject.narrow( home.findByPrimaryKey(new CustomerEJBKey(customerId,dbBean)), CustomerEJB.class);
    This works fine in Websphere and JBoss. Do you have any idea why I am getting this exception?
    Appreciate your response.
    Regards,
    Sankar.

    My suggestion is to put some System.out.println() statements and see if the output helps in any way in debugging. I can't think of anything on the top of my head although I have been working lightly on SunONE.
    By the way, you referred the stateless bean as CMP. Just wanted to tell you that you are wrong. The terms CMP and BMP refer to persistence, which is applied to Database tables and not to stateless/stateful session beans which are written for some specific purpose independent of underlying database.

  • Session Bean Transaction Rollback not working for RuntimeException

    Hi,
    I am calling a number of JDBC create/update statements within a method in a container managed transaction stateless session bean with transaction attribute set to required. I am running the bean within the embedded OC4J supplied with JDeveloper 10g (10.1.2). For each JDBC call, i connect to a datasource via JNDI containg a pool of connections pointing to an Oracle 10g database (standard J2EE)
    If i throw a runtime exception within the method the transaction is NOT rolled back as it should be according to the EJB spec. However, if i setRollbackOnly() on the session bean SessionContext the transaction does roll back.
    Has anybody experienced this before?
    Is this an OC4J bug?
    Thanks
    Dave

    Generally, for urgent issues it's best to open a SR with Oracle Support rather than posting to the forums.
    enlist=dynamic didnt exist in 10.2.0.2.20, but does now. I can't recall what specific version it was introduced though.
    enlist=false prevents enlistment in MSDTC transactions, so thats why it's not rolling back in that case.
    "transaction branch length 90 is illegal" was a known issue on Vista, is that the OS you're using? It takes a two part fix, and It is resolved by
    1) getting up to 10204 ODP (apply the 10204 rdbms patch to your client install)
    2) applying SP1 for Vista
    Hope it helps,
    Greg

  • Connection Failure for JDBC system in Session Bean using JCA

    Hi,
    I am trying to write a session bean that runs a query
    against a JDBC system, but I keep seeing the following
    error in the default trace file in the J2EE log folder:
    14##0#0#Path##Java###Throwing
    #1#java.sql.SQLException: Invalid connection string
    attribute: Database name is required but not supplied#
    #1.5#
    This is the code, with the line marked (*) being the point where the exception is thrown:
    public void getConnection(String sURL, String sUser, String sPassword) {
    ManagedConnectionFactory mcf = null;
    IConnectionFactory cf = null;
    IConnectionSpec cs = null;
    try {
    mcf = new JDBCManagedConnectionFactory();
    cf = (IConnectionFactory) mcf.createConnectionFactory();
    cs = cf.getConnectionSpec();
    cs.setPropertyValue("UserName", "sa");
    cs.setPropertyValue("Password", "admin");
    cs.setPropertyValue"driver",
    "com.sap.portals.jdbc.sqlserver.SQLServerDriver");
    cs.setPropertyValue("url",
    "jdbc:sap:sqlserver://localhost:1433;DatabaseName=pubs");
    conn = cf.getConnectionEx(cs);  (*)
    I have tried adding another property value, like so:
    cs.setPropertyValue( "DatabaseName", "pubs");
    (or)  cs.setPropertyValue( "Database", "pubs" );
    but I still get the same exception. What does this
    exception really mean, what is missing from the
    configuration information ?
    Also, in the default trace file of the J2EE engine, the
    configuration information is printed out, but in an
    encrypted format, (see below), is it possible to have it
    print out this information in a readable format ?
    #1.5#005056A41E66006200000092000009AC000406E03C94F3D9#1133460065906#com.sap.portal.connectors.JDBC#sap.com/CFV3#com.sap.portal.connectors.JDBC#Guest#0####71758520629411daacf7005056a41e66#SAPEngine_Application_Thread[impl:3]_14##0#0#Info##Plain###UserName: ????n????????????????????d?????????????????????????????????????????????s???????????????????????????????????????????????0??????????????????????????????????????????????????h?????0??????R???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????s?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????c???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????u??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????c???????????????????????????????????????????c????????????????3?????????3????e??????????????????????????????????????????????????l???????0????????1????1?????????????????????????????????????????????????????????s?????p?????????????????????????????????????????????????????????????????6?????????????3??????????????s????????????????????t???????????s????????????????????????????????????????????????????????????????????????s????????????????????????????????????????????????????????s?????????????????????????????????g????????????????????????????????????????????????????????????????????????? Password: ******** URL: ???????????????n??????????????????????????????????????????????????????????????????????????0?????e??????????????????????????r?????????????s?????????????O??????????????2???????????7????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????:????5???T?????????????????????????l?????????1????????????????????????????????????????????????????????????????????????????2??????????????????????????????????????????????????????????????????????????????????????????????????h???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????a??????????????????????????????????????????????????????????????????????????????????????????????????S??????????????????????????????????????????????????????????????????????????????????2???????????????????????????u???????????????????????????????????????????????????????????????????????s???????????????????????????????????????????????????????????????????????????????????????????????s?????????????????????????????????????????.?????????????????????????????????????????????????????????????????1????????????????????????????????????l????5??????????? Driver: com.sap.portals.jdbc.sqlserver.SQLServerDriver#
    #1.5#0

    Hi Vladimir,
    thanks for your response. The reason I am accessing a
    JDBC source via JCA is to get a feel for how JCA works.
    What I ultimately want to do is construct a bean that can
    give queries to different kinds of sources; JDBC, and SAP
    (R3, CRM), and possibly sources like Siebel. For this, I
    believe I should use the Connector Gateway Service, as
    described in the "Using the JDBC Connector" and "Using
    the SAP Backend System Connector" sections of the SAP
    Portal Developer's Guide. But for now, my first approach
    was to use the approach described in "Connecting via
    J2EE" subsection of "Using the JDBC Connector" (see
    http://help.sap.com/saphelp_nw04/helpdata/en/30/a0f17aacb34b108b39a96acc33da3f/content.htm)
    Thanks,
    Colm.

  • Create Communication Component BS interfaces not loading

    Hello,
    I have created a communication component and assigned a business system in my new PI 7.1 system and unlike the other components I've create this Business System does not load with all the inbound and outbound interfaces.  When I open the Business System I see that both the inbound and outbound tab show 0 interfaces.
    Other Business Systems have loaded with the interfaces.  What might cause the interfaces for a business system not to load?
    Thanks,
    Matt

    Steps to recreate:
    1.  I create the design in IR using SWC SAP_SRM_SERVER_5.0 and COPICS_FTP_1.0.
    2.  I create a Receiver Determination in ID selecting Interface = DeliveryNotification_Out and Sender = SRM_SERVER_5.0.
    3.  I add COPICS_FTP_1.0 as the Configured Receiver.
    4.  I open the Configuration Overview and expand the arrow for the service COPICS_FTP_1.0.
    5.  Now the interface appears as DeliveryNotification_Out but I need to create the Receiver Agreement with COPICS_FTP_1.0 as COPICS_DeliveryNotification_In.
    6.  ...but PI does not allow me to change the interface.  When I try to create "New Specific" Receiver Agreement it autofills the incorrect interface and does not allow me to correct it. 
    What am I doing wrong?
    Thanks,
    Matt

Maybe you are looking for

  • Actvation problem DSO

    Dear all, we have written some logic in endroutine in transformation, the data floe is datasource->DSO(datasource having 10 fields in DSO we appended one fields to deriving the logic) when run the DTP in new table of the std DSO we are getting the da

  • Error while displaying transaction

    Hi, I m new to EP6 and getting a problem in viewing any sap transaction in an IView. I added a new system and supplied appropriate attributes. In the connection test it gave me following result: Results SAP Web AS Connection - Aug 27, 2005 6:45:37 AM

  • HELP.  My ipad is no longer syncing with my computers calendar

    When I entered data into my calendar on my ipad it does not transfer over to my computer calendar anymore!   I am NOT using mobileme.  Just old school physical hook up.  I have tried the info area of itunes and changed calendar sync settings but noth

  • File association for .rexx files

    Hi all, This will be my first post here. I've searched the web (and this forum) for an answer to my question, but have up untill now not been able to find it. I have installed Regina Rexx, cuz I want to use that language as my command language. I've

  • JPEG instructions?

    Hi, Occasionally a desktop picture comes up on my second monitor that I didn't put there. I can't find the picture anywhere on my Mac. I pulled it from the Desktop Preference pane onto my desktop and did a get info on it. It's a JPEG with "instructio