Using a Java application as EJB consumer

Hi everybody,
I'm new to EJB, and I have to develop a desktop application that will interact with some EJBs. I've done so using JSPs/Servlets as the EJBs consumers, but I can't get it to work with my Java app.
I thought it would be as easy as including some JNDI code in my app, lookup the beans and invoke their methods, but all I get is an exception.
I've read in some tutorials, that the client needs to be registered in the server, or deployed at the same time (or I completely misunderstood it), but I'm still in a development stage, so I don't want to jar everything and redeploy...
I'm using Orion, and I get the following exception:
javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec, application-client chapter for requirements and format of the file)
I've included though that META-INF/application-client.xml in my app jar.
I've been thinking about using web services as a more standard way to communicate, which do you think will be better?
Anyway, what am I doing wrong, or what should I do to make it work?
What other app server do you recomend?
thanks in advance!
Luis Javier

<--I've read in some tutorials, that the client needs to be registered in the server, or deployed at the same time (or I completely misunderstood it), but I'm still in a development stage, so I don't want to jar everything and redeploy...-->
No, client doesnt need to be registered in the server. If your client is a Java App you have to make sure that your app client classpath includes :
1) An Initial Context Factory class to create JNDI context, and it depends on server you deployed EJB components
2) An client support jar file, that contains Home,Remote interfaces and
their implementations of EJBs client will call. This support could be provided by your J2EE server deploy tool at deploying time. J2EE RI deploy tool, for axample, asks deployer if he wants to generate this jar file as he deploy an application containing some EJB module.
Fil

Similar Messages

  • Can we call a webservice  using standalone java application  ?

    Hi friends,
                   Can we call configurd webservice in xi , using standalone java application by just giving url of webservice ?
                  OR
                  Only by means of WEBDynapro we can call  ?
                    Can you please tell me the answer for this .
    Regards .,
    V.Rangarajan

    HI Ranga Rajan
    well, If at all if you have webservice...you can import that werbserivce as External definition in to IR.
    How to import:
    1) Go to IR and and move to your requied component and there you can see the option called imported objects...select on imported objects where you can give the name and you can select the webservices which you want to use it.
    2) Hope you are aware of that a werbservice will have the request and response.
    3) Create the mapping program accroding to your requirement.
    Go through blogs of Bhavesh and Naveen which talks about calling webservice in a specific condition:
    Webservice Calls From a User Defined Function - /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    Consuming/Calling webservices from DataBases - /people/sap.user72/blog/2005/10/20/consumingcalling-webservices-from-databases
    Also check this help file on Web Services:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/336365d3-0401-0010-9884-a651295aeaa9
    Cheers..
    Vasu
    <i>** Reward Points if found useful **</i>

  • How cud I run odi using a java application.

    HI,
    I need the location of the jar files that cud help me to run odi using a java application.
    I am unable to find jar file which is responsible for the invoking ODI using the classes in the package named
    "oracle.odi.sdk.invocation".
    I found this package name from doc
    regards,
    Palash Chatterjee

    It's going to depend on the application in question.

  • Can we run the batch file using simple java application

    Hello sir,
    we want to run the batch file using simple java application. i tried with some example, we run the exe files but not batch file.
    Runtime r = Runtime.getRuntime();
    r.exec("D:\\jboss\\bin\\run.bat");
    My application is server will run when we run the java appliation.
    any suggestion? plz give me the solutions

    yes you can run html file
    WEB.SHOW_DOCUMENT is a built-in that is used in Forms to call URL from a Web Form. It works much like the similar way that a link on an HTML page works and it takes two arguments, one is URL and second one is TARGET, in your case use following.
    WEB.SHOW_DOCUMENT('http://channas.iil.informatics.lk:8890/forms/frmservlet?config=abc.html', '_blank');
    Hope this will work for you
    Abbas

  • Deployment failed. Building failed using sun java application server

    Hi
    am using netbean 6 ,glassfish v2 and sun java application server 9
    When am try to run my jsp file am getting Deployment error report with further error given below.
    Deployment error:
    The Sun Java System Application Server could not start.
    More information about the cause is in the Server log file.
    Possible reasons include:
    - IDE timeout: refresh the server node to see if it's running now.
    - Port conflicts. (use netstat -a to detect possible port numbers already used by the operating system.)
    - Incorrect server configuration (domain.xml to be corrected manually)
    - Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
    - Invalid installation location.
    See the server log for details.
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
    at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
    Caused by: org.netbeans.modules.j2ee.deployment.impl.ServerException: The Sun Java System Application Server could not start.
    More information about the cause is in the Server log file.
    Possible reasons include:
    - IDE timeout: refresh the server node to see if it's running now.
    - Port conflicts. (use netstat -a to detect possible port numbers already used by the operating system.)
    - Incorrect server configuration (domain.xml to be corrected manually)
    - Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
    - Invalid installation location.
    at org.netbeans.modules.j2ee.deployment.impl.ServerInstance._start(ServerInstance.java:1270)
    at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.startTarget(ServerInstance.java:1224)
    at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.startTarget(ServerInstance.java:1035)
    at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.start(ServerInstance.java:912)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.startTargets(TargetServer.java:417)
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:140)
    ... 16 more
    BUILD FAILED (total time: 44 seconds)

    Hi,
    I've found that if you remove the j2ee-application element related to the enterprise app you are trying to deploy from Sun\AppServer\domains\domain1\config\domain.xml, and also remove your enterprise j2ee-app directory from Sun\AppServer\domains\domain1\applications\j2ee-apps\, it works.
    This is not a permanent solution. I get the same error again, when I try to redeploy the application for the third time. Hope someone can help soon!
    Thanks.

  • Reading a video input using a java application

    I want to read a live video input inside a java application and extract frames from that video,..But I don't have knowledge of doing this.
    If any of you know how to implement this would you please send me some sample applications codes to one of the following email addresses.
    [email protected]
    [email protected]
    [email protected]
    [email protected]

    I am not really sure how to solve this problem, you might be interested in checking this example on Accesing Individual Decoded Video Frames - http://java.sun.com/products/java-media/jmf/2.1.1/solutions/FrameAccess.html
    regards

  • Use of java application w/ Swing component causes Win95 system to freeze

    Hi All,
    Until yesterday, we were having a major problem that whenever we ran a java applet or application that used Swing, the Windows 95 systems would freeze tight and require a reboot.
    I had tried everything from loading the J2RE, Windows Sockets 2, J2SDK, none of which helped with the problem.
    What we found out yesterday is the Windows 95 machines that were freezing didn't have DirectX on them, and that when DirectX 8.0a was installed, the freezing problem went away.
    Just thought I'd share my success if anyone else is now struggling through the same items.
    Bruce

    hii,
    Well although the reply is litle bit late but i just wanted to thank you for your idea in installing direct x it worked fine also with a windows 2000 and 120 ram
    laterzzz

  • Which application of Netweaver will be useful for JAVA professionals

    Hi,
    I am new to Netweaver and need to know which application of netweaver will be useful for me. I am basically a JAVA Programmer.
    What exactly i can learrn in netweaver. EP,Webdynpro or XI.
    Regards,
    Sujan.

    Hi,
        Netweaver Portal(EP) is a frontend which provides one solid interface to all your applications, whether they are SAP or not. It runs on the java platform.
    You can develop pure j2ee applications using the Netweaver Developer Studio, it has plug-ins which help in developing SAP technologies such as Web Dynpro, but you don't have to use it, you can develop your application using pure java technologies like EJB, jsp, etc. It also provides a solution for deploying your apps to the web application server.
    In EP & WebDynPro, you can easily code if you have Java knowledge.Java is a big part of being a Portal Developer.
    Hope this helps.
    Regards,
    Pooja.

  • Hardware identification using Java-application

    Hi,
    please help me! I would like to get some hardware-specific information using a Java-application? Is it possible?
    Thanks everybody,
    dzsitter

    Probably not, in pure Java. Depends on what the "hardware" is that you had in mind.

  • Use OC4J jms provider in a java application

    Hi all,
    I'd like to send messages in a OC4J queue (declared in jms.xml) using a java application, is it possible?
    Thank in advice, Cesare
    I read messages by a servlet using this code:
    factory = (QueueConnectionFactory)new InitialContext().lookup("jms/myQueueConnectionFactory");
    queue = (Queue) new InitialContext().lookup("jms/myQueue");
    connection = factory.createQueueConnection();
    connection.start();
    QueueSession queueSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    QueueReceiver receiver = queueSession.createReceiver(queue);
    Message message = receiver.receive();

    hi
    if you wish to know how to send and recieve messages from a queue then there is a sample application available at the following link.
    http://otn.oracle.com/sample_code/tech/java/oc4j/samplesPage.html
    try the ch19 sample.
    hope this helps
    regards
    shrinivas

  • Unable load jasperreports using java application

    I have created a report using jasperassistant.
    But i could'nt run the report using my java
    application.below given is the code sgment to call the
    report.
    try{
    String rFile="/root/Production.jasper";
    HashMap rptHash=null;
    FileInputStream fs=new FileInputStream(rFile);
    System.out.println("loading report file , read " +fs.available());
    JasperReport template=(JasperReport)JRLoader.loadObject(fs);
    System.out.println("Successfully created the report");
    JasperPrint report=JasperFillManager.fillReport(template,rptHash,conn);
    System.out.println("Report filled with data");
    }catch(JRException jex)
    System.out.println("Jasper Exception :"+jex.getMessage());
    System.out.println("Jasper Exception :"+jex.fillnStackTrace());
    System.out.println("Jasper Exception :"+jex.getStackTrace());
    System.out.println("Jasper Exception :"+jex.getLocalizedMessage());
    While running this application ,it throws into the
    exception section.
    Out put of the program is
    Loading report file ,read 15275
    Jasper Exception : Error loading object from InputStream
    Jasper Exception :net.sf.jasperreports.engine.JRException :Error loading object from InputStream Jasper Exception :[Ljava.lang.StackTraceElement;@e7b241
    Jasper Exception :Error loading object from InputStream
    I request you to go through my code and give me some help to solve this asap.
    thanking you

    Do you actually mean you want to make sure that only one instance of a GIVEN Java program is running at one time? If so then search this forum becuse this question comes up frequently.

  • Unable to run jasperreport using java application

    I have created a report using jasperassistant.
    But i could'nt run the report using my java
    application.below given is the code sgment to call the
    report.
    try{
    String rFile="/root/Production.jasper";
    HashMap rptHash=null;
    FileInputStream fs=new FileInputStream(rFile);
    System.out.println("loading report file , read " +
    fs.available());
    JasperReport
    template=(JasperReport)JRLoader.loadObject(fs);
    System.out.println("Successfully created the report");
    JasperPrint
    report=JasperFillManager.fillReport(template,rptHash,conn);
    System.out.println("Report filled with data");
    }catch(JRException jex)
    {System.out.println("Jasper Exception
    :"+jex.getMessage());
    System.out.println("Jasper Exception
    :"+jex.fillnStackTrace());
    System.out.println("Jasper Exception
    :"+jex.getStackTrace());
    System.out.println("Jasper Exception
    :"+jex.getLocalizedMessage());
    While running this application ,it throws into the
    exception section.
    Out put of the program is
    Loading report file ,read 15275
    Jasper Exception : Error loading object from
    InputStream
    Jasper Exception
    :net.sf.jasperreports.engine.JRException :Error
    loading object from InputStream
    Jasper Exception
    :[Ljava.lang.StackTraceElement;@e7b241
    Jasper Exception :Error loading object from
    InputStream
    I request you to go through my code and give me some help to solve this asap.
    thanking you

    Hi Again Monty.
    I may have given up too soon.
    Click once on the downloaded TheGame.zip file to highlight it.
    Press the Command⌘ + I keys, to Get Info.
    Change Open With to Stuffit Expander.
    Double-Click on TheGame.zip.
    A folder titled TheGame will be created. Open that.
    In there will be:
    decks An Empty Folder
    Game.jar
    game.xml
    images Folder This one has many sub entries.
    preferences.properties
    readme.txt
    release_notes.txt
    runme.bat
    When I Get Info on Game.jar, Open With is set to Jar Launcher.
    That's as far as I am going though. does that help any?
    ali b

  • Java application won't start anymore

    Hi,
    I am using a Java Application (Protege) that was running just fine last week but today it just won’t start!
    When click-on it jumps about 3 time in the dock and stop. I was able to run the connected .jar file but most of the features are not available this way.
    I have not done anything special since last week beside Safari update (1.3.2.).
    Any help is greatly appreciated.
    Regards,
    Adrien
    iBook G4 (1Ghz)   Mac OS X (10.3.9)  

    Did you update Quicktime to 7.0.4? See if the following discussion seems relevant. There's a solution in the fourth message (reverting to Quicktime 7.0.1).
    http://discussions.apple.com/thread.jspa?messageID=1500443
    If that's the fix, the problem may be due to Protege using an outdated JavaApplicationLauncher. See
    http://www.opensubscriber.com/message/[email protected]/3072264.html
    --Davipo
    iMac G5   Mac OS X (10.3.9)  

  • Sort order in Java application (oc4j container) -- ear file deployment

    I have a Java application deploy in Oracle OC4J container (EAR file).
    In my Java application (jsp), I have a SQL statement who return data but the
    sort order is wrong. The letters "é" and all characters with accents
    appears at the end of the result.
    I tried many things to change the sort order (NLS parameters in database
    and OAS10g parameter files).
    When I use SQL*plus on database server, that's working.
    The sort order is wrong when I use the java application.
    Somebody can tell me what and where is the NLS parameters to change ?
    Thanks
    Robin

    Robin,
    I'm only guessing, but it could either be related to the java locale or the CHARSET attribute of the HTML header -- and nothing to do with the NLS parameters.
    Maybe you should try the Globalization Support forum?
    Good Luck,
    Avi.

  • Sort order in Java Application (deploy in Oracle oc4j container)

    I have a Java application deploy in Oracle OC4J container (EAR file).
    In my Java application (jsp), I have a SQL statement who return data but the
    sort order is wrong. The letters "é" and all characters with accents
    appears at the end of the result.
    I tried many things to change the sort order (NLS parameters in database
    and OAS10g parameter files).
    When I use SQL*plus on database server, that's working.
    The sort order is wrong when I use the java application.
    Somebody can tell me what and where is the NLS parameters to change ?
    Thanks
    Robin

    Robin,
    I'm only guessing, but it could either be related to the java locale or the CHARSET attribute of the HTML header -- and nothing to do with the NLS parameters.
    Maybe you should try the Globalization Support forum?
    Good Luck,
    Avi.

Maybe you are looking for

  • Purchase order number  and there in voice number

    Hi    can Any buddy help me to find the PO number and its corresponding Invoice document number from table LFB1. LFB1->PO->Invoice num. thanks imran

  • Portal url redirect

    Hi All, Because of a requirement,  I wanted to retreieve the requestURL and append compnay name to it for identification and redirect the url. basically if my portal url is http: <servername:port>\irj\portal , then get the hostname and append to port

  • Best layout for my interface?

    Hi, I'm trying to make a login interface for an authenticator I'm working on and I've tried a few layouts but I can't find one that works and looks similar on both Ubuntu Linux and Windows 7. Here's what I'm currently using: import java.awt.FlowLayou

  • Working with Flash in Captivate 3

    Hi, I'm now able to create and show Flash animations in Captivate but am struggling. For example I have a Flash animation with Next buttons so the user can pause and read but I notice the slide still runs and when it stops the animation stops. This m

  • FX5600 freezes in 3D

    Hi, got GREAT PROBLEM. My MSI FX5600 -VDTR128MB freezes in 3D applications. IT IS NOT A MOBO ISSUE - i have got MSI K7N2 Delta-L mobo with PC3200 512MB 400MHz memory (Kingston). As far as seen allready on forum THIS ISSUE COMES UP QUITE OFFTEN, so WH