Use an EJB from a C++ application

Hello,
How could i call an EJB which lives in a JBoss application server from a C++ application which runs on a Windows client ?
Cheers.
Stefano

Greetings,
Hello,
How could i call an EJB which lives in a JBoss
application server from a C++ application which runs
on a Windows client ?Three or four steps must be completed to accomplish this, the details of all of which are beyond the "scope" of this forum. In summary, however, they are:
1. Configure JBoss 3 for RMI-IIOP communication - the quick solution is to start the server in '-all' mode.
2. Generate IDL stubs for your beans. Use 'rmic -idl ...'.
3. Create communication stubs for and integrate them into your C++ application.
4. Of course, if the application doesn't already have CORBA support it will have to be integrated as well.
That's the quick "1, 2[, er... 3, 4]". :)
Cheers.
StefanoRegards,
Tony "Vee Schade" Cook

Similar Messages

  • How to access an EJB from a web application deployed in the same server

    Hey All,
    I deployed an EJB named EventServerBean to Sun Application Server 9.0, and put the client side jar file (named eventserver.jar which is generated by Sun Application Server) to C:\Sun\AppServer\lib. Now, I have a web application which is a simple jave file -- lookup EventServer EJB and invoke a remote method in this EJB. However, the web application always throws an exception "java.lang.NoClassDefFoundError: eventserver/EventServerRemoteHome"
    Here is my java class that access the ejb:
    public class Post_Event {
        public HashMap<String, String> getEventInfo(String event_name, String site) {
            System.out.println("Post_Event, the class path: " + System.getProperty("java.class.path"));       
            System.out.println("Post_Event, user.dir: " + System.getProperty("user.dir"));
            System.out.println("Post_Event, java.library.path: " + System.getProperty("java.library.path"));
            HashMap<String, String> result = null;
            EventServerRemote remote = null;
            StringTokenizer st, st2;
            // here get the event information from host
            try {
                String lookupStr = "corbaname:iiop:" + site + ":3700#ejb/EventServerBean";
                InitialContext initialContext = new InitialContext();
                EventServerRemoteHome remoteHome = (EventServerRemoteHome) javax.rmi.PortableRemoteObject.narrow(initialContext.lookup(lookupStr), EventServerRemoteHome.class);
                if (remoteHome != null) {
                    remote = remoteHome.create();
            } catch (javax.naming.NamingException ne) {
                ne.printStackTrace();
                return null;
            } catch (javax.ejb.CreateException ce) {
                ce.printStackTrace();
                return null;
            } catch (java.rmi.RemoteException re) {
                re.printStackTrace();
                return null;
            } catch (java.io.IOException ioe) {
                ioe.printStackTrace();
                return null;
            System.out.println("look up remote event server successfully.");
         result = remote.getEvent(event_name);
            return result;
        } I output the class path in this java file, and the class path DOES include the path C:\Sun\AppServer\lib where eventserver\EventServerRemoteHome.class is.
    Does anyone know why it happens? Why a java class can't find a class that is in its class path?
    appreciate any help!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Wael Abbas ([email protected]):
    Thank you for your great topic.
    I think you need to copy the snippet code and past it to every application, applet, servlet or JSP every time you need to use your EJB.
    Its better to include this snippet code in a simple JavaBean and use this bean as a bridge to your EJB, you may include a connect method in your JavaBean or but the connection code in the constructor and include a setters, getters and other methods to encapsulate your EJB methods.
    You can use your JavaBean in any application, applet, servlet or JSP just create an object form it and call its methods.
    Its just an idea
    I hope it will be useful.
    <HR></BLOCKQUOTE>
    null

  • Acessing EJB from standard java applications

    Hello,
    What is the best way to access Enterprise Java Beans from a standard java Application? Any suggestions, documentation, links, ... are welcome.
    To illustrate the problem, take the shopping cart example (http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Session.html). Suppose I now want to create a shopping cart from another swing application started with the 'java' command and not the 'runclient' command. Is this possible? Has it been done before? What is the best thing to do ? Both the J2EE application (like the shopping cart) and the plain java application are already used by customers and cannot be fundamentally changed (the java command cannot be replaced by runclient).
    Thank you.

    Several options are available.
    The easiest is to have the java app call the EJB via RMI/IIOP. You should wrap that process in the "ejb-home factory" and "business delegate" design pattern. I recommend downloading this design pattern book and reading it through.
    http://www.theserverside.com/books/EJBDesignPatterns/index.jsp

  • Using Session EJB from MDB in Weblogic 11G

    I am having trouble with what should be a very simple operation. I have created an MDB and deployed it successfully on the Weblogic managed server. Then in a separate application, I created a Stateless session bean that I would also like to call from the MDB. My SSB deploys and works fine. I added an @EJB annotation to the MDB so I could instantiate and access the SSB from the MDB. In order to resolve the interface class in jDeveloper, I went to my MDB project properties under libraries and classpath and added the jar file for my ejb.
    When I try to redeploy the MDB, I get a java.lang.ClassNotFoundException on the SSB interface class.
    Is there an example somewhere of how to properly create and configure all of the deployment packages and refereneces I need on the weblogic server? The SSB is a common service that going to be called by a lot of other MDBs in my system. Optimally, what I would like to do is to deploy the ejb-client.jar as a shared library so all of my MDBs can use it.
    Thanks for any pointers!

    I am using jDeveloper 11g, so both my MDB and SLSB were built and deployed using the wizzards in the IDE.
    The MDB is inside of an ejb-jar and deployed to a managed server. I am doing my development on a box that is resource challenged so I setup my WLS on a different box. There is an admin server (AdminServer) and a separate soa server (soa_server1) on which I have installed all of the SOA Suite packages.
    The SLSB represents a primary service for the system I am building. Service1SessionBean is deployed targeted to soa_server1. The MDB is also deployed to soa_server1. At least it was until I tried to add the EJB reference. Now it won't deploy at all.
    I would like to avoid packaging the Service1SessionBean client jar in with the MDB because there are several other EJBs that will also need to call the service. I would like to deploy the client jar as a shared library on soa_server1 so that any EJB artifacts that need to call it may do so, I have tried to deploy the client jar as a shared library using jDeveloper but when it deploys, it seems to be under the name "j2ee-app" rather than Service1SessionBean.

  • Use of EJB in a package application.

    Has anyone come across a packaged application/product (Like and ERP system,
    CRM product etc.) that was created using EJB as the "back-end" and then
    deployed as a "shrink-wrapped" application?
    I would like to hear some views on this from everyone.

    I don't know about "shrink wrapped", but YouCentric's CRM (now owned by J.D.
    Edwards) is EJB on the back-end.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Raju" <[email protected]> wrote in message
    news:[email protected]..
    Has anyone come across a packaged application/product (Like and ERPsystem,
    CRM product etc.) that was created using EJB as the "back-end" and then
    deployed as a "shrink-wrapped" application?
    I would like to hear some views on this from everyone.

  • How can I interface a Java application which is not running under NetDynamics, to use the EJBs in a NetDynamics application?

    One of them uses Enterprise Java Beans implemented with a SUN NetDynamics application server. The other is a straight Java application. Ideally I want the second application to remotely invoke methods on the existing Java beans, so the existing business logic will not be duplicated.
    This would seem to be simple, but NetDynamics appears to substitute some proprietary code for part of the EJB interface, and it is not immediately obvious how to let "foreign" java programs access the beans.
    I would appreciate it if anyone is able to provide any information on how to achieve this. If you know of any sample code that I could look at, that would be a help too. This may (or may not) be known to SUN as a "stand alone java client".

    hi,
    can someone help me how to implement logging for method entry parameters and
    method exit return value.
    can someone help me how to use log4j and integrate it to the method entry
    logging and method exit logging.
    Here what i need is without writing the log statements for the method entry and
    method exit i need to log it to the file
    along with other log4j debug statements i provide in the file.I should be able
    to configure whether to enable/disable the logging
    for method entry and method exit. In method entry i should be able to log the
    parameters the method take and in method exit
    i should be able to log te return value to the log file, before the method is
    returned to the callee.
    i hope i am clear
    Thanks in advance.

  • How to change the Portal Password using a link from Web dynpro application

    Hello Everybody,
    I have a requirement to change the user password from a web dynpro application which is available on a mobile device. Firstly User will log into the portal through a mobile device and after getting authenticated user will be redirected to the mobile application. Within this mobile application there will be a link to change the login password(Portal login). Can somebody tell me how can i change the portal login password from a link available within the mobile application. Looking forward for a suitable reply.
    Thanks to all,
    Regards,
    Saby.

    Hi Maksim,
    Thanks for your reply..but i would also like to know can we directly use the Change Password Iview "persoUserPassword" from the portal. Can i directly Pass the URL of this iview from the portal to a "Change Password" link in the web dynpro application, so that when the user click this link he should be able to see this Iview on his/her mobile device and should be able to change the password from there. But i dont know whether this iview will appear properly on the mobile device or we have to have a custom web dynpro application for this purpose...Please reply with a suitable answer.
    Thanks in advance.
    Regards,
    Sarabjeet Singh.

  • What data binding framework to use for EJB(JPA) - Swing desktop application

    Hi!
    I am developing EJB server application which mostly uses the same entities and session EJB's both for web and for desktop user interface. While JSF is working nicely, I am stuck with necessity to make decision with data binding framework to use for desktop application - I investigated:
    - JSR295 reference impementation at java.net (beans binding)
    - Eclipse JFace
    - JSR295 implementation at kenai.com (better beans binding)
    - JGoodies binding
    At present I like JGoodies, but I am not sure whether I am not missing something - I guess - large enterprises should develop a lot of desktop applications as well and what binding framework they are using?

    user454720 wrote:
    At present I like JGoodies, but I am not sure whether I am not missing something - I guess - large enterprises should develop a lot of desktop applications as well and what binding framework they are using?No, not really. I create them sometimes but they are service tools, not part of the main application framework. Generally you keep everything on the server, web based - this keeps it secure, accessible and contained. With all the web 2.0 javascript toolkits available nowadays you can go quite far creating a desktop experience in a browser, with limitations.

  • Using XA Library from with OCI application

    Are there any sample/demo programs that illustrate how to use the XA interface from within an OCI application? In particular, I'm wondering about the association between the OCI session and the xa_open() session -- how can one use OCI calls after establishing a session using xa_open()?
    Thanks,
    Steve

    After xa_open(), you may want to use xaoSvcCtx(databasename) to get OCISvcCtx and xaoEnv(databasename) to get OCIEnv. Use these for OCI calls. Oracle OCI/XA documentation should have sample programs.
    Thanks,
    Bipul

  • Loading remote EJB from servlet using jakarta and openejb

    I am trying to create an environment where I use
    openejb as my EJB container, and JAKARTA Tomcat
    as my
    Servlet/JSP container. However,
    i'm having a problem in lookingup my remote EJB from my
    jakarta application.
    That exact code works perfectly if I run it standalone. I
    am using the same JRE. Jakarta has also loaded the
    openejb-0.8.3.jar and openejb_client-0.8.3.jar
    What I dont understand is why jakarta
    would behave differently than command-line java when I
    am
    running in the same JRE on a single machine.
    Any help would be much appreciated.

    Several fairly major improvements have been maid in OpenEJB specifically for the Tomcat people. For one, the whole way you integrate them has completely been rewritten. Now all you have to do is copy a openejb_loader-0.9.1.war into the Tomcat webapps directory and change an init-param in it. Pretty straight forward. OpenEJB 0.8.3 won't work with Tomcat in the same VM, however OpenEJB 0.9.0 and up have been totally revamped in all things related to classloading so that it can co-exist with Tomcats unique classloading architecture.
    O'Reilly just published an article detailing the ins and outs of the integration, it's a pretty good read:
    http://www.onjava.com/pub/a/onjava/2003/02/12/ejb_tomcat.html

  • Calling a Taskflow present in one App using a url from another Application

    Hi,
    I a have a requirement to call a taskflow present in another Application using a url from present JDEV Application.
    Is that possible in JDEV 11g? Can anyone give me an example.
    Thanks,
    User
    Edited by: user617801 on Feb 24, 2009 11:24 AM

    Hi,
    Check out this example . It is for TP4, but it should be the same on WLS.
    Pedja

  • "HowTo" Call EJB from different EAR in WLS7

    Hi,
    Im trying to deploy two EAR application modules, both on same WLS7.0 SP2 server
    . I have several problems to give visibility between EAR applications. There is
    dependences between both applications ( I will call them FirstEAR and SecondEAR)
    . A FirstEAR EJB ( FirstEAREJB) uses an EJB from the SecondEAR ( SecondEAREJB
    The deployment result is a "Unable to initialize method info for remote or home
    interface The error is java.lang.NoClassDefFoundError: myPackage.myPackage.SECONDEAREJB"
    when deploy the FirstEAREJB. I try the deployment of both using -iiop ejbc option.
    Which is the way to allow my FirstEAREJB to use SECONDEAREJB?
    I have try
    - to set the manifest Class-Path property for FirstEAREJB with no results.
    - to set the descriptor ejb-jar properties for EJBRefs with no results.
    - to set the SecondEAREJB path in the weblogic start script classpath, with no
    results.
    - to set the SecondEAR classpath at the ejbc -cp option for FirstEAREJB ejbc
    compile, with no results again.
    Is there another way to allow my FirstEAREJB to use SecondEAREJB ?

    Take a look at this documentation on WebLogic Server Application
    Classloading.
    It might be helpful.
    http://edocs.bea.com/wls/docs70/programming/classloading.html
    /k
    "Adolfo Cortés" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    Im trying to deploy two EAR application modules, both on same WLS7.0 SP2server
    I have several problems to give visibility between EAR applications.There is
    dependences between both applications ( I will call them FirstEAR andSecondEAR)
    A FirstEAR EJB ( FirstEAREJB) uses an EJB from the SecondEAR (SecondEAREJB
    The deployment result is a "Unable to initialize method info for remote orhome
    interface The error is java.lang.NoClassDefFoundError:myPackage.myPackage.SECONDEAREJB"
    when deploy the FirstEAREJB. I try the deployment of both using -iiop ejbcoption.
    >
    Which is the way to allow my FirstEAREJB to use SECONDEAREJB?
    I have try
    - to set the manifest Class-Path property for FirstEAREJB with noresults.
    - to set the descriptor ejb-jar properties for EJBRefs with no results.
    - to set the SecondEAREJB path in the weblogic start script classpath,with no
    results.
    - to set the SecondEAR classpath at the ejbc -cp option for FirstEAREJBejbc
    compile, with no results again.
    Is there another way to allow my FirstEAREJB to use SecondEAREJB ?

  • Calling EJB from from a client app

    Hi all,
    I am trying to call an EJB component from portal. The example EJB I have taken is from SDN Bonus Calculator example - Application Server/Web Dynpro/Samples and Tutorials/Using EJBs (20)
    I deployed the EAR file - no issue
    I wrote the following code in a client app and trying to connect to the EJB remotely.
              try {
                   java.util.Properties properties = new Properties();
                   properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   properties.put(Context.PROVIDER_URL, "ux0800:55304");
                   InitialContext ctx = new InitialContext(properties);
                   //InitialContext ctx = new InitialContext();
                   // get ejb home
                   home =
                        (BonusCalculatorLocalHome) ctx.lookup(
                             "localejbs/MySessionBean");
                   theCalculator = home.create();
              } catch (Exception namingException) {
                   namingException.printStackTrace();
    I get the following error
    javax.naming.NoInitialContextException: Cannot instantiate class: com.sap.engine.services.jndi.InitialContextFactoryImpl [Root exception is java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl]
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at com.sap.bonus.calculation.sessionBean.MyCommandBean.<init>(MyCommandBean.java:27)
         at com.sap.bonus.calculation.sessionBean.MyCommandBean.main(MyCommandBean.java:68)
    Caused by: java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
    Any clue will be appreciated.
    thnx

    Hi Sabbir,
    Following code works for me in calling EJB from normal java application. Did you added the jar files to your application?. see the required jar files in end of code.
    Create simple java applcation do the following steps:
    Give JNDI name to the EJB(HelloJNDI)->Add the HelloEJB to HelloEAR ->deploy
    Proxy Program to call ejb:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.sample.Hello;
    import com.sample.HelloHome;
    public class HelloTest {
         public static void main(String[] args) {
                       Hello remote = null;
                      try {
                        Context ctx = new InitialContext();
                        HelloHome home = (HelloHome) ctx.lookup("HelloJNDI");
                        remote = home.create();
                        String result = remote.hello();
                        System.out.print("Result:" + result);
                         } catch (Exception e) {
                                System.out.println("Exception:" + e.getLocalizedMessage());
    1. Go To  Run > Java Application ->New->select your project and select your main class(java program from which your going to call EJB)
    2. Click  next tab ->(x)=Arguments
    paste the following code in VM Arguments
    -Djava.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl -Djava.naming.provider.url=localhost:50104
    replace the server IP address with your server IP address where your ejbs are running.
    Under Class path settings for the program put the following jar files.
    You can search for them from net weaver soruce folders
    or copy from D:\usr\sap\J2E\JC01\j2ee\j2eeclient
    ejb20.jar
    logging.jar
    exception.jar
    sapj2eeclient.jar
    Add Corresponding ejb.jar
    and RUN >>>
    this makes testing of your client programs easier, you can find the error trace on which line and saves lot of time.
    Regards, Suresh

  • Webservice call to XI Interface through SOAP Adapter from a Web application

    I  am getting  the following error, when I try to call the XI Interface using soap adapter from a web application.
    ERROR  :
    SystemError:
              <context>XIAdapter</context>
              <code>ADAPTER.JAVA_EXCEPTION</code>
              <text><![CDATA[
    com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException
    at some time i am getting the following error.
    faultCode: HTTP
    faultSubcode:
    faultString: (500)Internal Server Error
    faultActor:
    faultNode:
    faultDetail:
         {}:return code:  500
    &lt;SAP:Error&gt;&lt;SAP:Category&gt;XIServer&lt;/SAP:Category&gt;&lt;SAP:Code&gt;RCVR_DETERMINATION.NO_RECEIVER_CASE_BE&lt;/SAP:Code&gt;&lt;SAP:Stack&gt;No receiver could be determined&lt;/SAP:Stack&gt;&lt;/SAP:Error&gt;
         HttpErrorCode:500
    (500)Internal Server Error
    can any of  one help to resolve this.
    Thanks  in advance

    Ganie
    You are getting the exception at very first point of Pipeline Service i.e Receiver Determination, do compare the namespace, Sender Interface Name & Sender Service name with the payload you are sending from web-application, they must be exactly same.
    The best way to get the test payload is suggested in above reply.

  • Help me which JNDIFactory to use to access EJB from a java class of JAR

    I am confused in understanding the different JNDI factories
    RMIInitialContextFactory, ApplicationInitialContextFactory and ApplicationClientInitialContextFactory
    And the different namespaces like global, container local and component local.
    Especially is there any relationship between the JNDI factories and the namespaces?
    Or are they related to the deployment descriptors.
    Because in application specific deployment descriptors (orion-ejb-jar.xml), we just map the JNDI location with the object (or its reference from ejb-jar.xml). We dont specify it can be accessed from this factory or that.
    Shall we access an EJB from using any JNDI factory?
    Specifically, I am stuck with what Factory to use to access an EJB from a Java class in a library (jar). The JAR is packaged with the EAR which contains the EJB Jar that I am trying to access.
    THANK YOU

    Ed,
    As Robin said, I think you need code similar to this:
    Context c = new InitialContext();
    Object o = c.lookup("java:comp/env/Name");where Name is the name of your EJB as it appears in the "ejb-jar.xml"
    deployment descriptor XML file.
    Good Luck,
    Avi.

Maybe you are looking for

  • CUIC UCCX 9.0.2 w/Prem Agent

    Can I use CUIC as a wallboard.  I just saw a brief demo and it appears that the real-time CUIC reports can show real-time wallboard data that can be used within the CAD integrated browser window.  Can anyone confirm this? Joe                 

  • Command Window Database Access via a DataSource

    Hi. I've succeeded in accessing a MySQL database via a DataSource from a servlet that makes use of a DAO. However, I would now like to use the same DAO to access the database from a standalone, command window program. The error that I am getting is "

  • BT or TalkTalk

    Hello, In July I can get BT Infinity 80/20 or TalkTalk 80/20 now TalkTalk uses BTs Fibre Network so there would be no diffence in speed, so what do you think I should do TalkTalk is probably cheaper. And if I go with TalkTalk I will probably buy the

  • RRMX for executing and creating queries

    Hi, I have some users which are able only to create queries and another group which are only able to execute them. Which auth object and values should I consider in order to distinguish these 2 roles? Thanks and regards FedeX

  • Audition does not recognize audio from Lifecam Cinema

    I just connected my new cam but when I go into Audition's audio set up I cannot get it to work as the default input device.  It is listed in the control panel as an input device but even when I move it to the top and check it the default input device