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

Similar Messages

  • BC4J: client object reference in app module

    We know that the BC4J clients can call the server using the remote app module reference. Just wondering if the server can have references to the clients as well (so that the server could call all the clients if something on the server gets updated)? If so, is there any example for client callbacks from the app modules? Has anyone done something like this before?

    We know that the BC4J clients can call the server using the remote app module reference. Just wondering if the server can have references to the clients as well (so that the server could call all the clients if something on the server gets updated)? If so, is there any example for client callbacks from the app modules? Has anyone done something like this before?

  • BC4J Client Data Model Definition Wizard does not dismiss

    I'm a newbie trying to learn JDeveloper on my own to advance my career. I am following examples given in the Oracle9i JDeveloper Handbook by Koletzke, Dorsey, and Faderman. Everything has worked great so far until now. With the BC4J Client Data Model Definition Wizard, I make it all the way to the last screen and press "Finish". The message window displays several lines of compilation type messages concerning my BC4J components and ends with something along the lines of "compilation success, errors = 0". The appropriate .cpx file gets created and appears under the project in the navigator. However the Wizard never dismisses no matter how long I leave it open (30 hours and counting), and if I open the .cpx file in a text editor, it is empty. It's as if the processing gets hung and never completes. What am I missing and/or where do I look for additional error messages or help??

    Anyone know what I'm talking about?

  • EJB Java Client to Corba C++ object

    Does BEA have any examples of calling from an EJB java client to a CORBA C++ object
    (please no Tuxedo examples, thank you)?
    I've tried the c++ -> EJB examples, however now I need the other way around.
    thanks,
    Sean

    Andy Piper <[email protected]> wrote:
    "Sean Cloutier" <[email protected]> writes:
    Does BEA have any examples of calling from an EJB java client to aCORBA C++ object
    (please no Tuxedo examples, thank you)? Not that I am aware of. This is just a standard CORBA client scenario.
    andy
    -- Cool, thanks Andy!

  • Using JAAS in a BC4J Client

    Hello
    We are building a BC4J application.
    We would like to use JAAS on the client side (Swing Client), to do some authorization.
    I made a test, authentication a user trough JAAS on the client as follow:
    // Auhorization
    CallbackHandler handler = new InfoCallbackHandler();
    String s = "oracle.security.jazn.tools.Admintool";
    LoginContext loginContext = new LoginContext(s, handler);
    loginContext.login();
    Subject subject = loginContext.getSubject();
    // authenticated action
    Subject.doAs(subject, this);
    This works, as long as the client has access to the jazn.xml file.
    As far as I understand, this loads the RealmLoginModule.
    The RealmLoginModule uses either a jazn.xml file, or LDAP for authentication.
    Now I'm curios about where the RealmLoginModule gets its information from, when the client is running on an other machine than the OC4J Server.
    Where does the RealmLoginModule get the connection information for the OC4J or LDAP- server from?
    Do I have to deliver the security information (jazn.xml file) to the client (I dont want to expose all this information to the Hackers on the client side)?
    Is there a way to delegate the JAAS calls to the middle tier (a security provider , LoginModule, that does RMI-calls to an EJB-component)?
    Is there a way to do authorization with the BC4J interfaces on the client (something like boolean ApplikacitonModule.isUserInRole(Role) or javax.security.auth.Subject ApplikacitonModule.getSubject() or java.util.Set ApplikacitonModule.getPrincipalsForSubject())?
    I would like to get a javax.security.auth.Subject representing the user (and password)
    that is authenticated in the middle tier. This is the Subject (defined by username & password)),
    used for the JNDI lookup, and by the whole J2EE (EJB) security, when creating a root ApplicationModule.
    Is this possible?
    Regards
    Matthais Gerber

    Hi,
    In JDeveloper 9.0.3, BC4J has JAAS support in the middle-tier. You could set jbo.security.enforce to "Test" or "Must" on the application module using "Configuration...", "Edit" in JDev. If you are using the default Oracle 9iAS JAAS you will also need to include BC4J Security library in the project. The jdk\jre\lib\securtiy\java.security should have login.configuration.provider=oracle.security.jazn.spi.LoginConfigProvider.
    You do not need to create LoginContext, CallbackHandler, etc. in either your client app or business objects.
    If you are not using OC4J, you need to have another loginmodule that implement javax.security.auth.spi.LoginModule. You need to set the jbo.security.loginmodule with you loginmodule name, include the class or jar in your library, specify the jaas config file on the java runtime option.
    Please refer to 9.0.3 online help "Working with Security in BC4J" for more information.
    Thanks,
    Yvonn

  • Manual EJB BC4J Deployment

    Quick question.
    Is manual BC4J deployment to an EJB supported?

    Deployment instructions are completely documented in the online help:
    User Guides
    Developing Business Components
    Deploying Business Components
    For the client:
    User Guides
    Developing Applications
    Developing Java Forms for Business Components
    Deploying Java Forms

  • CreateEntityManagerFactory() throws NullPointerException for ejb jse client

    Dear experts!
    I am trying to create a java standard edition client, to test outside the weblogic server, my ejb 3 entities, declared as shown in the following persistence.xml.
    The java code, and stacktrace follows also. I have read about some relevant bugs in eclipselink back in 2006, or 7 or 8 and mostly unanswered threads :
    CreateEntityManagerFactory null pointer exception and
    Returned null to createEntityManagerFactory about tomcat and oc4j.
    Persistence.createEntityManagerFactory() throw NullPointerException in oc4j
    I am using JDeveloper 11g Studio Edition Version 11.1.1.3.0, Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660.
    Any helping hand available?
    Thank you very much in advance!
    NA
    package chapter12javaseclient;
    import actionbazaar.buslogic.BidException;
    import actionbazaar.persistence.Bid;
    import actionbazaar.persistence.Bidder;
    import actionbazaar.persistence.Item;
    import java.util.HashMap;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import org.eclipse.persistence.config.EntityManagerProperties;
    public class PlaceBidBeanJavaSE {
    private static EntityManagerFactory emf;
    private static EntityManager em;
    public static void main(String[] args) {
    String userId= "idiot";
    Long itemId = new Long (1);
    Double bidPrice = 2001.50;
    try {
    if (emf == null){
    emf = Persistence.createEntityManagerFactory("actionBazaar");
    System.out.println("EntityManagerFactory created!");
    getEntityManager();
    System.out.println("EntityManager created!");
    addBid(userId,itemId,bidPrice);
    commitTransaction();
    } finally {       
    // close the EntityManager when done
    em.close();
    emf.close();
    private static void getEntityManager() {
    HashMap emProps = new HashMap();
    emProps.put(EntityManagerProperties.JDBC_USER, "ab");
    emProps.put(EntityManagerProperties.JDBC_PASSWORD, "ab");
    System.out.println("Creating entity manager");
    em = emf.createEntityManager(emProps);
    em.getTransaction().begin();
    private static void commitTransaction() {
    em.getTransaction().commit();
    private static Long addBid(String userId, Long itemId, Double bidPrice) throws BidException {
    Item item = em.find(Item.class,itemId);
    if (item == null)
    throw new BidException("Invalid Item Id");
    Bidder bidder = em.find(Bidder.class,userId);
    if (bidder == null)
    throw new BidException("Invalid Bidder Id");
    Bid bid = new Bid();
    bid.setItem(item);
    bid.setBidBidder(bidder);
    bid.setBidPrice(bidPrice);
    em.persist(bid);
    return bid.getBidId();
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="actionBazaar" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>actionbazaar.persistence.Bid</class>
    <class>actionbazaar.persistence.Item</class>
    <class>actionbazaar.persistence.User</class>
    <class>actionbazaar.persistence.Bidder</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    <property name="eclipselink.target-database" value="Oracle11"/>
    <property name="javax.persistence.jdbc.driver"
    value="oracle.jdbc.OracleDriver"/>
    <property name="javax.persistence.jdbc.password"
    value="ab"/>
    <property name="javax.persistence.jdbc.url"
    value="jdbc:oracle:thin:@hera:1521:orcl"/>
    <property name="javax.persistence.jdbc.user" value="ab"/>
    <property name="eclipselink.logging.level" value="ALL"/>
    </properties>
    </persistence-unit>
    </persistence>
    The log output follows:
    C:\Oracle\Middleware\jdev_11gR1\jdk160_18\bin\javaw.exe -client -classpath C:\MyWork\11g\ejb3inaction\.adf;C:\MyWork\11g\ejb3inaction\Chapter12JavaSEClient\classes;C:\MyWork\11g\ejb3inaction\Chapter12\classes;C:\Oracle\Middleware\jdev_11gR1\modules\javax.ejb_3.0.1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\com.oracle.toplink_1.0.0.0_11-1-1-3-0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\org.eclipse.persistence_1.0.0.0_2-0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.toplink_11.1.1\javax.persistence_2.0_preview.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.jsf_1.0.0.0_1-2.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.enterprise.deploy_1.2.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.interceptor_1.0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.jms_1.1.1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.jsp_1.1.0.0_2-1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.jws_2.0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.mail_1.1.0.0_1-4-1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.xml.soap_1.3.1.0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.xml.rpc_1.2.1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.xml.ws_2.1.1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.management.j2ee_1.0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.resource_1.5.1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.transaction_1.0.0.0_1-1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.xml.stream_1.1.1.0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.xml.registry_1.0.0.0_1-0.jar;C:\Oracle\Middleware\jdev_11gR1\modules\javax.persistence_1.0.0.0_1-0-2.jar;C:\Oracle\Middleware\jdev_11gR1\wlserver_10.3\server\lib\weblogic.jar;C:\Oracle\Middleware\jdev_11gR1\wlserver_10.3\server\ext\jdbc\oracle\11g\ojdbc6.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n-collation.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n-lcsd.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n-mapping.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n-servlet.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n-translation.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n-utility.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle\Middleware\jdev_11gR1\oracle_common\modules\oracle.dms_11.1.1\dms.jar -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\jdev_11gR1\wlserver_10.3\server\lib\DemoTrust.jks chapter12javaseclient.PlaceBidBeanJavaSE
    [EL Finest]: 2010-06-25 09:23:10.495--ServerSession(229902)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit actionBazaar; session file:/C:/MyWork/11g/ejb3inaction/Chapter12JavaSEClient/classes/_actionBazaar; state Initial; factoryCount 0
    [EL Finest]: 2010-06-25 09:23:10.518--ServerSession(229902)--Thread(Thread[main,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
    [EL Finer]: 2010-06-25 09:23:10.532--ServerSession(229902)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/MyWork/11g/ejb3inaction/Chapter12JavaSEClient/classes/
    [EL Finer]: 2010-06-25 09:23:10.537--ServerSession(229902)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/MyWork/11g/ejb3inaction/Chapter12JavaSEClient/classes/
    [EL Config]: 2010-06-25 09:23:10.652--ServerSession(229902)--Thread(Thread[main,5,main])--The access type for the persistent class [class actionbazaar.persistence.Item] is set to [PROPERTY].
    [EL Config]: 2010-06-25 09:23:10.696--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to many mapping element [method getCategorySet] is being defaulted to: class actionbazaar.persistence.Category.
    [EL Config]: 2010-06-25 09:23:10.702--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [method getBids] is being defaulted to: class actionbazaar.persistence.Bid.
    [EL Config]: 2010-06-25 09:23:10.71--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [method getSeller] is being defaulted to: class actionbazaar.persistence.Seller.
    [EL Config]: 2010-06-25 09:23:10.71--ServerSession(229902)--Thread(Thread[main,5,main])--The access type for the persistent class [class actionbazaar.persistence.User] is set to [PROPERTY].
    [EL Config]: 2010-06-25 09:23:10.711--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [method getCategories] is being defaulted to: class actionbazaar.persistence.Category.
    [EL Config]: 2010-06-25 09:23:10.716--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to one mapping element [method getBillingInfo] is being defaulted to: class actionbazaar.persistence.BillingInfo.
    [EL Config]: 2010-06-25 09:23:10.717--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to one mapping element [method getContactInfo] is being defaulted to: class actionbazaar.persistence.ContactInfo.
    [EL Config]: 2010-06-25 09:23:10.718--ServerSession(229902)--Thread(Thread[main,5,main])--The access type for the persistent class [class actionbazaar.persistence.Bidder] is set to [PROPERTY].
    [EL Config]: 2010-06-25 09:23:10.72--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [method getBids] is being defaulted to: class actionbazaar.persistence.Bid.
    [EL Config]: 2010-06-25 09:23:10.721--ServerSession(229902)--Thread(Thread[main,5,main])--The access type for the persistent class [class actionbazaar.persistence.Bid] is set to [PROPERTY].
    [EL Config]: 2010-06-25 09:23:10.721--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [method getBidBidder] is being defaulted to: class actionbazaar.persistence.Bidder.
    [EL Config]: 2010-06-25 09:23:10.721--ServerSession(229902)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [method getItem] is being defaulted to: class actionbazaar.persistence.Item.
    [EL Config]: 2010-06-25 09:23:10.722--ServerSession(229902)--Thread(Thread[main,5,main])--The alias name for the entity class [class actionbazaar.persistence.Item] is being defaulted to: Item.
    [EL Config]: 2010-06-25 09:23:10.746--ServerSession(229902)--Thread(Thread[main,5,main])--The alias name for the entity class [class actionbazaar.persistence.Bidder] is being defaulted to: Bidder.
    [EL Config]: 2010-06-25 09:23:10.746--ServerSession(229902)--Thread(Thread[main,5,main])--The alias name for the entity class [class actionbazaar.persistence.User] is being defaulted to: User.
    [EL Config]: 2010-06-25 09:23:10.753--ServerSession(229902)--Thread(Thread[main,5,main])--The table name for entity [class actionbazaar.persistence.Bidder] is being defaulted to: USERS.
    [EL Config]: 2010-06-25 09:23:10.753--ServerSession(229902)--Thread(Thread[main,5,main])--The discriminator column name for the root inheritance class [class actionbazaar.persistence.Bidder] is being defaulted to: DTYPE.
    [EL Config]: 2010-06-25 09:23:10.755--ServerSession(229902)--Thread(Thread[main,5,main])--The primary key column name for the inheritance class [class actionbazaar.persistence.Bidder] is being defaulted to: USER_ID.
    [EL Config]: 2010-06-25 09:23:10.755--ServerSession(229902)--Thread(Thread[main,5,main])--The foreign key column name for the inheritance class [class actionbazaar.persistence.Bidder] is being defaulted to: USER_ID.
    [EL Config]: 2010-06-25 09:23:10.758--ServerSession(229902)--Thread(Thread[main,5,main])--The alias name for the entity class [class actionbazaar.persistence.Bid] is being defaulted to: Bid.
    Exception in thread "main" java.lang.NullPointerException
         at chapter12javaseclient.PlaceBidBeanJavaSE.main(PlaceBidBeanJavaSE.java:43)
    Process exited with exit code 1.

    Thank you for your reply!
    The client now works correctly. It seems that the line
    em = emf.createEntityManager(emProps);//
    throws an exception when no argument is given for em = emf.createEntityManager();// emProps missing!
    There was also a warning in jdev editor, about the line you mentioned:
    <property name="eclipselink.target-server" value="WebLogic 10"/>
    Carry on with your good work!
    The updated persistence.xml and java source code shown below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="actionBazaar" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>actionbazaar.persistence.Bid</class>
    <class>actionbazaar.persistence.Item</class>
    <class>actionbazaar.persistence.User</class>
    <class>actionbazaar.persistence.Bidder</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
    <property name="eclipselink.target-database" value="Oracle11"/>
    <property name="javax.persistence.jdbc.driver"
    value="oracle.jdbc.OracleDriver"/>
    <property name="javax.persistence.jdbc.password"
    value="29E8BD11B89A62E3862F19C4F84B7DB0"/>
    <property name="javax.persistence.jdbc.user" value="ab"/>
    <property name="eclipselink.logging.level" value="ALL"/>
    <property name="eclipselink.orm.validate.schema" value="true"/>
    <property name="javax.persistence.jdbc.url"
    value="jdbc:oracle:thin:@hera:1521:orcl"/>
    </properties>
    </persistence-unit>
    </persistence>
    package chapter12javaseclient;
    import actionbazaar.buslogic.BidException;
    import actionbazaar.persistence.Bid;
    import actionbazaar.persistence.Bidder;
    import actionbazaar.persistence.Item;
    import java.util.HashMap;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import org.eclipse.persistence.config.EntityManagerProperties;
    public class PlaceBidBeanJavaSE {
    private static EntityManagerFactory emf;
    private static EntityManager em;
    private static Hashtable emProps = new Hashtable();
    public static void main(String[] args) {
    String userId= "idiot";
    Long itemId = new Long (2);
    Double bidPrice = 2002.50;
    try {
    if (emf == null){
    emf = Persistence.createEntityManagerFactory("actionBazaar");
    System.out.println("EntityManagerFactory created!");
    getEntityManager();
    System.out.println("EntityManager created!");
    addBid(userId,itemId,bidPrice);
    commitTransaction();
    } finally {       
    // close the EntityManager when done
    em.close();
    emf.close();
    private static void getEntityManager() {
    try {
    System.out.println("Creating entity manager");
    em = emf.createEntityManager(emProps);// if argument is missing exception is thrown!
    em.getTransaction().begin();
    } catch (Exception ne) {
    // TODO: Add catch code
    ne.printStackTrace();
    private static void commitTransaction() {
    em.getTransaction().commit();
    private static Long addBid(String userId, Long itemId, Double bidPrice) throws BidException {
    Item item = em.find(Item.class,itemId);
    if (item == null)
    throw new BidException("Invalid Item Id");
    Bidder bidder = em.find(Bidder.class,userId);
    if (bidder == null)
    throw new BidException("Invalid Bidder Id");
    Bid bid = new Bid();
    bid.setItem(item);
    bid.setBidBidder(bidder);
    bid.setBidPrice(bidPrice);
    em.persist(bid);
    return bid.getBidId();
    NA
    [http://nickaiva.blogspot.com/]

  • EJB Application Client clarification

    Hi EJB Guru,
    I would like some clarification on accessing Remote/Local Session Bean using an Application Client. In other word,
    there appears to be more than one approach to the same Session bean. Let's start by declaring the Converter EJB:
    package converter.ejb;
    import java.math.BigDecimal;
    import javax.ejb.Remote;
    @Remote
    public interface Converter {
        public BigDecimal dollarToYen(BigDecimal dollars);
        public BigDecimal yenToEuro(BigDecimal yen);
    package converter.ejb;
    import java.math.BigDecimal;
    import javax.ejb.Stateless;
    @Stateless
    public class ConverterBean implements converter.ejb.Converter {
        private BigDecimal euroRate = new BigDecimal("0.0070");
        private BigDecimal yenRate = new BigDecimal("112.58");
        public BigDecimal dollarToYen(BigDecimal dollars) {
            BigDecimal result = dollars.multiply(yenRate);
            return result.setScale(2, BigDecimal.ROUND_UP);
        public BigDecimal yenToEuro(BigDecimal yen) {
            BigDecimal result = yen.multiply(euroRate);
            return result.setScale(2, BigDecimal.ROUND_UP);
    }I have two method to accessing this bean.
    ( i ) Lookup JNDI using the following set of code:
    package converter.client;
    import converter.ejb.Converter;
    import java.math.BigDecimal;
    import javax.ejb.EJB;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    public class ConverterClient {
        public static void main(String[] args) {
            try {
                InitialContext ctx = new InitialContext();
                ConverterRemote jndiconverter = (ConverterRemote) ctx.lookup("converter.ejb.ConverterRemote");
                BigDecimal param = new BigDecimal("100.00");
                BigDecimal yenAmount = jndiconverter.dollarToYen(param);
                System.out.println("$" + param + " is " + yenAmount + " Yen.");
                BigDecimal euroAmount = jndiconverter.yenToEuro(yenAmount);
                System.out.println(yenAmount + " Yen is " + euroAmount + " Euro.");
                System.exit(0);
            } catch (javax.naming.NamingException ne) {
                System.err.println("Caught an unexpected exception!");
                ex.printStackTrace();
    }( ii ) Application Client lookup?
    package converter.client;
    import converter.ejb.Converter;
    import java.math.BigDecimal;
    import javax.ejb.EJB;
    public class ConverterClient {
        @EJB
        private static Converter converter;
        /** Creates a new instance of Client */
        public ConverterClient(String[] args) {
        public static void main(String[] args) {
            ConverterClient client = new ConverterClient(args);
            client.doConversion();
        public void doConversion() {
            try {
                BigDecimal param = new BigDecimal("100.00");
                BigDecimal yenAmount = converter.dollarToYen(param);
                System.out.println("$" + param + " is " + yenAmount + " Yen.");
                BigDecimal euroAmount = converter.yenToEuro(yenAmount);
                System.out.println(yenAmount + " Yen is " + euroAmount + " Euro.");
                System.exit(0);
            } catch (Exception ex) {
                System.err.println("Caught an unexpected exception!");
                ex.printStackTrace();
    }It is the first time I come a cross method ( ii ) and could not get it to work properly. The error message
    received were:
    SJSAS server side
    **RemoteBusinessJndiName: converter.ejb.Converter; remoteBusIntf: converter.ejb.Converter
    LDR5010: All ejb(s) of [converter] loaded successfully!
    Registering ad hoc servlet: WebPathPath: context root = "/converter", path = "/converter-app-client'
    Java Web Start services started for application com.sun.enterprise.appclient.jws.ApplicationContentOrigin@c91c07
    registration name=converter
        [email protected]3900 registration name=converter, context
    root=/converter/converter-app-client, module name=
    , parent=converter
    WEB0100: Loading web module [converter:converter-war.war] in virtual server [server] at [/converter]
    Class [ Lconverter/ejb/Converter; ] not found. Error while loading [ class converter.client.ConverterClient ]
    Error in annotation processing: java.lang.NoClassDefFoundError: Lconverter/ejb/Converter;
    deployed with moduleid = converter-app-client
    Converter-app-client side
    Caught an unexpected exception!
    java.lang.NullPointerException
            at converter.client.ConverterClient.doConversion(ConverterClient.java:59)
            at converter.client.ConverterClient.main(ConverterClient.java:53)Here is the JNDI listing in ASADMIN:
    C:\>asadmin
    Use "exit" to exit and "help" for online help.
    asadmin> list-jndi-entries
    Jndi Entries for server within root context:
    converter.ejb.Converter: javax.naming.Reference
    converter.ejb.Converter#converter.ejb.Converter: javax.naming.Reference
    jbi: com.sun.enterprise.naming.TransientContext
    jdbc: com.sun.enterprise.naming.TransientContext
    UserTransaction: com.sun.enterprise.distributedtx.UserTransactionImpl
    ejb: com.sun.enterprise.naming.TransientContext
    converter.ejb.Converter__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
    Command list-jndi-entries executed successfully.
    asadmin>My questions are:
    ( a ) Why does the error occur?
    ( b ) what is the architecture difference in accessing the same bean? Does JNDI lookup allows one to access EJB from remote host as opposed the method ( ii ) which is only restricted to local access on the same JVM/Container?
    ( c ) What are the pros & cons between the two?
    I am using Application Client to lookup these Session Beans on Netbeans 5.5, SJSAS 9.0, SDK 1.5.0_11 on Windows XP platform.
    Any guideance/advice would be very much appreciated.
    Thanks alot,
    Henry

    Hi, may be you can help me with a similar problem that I have, I transcript the post in the netbeans forum, I really hope that you or someone can help me with this. Thanks in advance!
    I hope that somebody can help me solving this issue.
    Environment:
    NetBeans 6.0 beta1 + glassfish b58g fresh installed
    Windows XP
    Make a new enterprise application with application client. Run the empty Main and it runs ok.
    Now create a Stateless Session Bean with hello method.
    In the Application Client Main insert a reference to the EJB using the wizard. (@EJB etc...)
    invoke the hello method from the main().
    right click on libraries from application client and add the application-ejb project
    Deploy and it deploys ok, but when you run it throws an exception:
    client:
    java.lang.NullPointerException
    server:
    Error in annotation processing: java.lang.NoClassDefFoundError: Lorg/arautos/revista/sacrae/server/business/SACRAEFacadeRemote;
    java.io.FileNotFoundException: C:\opt\glassfish-v2-b58g\domains\domain1\applications\j2ee-modules\SACRAE-app-client\SACRAE-ejb.jar (El sistema no puede hallar el archivo especificado)
    Remember we added the project to the appclient libraries. If I place the missing file in the applications directory of glassfish it wont work, because when you run it, deploying on the server will erase it again. But, if you copy the jar file in the directory and open it with 7zip or any other application that can keep the file open, when you run it again it will work (because the server is not able to delete the file).
    Although this is a workaround, there should be something I am doing wrong to cause this behavior, now when I try to use Java Web Start to execute the client it fails (surprisingly) with this exception:
    java.lang.reflect.InvocationTargetException
    Caused by: java.lang.NoClassDefFoundError: org/arautos/revista/sacrae/server/business/SACRAEFacadeRemote
    at org.arautos.revista.sacrae.client.desktop.Main.main(Main.java:30)
    ... 21 more
    And I don't know where in the domain1 directory place the jar, worse, I don't know how to solve the issue with the ejb-jar in the first place, does anybody has an idea, link, same problem? I have googled, netbeans-ed and java.net-ed a lot but didn't find anything :(
    Thanks in advance for any help.
    Best Regards.

  • Problem calling a EJB Java Client from Java Activity Agent

    Hi,
    We have a wrapper java class that calls to an EJB through a JNDI lookup. The wrapper class is called from a workflow. The problem is that the call fail with the following message error:
    Error : getRemoteHome Lugar: ServiceLocator NamingException Mensaje Error: Receive timed out
    Mon Jan 09 15:32:13 EST 2006 Enqueuing VIC/97513 com.tallion.tax.workflow.assessment.Update
    F_FN_ERROR (MODULE=com.tallion.tax.workflow.assessment.Update) (ITEMTYPE=VIC) (ITEMKEY=97513) (ACTID=10617) (FUNCMODE=RUN) (ERRMESSAGE=getRemoteHome Lugar: ServiceLocator NamingException Mensaje Erro
    The wrapper class has in their classpath a jndi.properties as follows:
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=69.0.137.120:1099
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    The call just works fine when we restart the Java Activity Agent and then, after a while it fails again with the same error.
    Any ideas/workaround?
    Thanks.

    I have a situation that is a bit similar. I have successfully used beans for storing methods used in JSPs and used by other methods in the same class as was suggested above. Now I would like to break some methods into another (utility) class since they are lower level and can be used by lots of things. They are for database operations (given a String query and String dbname, it queries and returns ResultSet for example). I want to have them in a separate class for reusability and OOP.
    I am having problems calling those public static methods in the public class from my bean that communicates with the JSP. I can't compile the class that calls the method in the database ops class. I get an error like :
    loginHelper.java:45: cannot find symbol
    symbol : variable sqlHelper
    location: class dbHelperBean.loginHelper
    and when I include the package name in the call I get
    loginHelper.java:45: cannot find symbol
    symbol : class sqlHelper
    location: package dbHelperBean
    That's strange since the package of both classes is dbHelperBean and the class is indeed called sqlHelper. I tried to compile it in the same directory as sqlHelper as well. What am I doing wrong?
    Thanks for any help.

  • Error while running EJB from Client

    I am able to successfuly deploy the EJB in Oracle 8.1.5, While running the Client code I am getting the following error, can any one help how to solve.
    org.omg.CORBA.INTERNAL[completed=MAYBE, reason=java.lang.ClassNotFoundException: com.visigenic.vbroker.ds.DSUser]
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.RuntimeException.<init>(Compiled Code)
    at org.omg.CORBA.SystemException.<init>(Compiled Code)
    at org.omg.CORBA.INTERNAL.<init>(Compiled Code)
    at com.visigenic.vbroker.orb.ORB.create(Compiled Code)
    at com.visigenic.vbroker.orb.ORB.create(Compiled Code)
    at com.visigenic.vbroker.orb.ORB.locator(Compiled Code)
    at com.visigenic.vbroker.orb.ORB.bind(Compiled Code)
    at com.visigenic.vbroker.orb.UnboundStubDelegate.bind(Compiled Code)
    at com.visigenic.vbroker.orb.UnboundStubDelegate.request(Compiled Code)
    at com.visigenic.vbroker.orb.UnboundStubDelegate.request(Compiled Code)
    at org.omg.CORBA.portable.ObjectImpl._request(Compiled Code)
    at org.omg.CORBA._st_InitialReferences.get(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.SessionCtx.initialContext(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.SessionCtx.<init>(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.ServiceCtx.createSession(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.ServiceCtx.login(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.ServiceCtx.defaultSession(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.ServiceCtx.lookup(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(Compiled Code)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(Compiled Code)
    at javax.naming.InitialContext.lookup(Compiled Code)
    at Date.Client.main(Compiled Code)
    null

    Verify if the connect.properties match your deployment mode viz Local, EJB or Oracle8i.
    Uday

  • Packaging oc4j StandAlone ejb 3 client

    Am doing a ejb 3.0 test project with a standalone oc4j instance.
    I have no problem running a test client from within jDev, but I don't know how to tell the .deploy file to include either the required oc4j client jars or have the manifest include them in the classpath.
    I have:
    1. Reviewed http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14428/usclient.htm#BABIBGFI
    2. Created a user library with these jars.
    3. Set the project AND the .deploy properties to include this lib.
    But when running the client 'java -jar myclient.jar' it does not have the classes in the classpath. Neither are any of these jars in the myclient.jar.
    This is a simple facade calling a finder on an entity.
    Also, is the aforementioned chart (on the above link) up to date? Isn't it a bit heavyweight for a simple ejb 3.0 only app? What is the true minimum of jars required (in the classpath, or included)
    for a simple ejb 3 app?
    Thanks,
    nat

    If you want a given user to be able to use OC4J JMS, that user must be granted RMI login permission.
    -Jeff

  • How to run ejb (JServer) client in web browser

    Did anyone try the ClubMed example under $ORACLE_HOME/javavm/demo/examples/ejb/applets/ClubMed?
    Does anyone know how to run the applets in latest Netscape and/or IE browsers? What do I need to do to set up security, etc. Thanks.
    null

    Forms client side is a Java applet, so it needs a Web browser to run. Anyway you could try to run it with the Java Web Start.
    <p>See this Jan Carlin entry.</p>
    Francois

  • JSP use EJB's Client.jar

    There's a Client.jar fater deployed an EJB.
    I can do it like this:
    D:\>java -classpath %classpath%;Client.jar MyClient
    My question is:
    How can I run JSP with the EJB?
    Thank you!

    i thing right now your are accesing the ejb through comand prompt.first create a jsp then create *.war file by uing deployment tool.for forther help refer j2ee doc.
    call the jsp from browser.

  • EJB - BC4J comparison

    At the moment we are using BC4J to develop a certain system. There's nothing wrong with BC4J but the JDeveloper IDE has some serious bugs whom doesn't make our lives more easy. JDeveloper has also support for Enterprise JavaBeans (EJB) which is more standarized and more tools have support for. Unfortunately the JDeveloper manual isn't clear about the differences between the two. We are developing a pretty big system which uses lots of tables, views, stored procedures etc. on an Oracle 9i database. The system must be as modular as possible. So, what's the difference between EJB and BC4J? What are the pros and cons of both (compared to each other)? And what would probably work best for our project?

    If you have specific issues with packaging and deployment, since that functionality is common between EJB and BC4J in the JDeveloper IDE,
    let's solve the problem by your describing a minimal testcase that reproduces the problem, and then we'll investigate what's going wrong and
    try to get you going in the right direction as quickly as possible again. Well I honestly don't know where to start... Ofcourse there are some serious bugs in the IDE related to BC4J. Ivo Jansch described yesterday a few of the bugs in the following topics:
    Re: ora-00984 while inserting data with dynamic sql
    Re: ORA-01704: String literal Too long
    Problem with most bugs is that they cannot be reproduced that easily. They sometimes just seem to happen! :(
    My question was not only about EJB vs. BC4J. If I would use the basic EJB stuff (like you said isn't as ready-to-go as BC4J) I could also use another IDE. Why would I want to do that? Well probably because the JDeveloper IDE isn't as "smart" as it could be.
    For example; I create a project with all of my entity objects and some view objects, JAR it up into a re-useable library and create another project which imports the library. If this new project I want to create the presentation layer of my application. If I want to create an application module which uses views in the library (which I added to the classpath of my project), I first need to add every BC4J package with the needed views (why can't the IDE retrieve the views from the package without importing every single package?). Some entities / views in a certain package are depending on certain entities / views in another package. Although I don't want to use these entities / views the IDE is complaining certain entities / views can't be found. To solve this I need to add almost every package in the library. And unfortunately there is no easy way to do this. You can only add one package at a time. Everytime you add another package you have to browse to the JAR, browse into the JAR to the right package and add it to your project. This is very cumbersome and costs lots of time. Why can't the IDE ask if I want to import the packages with the entities / views that are required by another package? Another problem with this approach is I can't easily move the library. Although I could change the library location in the project file (by editing the project's property) the project still references the packages / files in the library as if the library was still at it's old location...
    This is just one example of why I sometimes really get fed up with JDeveloper. There are numerous other things like no easy way to move entities to other packages, corrupt XML files, projects still referencing stuff that's properly removed using the IDE etc. etc. The BC4J is powerfull, but using JDeveloper sometimes makes you wonder if there isn't something (maybe) less powerfull which just works. Although BC4J development could speed up things tremendously the JDeveloper IDE takes almost all profit away.
    Ofcourse not everything of the JDeveloper IDE is bad or not working. It's a very powerfull IDE, just like the BC4J is very powerfull, it has lots of very nice features and the whole concept behind the IDE and BC4J framework is awesome but sometimes I just wonder if the IDE is finished and ready for daily use...

  • Deploying EJBs from Client-PC with DeployerTool ?

    Hi,
    I tried to deploy my EJBs with the DeployerTool that is running on a client
    machine in the same LAN as the Weblogic Server (both under WinNT). Now I get
    some errors because there is no ftp-Server running on the "weblogic"-machine.
    Is there a way to use deployment form the DeployerTool without running a
    ftpserver on the weblogic-machine ?
    As a workaround I can use hot-deploy from the Console, the machines share parts
    of there filesystem.
    Excuse me for my not-so-well english,please.
    Thanks,
    Manfred
    Configuration:
    2 machines WinNT with shared filesystem,
    Weblogic Server 5.1 SP3
    Console and DeployerTool running on client-machine.
    | Manfred Schenk | ICQ: (not available)
    | Mail: [email protected] | IRC: Mampf2 (aber nur sehr selten)
    | Fon : +491719509349 | WWW: http://www.ZEROByte.de/

    Dana Jeffries schrieb:
    >
    The EJBDeployer runs its own little FTP server.
    Do you use a proxy server or firewall product?
    There is a proxy server and a firewall between the in-house-net and the
    internet.
    Do you run the EJBDeployer and the Console at the same time?The results are the same, whether I run both at the same time or not.
    >
    Have you ever been able to deploy using the EJBDeployer in this configuration?If I start the EJBDeployer on the same machine as the server, I have no
    problems.
    Here is the complete error message:
    -->snip-->
    weblogic.ejb.common.DeploymentException: Problem creating deployment
    ftp://153.96.12.198W:/beanupgrade/eventsender/eventsender.jar from
    ftp://153.96.12.198W:/beanupgrade/eventsender/eventsender.jar; nested exception
    is:
         weblogic.ejb.common.DeploymentException: could not open URL stream
    java.net.ConnectException: Connection refused: no further information
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
         at java.net.Socket.<init>(Socket.java:269)
         at java.net.Socket.<init>(Socket.java:98)
         at sun.net.NetworkClient.doConnect(NetworkClient.java:54)
         at sun.net.NetworkClient.openServer(NetworkClient.java:42)
         at sun.net.ftp.FtpClient.openServer(FtpClient.java:271)
         at sun.net.ftp.FtpClient.<init>(FtpClient.java:385)
         at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:82)
         at
    sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:101)
         at java.net.URL.openStream(URL.java:818)
         at
    weblogic.ejb.internal.EJBJarDeployment.initializeJarFile(EJBJarDeployment.java,
    Compiled Code)
         at weblogic.ejb.internal.EJBJarDeployment.setup(EJBJarDeployment.java:191)
         at weblogic.ejb.internal.EJBJarDeployment.setup(EJBJarDeployment.java:166)
         at weblogic.ejb.internal.EJBDeploymentImpl.<init>(EJBDeploymentImpl.java:172)
         at weblogic.ejb.internal.EJBJarDeployment.<init>(EJBJarDeployment.java:100)
         at weblogic.ejb.internal.EJBJarDeployment.<init>(EJBJarDeployment.java:94)
         at weblogic.ejb.internal.EJBManagerImpl.deploy(EJBManagerImpl.java:326)
         at weblogic.ejb.common.EJBManager_WLSkel.invoke(EJBManager_WLSkel.java:144)
         at
    weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java,
    Compiled Code)
         at
    weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:69)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    weblogic.ejb.common.DeploymentException: could not open URL stream
    java.net.ConnectException: Connection refused: no further information
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
         at java.net.Socket.<init>(Socket.java:269)
         at java.net.Socket.<init>(Socket.java:98)
         at sun.net.NetworkClient.doConnect(NetworkClient.java:54)
         at sun.net.NetworkClient.openServer(NetworkClient.java:42)
         at sun.net.ftp.FtpClient.openServer(FtpClient.java:271)
         at sun.net.ftp.FtpClient.<init>(FtpClient.java:385)
         at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:82)
         at
    sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:101)
         at java.net.URL.openStream(URL.java:818)
         at
    weblogic.ejb.internal.EJBJarDeployment.initializeJarFile(EJBJarDeployment.java,
    Compiled Code)
         at weblogic.ejb.internal.EJBJarDeployment.setup(EJBJarDeployment.java:191)
         at weblogic.ejb.internal.EJBJarDeployment.setup(EJBJarDeployment.java:166)
         at weblogic.ejb.internal.EJBDeploymentImpl.<init>(EJBDeploymentImpl.java:172)
         at weblogic.ejb.internal.EJBJarDeployment.<init>(EJBJarDeployment.java:100)
         at weblogic.ejb.internal.EJBJarDeployment.<init>(EJBJarDeployment.java:94)
         at weblogic.ejb.internal.EJBManagerImpl.deploy(EJBManagerImpl.java:326)
         at weblogic.ejb.common.EJBManager_WLSkel.invoke(EJBManager_WLSkel.java:144)
         at
    weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java,
    Compiled Code)
         at
    weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:69)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    Deployment failed.
    <--snap<--
    (153.96.12.198 is the client machine, 153.96.12.95 is the weblogic server
    w: is a shortcut for a public accessible directory on the server machine.)
    Thanks,
    Manfred
    | Manfred Schenk | ICQ: (not available)
    | Mail: [email protected] | IRC: Mampf2 (aber nur sehr selten)
    | Fon : +491719509349 | WWW: http://www.ZEROByte.de/

Maybe you are looking for