[b]How connect to EJB from java webstart[/b] ?

Hi,
I'm a newcomer to J2EE, I'd like to build J2EEE app
first of all,I've developed simple EJB components and jSwing client to call method from EJB. All in the same project.
Client programe has method
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.PROVIDER_URL, "ormi://10.145.100.2:23891/current-workspace-app");
return new InitialContext(env);
When I run client app it work well, I follow in Jdev905 to deploy to java webstart
1. Create .jar file (Item JAR file - Simple archive)
2. Create Java web start(JNLP) files
after that, I have .jar,.html,.jnlp file
3. running project(use embedded OC4J server)
4. running .html file
first, java webstart download code then run but nothing
happen. I think that It may be some wrong in JNDI look up.
I try my best, It's taken me a week but I still do'nt understand.
! Please help show how to go through that or how to deploy using java web start. We intend to develop rich client.
thanks a lots!
Kien
(Sorry for my bad English)

This might be of help http://developer.novell.com/wiki/ind...asses_for_Java
>>> dikshaneel<[email protected]> 12/8/2009 3:16 AM >>>
Can someone please tell me how should I connect to LDAP from Java?
Thanks in advance-- dikshaneel------------------------------------------------------------------------dikshaneel's Profile: http://forums.novell.com/member.php?userid=72973View this thread: http://forums.novell.com/showthread.php?t=395162

Similar Messages

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

  • Error IFS-20010 connecting to IFS from java class

    Hello,
    I try to connect to IFS from java program with sentences:
    LibraryService ifsService = new LibraryService();
    CleartextCredential me = new CleartextCredential("user", "password");
    ConnectOptions connectOpts = new ConnectOptions();
    connectOpts.setServiceName("ifsDefault");
    connectOpts.setServicePassword("ifspassword");
    LibrarySession ifsSession = ifsService.connect(me,connectOpts);
    the class compile but not run because the error:
    IFS-20010: Failed to get PropertiesResourceBundler ifsDefault.
    The message errors documentation said:
    This error occurs when attempting to start an Oracle iFS process by specifying a service properties file name that cannot be located by the Oracle iFS repository. The
    parameter specified in the error is the name of the specified service properties file. The specified service properties file
    must exist in the oracle.ifs.server.properties package
    descending from one of the directories included in the
    CLASSPATH setting for the process.
    I don't understand what mean this, somebody yes?
    Please give me any idea.
    What can i do to solve this problem?
    Thanks.
    FABIAN

    Hi,
    Make sure you have $ORACLE_HOME/ifs/settings in your classpath.
    Good luck.

  • How to invoke Matlab from Java

    Hi, I want to pass some data generated from Java class to Matlab, then invoke Matlab from Java to run the computation program (file written in Matlab, myfile.m). I know Matlab can use classes generated from Java, how to drive Matlab from Java?
    I appreciate your help!
    yaya

    According to their documentation, you can't. Having said that, again according to their documentation, there are plans to support this in future releases.
    m

  • How connect to internet from domain created in Hyper-V

    How connect to internet from domain created in Hyper-V
    Host =  Win8 Pro
    Connection to internet done using WI-FI
    Internet seeting
    Home router with secury connection -> cable internet
    Network name set on router = "Mtl2014"
    Host setting
    TCP/IPv4 Seeting for WI-FI ,connected to "Mtl2014"
    Obtain address automaticly
    Obtain DNS server address automaticly
    I can connect and browse internet from host
    In Hyper-V
     1.created 2 private virtual switches SW1 and SW2
     2.installed 2 VM HA1 and DC with Win2012 server eval edition
     3.assigned stations HA1 and DC  to virtual switch SW1
    on Host
    WI-FI network connection
     Sharing->Allow other network to connect.. ->Home network connection vEnthernet (SW1)
    in Hyper-V
     choose Activate windows on  HA1 and DC
     open browser on HA1 and DC ,
     At this point I am able to see and browse and search in google from HA1 and DC
    In Hyper-V
     assined virtual switch SW2 to DC and HA1
     created Domain controler on DC and domain Alex1.com
     TCP/IPv4 Seeting on DC
     IP = 192.165.1.8
     subnet = 255.255.255.0
     default getaway = empty
     Prefered DNS server = 192.165.1.8
     TCP/IPv4 Seeting on HA1
     IP = 192.165.1.11
     subnet = 255.255.255.0
     default getaway = 192.165.1.8
     Prefered DNS server = 192.165.1.8
     added HA1 to domain Alex1.com
    Question
     What seeting on SW2, DC, HA1 and  Wi-FI should I change in order to have access to internet from  Alex1\DC and Alex1\HA1?
    I was planning to use internet to download/install pacthes/updates for windows and sql servers located on Alex1\
    I plan to build 6 more Win 2012 server eval and join then to Alex1\
    Thank you
    Alex

    I see.
    1. 192.168.0.0 addresses are not routable across the public Internet. Even if the whole world knows you're using that space, the information is useless. But if you feel better hiding it, OK.
    2. Internal doesn't allow communications with a physical network either. Only the external type does.
    3/4. Your problem is not really with Hyper-V. It's with IP.
    Your machines are all able to communicate with each other because they're on the same switch and the same subnet. No gateway is required. If you have a computer with an IP of 192.168.1.8 and its subnet mask is 255.255.255.0, then it will be able to communicate
    with any computer on the same switch with an IP of 192.168.1.anything. It's when they need to talk to computers off of that subnet (anything that doesn't fit the 255.255.255 mask) that they have a problem. For that, you need a gateway somewhere. You can't
    use "DC" for the gateway because it's not performing routing services.
    You have two choices.
    One is to use an external switch so that your guests are directly connected into your physical network. That will take over your WiFi adapter, so you'll probably want to set the share option so your Win8.1 box continues to function. Then just use a common
    IP subnet with everything else on your home network.
    The second is to set up a software router. If you are using an internal virtual switch, then this has to be in the Win8 environment. I might be mistaken, but I think that
    Internet Connection Sharing would even work for this. If you are using an internal virtual switch, then your Win8 system should see two (or more) adapters. One of them is the physical adapter (we'll call it wNetAdapter) and one would be the virtual adapter
    (we'll call it vNetAdapter) it uses on the virtual switch. Once you set up ICS, you would have all of your VMs use the IP address that you assigned to vNetAdapter as their gateway.
    Eric Siron Altaro Hyper-V Blog
    I am an independent blog contributor, not an Altaro employee. I am solely responsible for the content of my posts.
    "Every relationship you have is in worse shape than you think."

  • How to initiate process from Java?

    Hello,
    Does anyone knows how to initiate Process from java code???
    or Which API can start a new instance of Business process??

    If you are on Oracle BPM 10g, here's a link to a thread on this forum that might also help. It is a step-by-step.
    Creating a new work item instance in a process using PAPI
    Dan

  • How to connect to mysql from java app

    hi
    please say the procedure for connecting to mysql database from java app.
    .) what should i give in environmental variables
    .)where can i find the driver class for the mysql
    .) syntax of the url
    eg:- DM.getConnection("jdbc:mysql:..............what comes here..............");

    You can also get connections from a DataSource. Simple example:
                MysqlDataSource msds = new MysqlDataSource();
                msds.setUrl("jdbc:mysql://127.0.0.1:3306/dbdame");
                msds.setUser("user");
                msds.setPassword("pass");
                Connection c = msds.getConnection();Explore your options and be sure to consider connection pooling.

  • How to call ejb from Forms?

    Hi.
    I have an existing form (version 11.1.2.0.0) and an existing ejb. Both are running on a WebLogic server version 10.3.5.0. I want to call the ejb from the form (I know that this is not recommended, but in this case it is the only sensible solution). I have tried searching the web but I have not been able to find anything about this except some broken links.
    Can somebody please explain how to do this or show me some documentation or tutorial?
    Regards,
    Sveinung
    Edited by: SvSig on Aug 7, 2012 11:52 PM

    Let's skip the fact that you are asking about an EJB and instead talk about what options are available to call out to any external app or component. Here are some of the options:
    <blockquote>1. To make calls from the client machine to any web server (HTTP listener) you can use WEB.SHOW_DOCUMENT. This command simply passes a url to a browser. No return information is passed back into the running form.
    2. To make calls from the client machine to almost any process on the client side, including the OS directly, you would need to create a java bean and integrate it into your form. Whether or not you get return information will depend on how you write the bean and to what you are calling.
    3. To make calls from the server side (mid tier) part of a running form to an external application or component on the same mid tier you can use the HOST command. This executes a shell command. Although specific information cannot be returned (i.e. return values), you can get pass or fail results.
    4. To call out to java applications on the mid tier you can import java code into your Forms application using the Forms Java Importer. This will give you a direct connection to the java application both in and out.</blockquote>
    All of the above examples are explained in the Forms Builder online help. There are other options which are explained in the Forms Deployment Guide
    <blockquote>http://docs.oracle.com/cd/E24269_01/doc.11120/e24477/toc.htm</blockquote>
    Look specifically at chapters 6-8
    <blockquote><li>6 Oracle Forms and JavaScript Integration
    <li>7 Enhanced Java Support
    <li>8 Working with Server Events</blockquote>
    Summary
    <blockquote><li>WEB.SHOW_DOCUMENT
    <li>HOST
    <li>Java Bean
    <li>Imported Java</blockquote>

  • Error in connecting Oracle Database from JAVA application!!!

    Hi,
    I am trying to connect to the Oracle11g database server from the client machine using JAVA eclipse. I have installed the oracle client in the client machine. Once i try to execute the below code it was throwing below error:
    public class Dbconnect {
    public static void main (String[] args)throws Exception {
    try {
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    String connectString = "jdbc:oracle:thin:@<IP Address>:1521:orcl";
    OracleDriver drivers = new OracleDriver();
    System.out.println(drivers);
    Connection connection = null;
    connection = (OracleConnection)DriverManager.getConnection(connectString,"ADMIN", "admin");
    System.out.println(connection);
    System.out.println("Connected to the database");
    Error:
    java.sql.SQLException: The Network Adapter could not establish the connection
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at DBConnect.main(DBConnect.java:15)
    Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
         at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
         at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
         at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
         ... 7 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
         at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
         at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
         ... 12 more
    I am unable to connect using sqlplus as well ORA-12560: TNS:protocol adapter error
    Please advise me on how to resolve this issue..
    Thanks

    Prabhu wrote:
    We are not able to connect from SQLplus as we.. If i issue this command in Sqlplus from client machine 'sqlplus admin/admin@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<Ip Adddress>)(PORT=1521)))(CONNECT_DATA=(SID=orcl)))'' it was throwing the below error.
    Error: ORA-12541: TNS:no listener
    Do i need add get any config details in the client machine..
    Could please tell me what is the general procedure to access the DB server from client machine..on DB Server issue following OS commands
    lsnrctl start
    lsnrctl status
    lsnrctl service
    COPT commands & results, then PASTE all back here

  • Calling EJB from Java Stored Procedures

    Hi,
    I am trying to call an Enterprise Java Bean from stored procedure. This stored procedure calls a java program. As long as it is a simple java program it works fine and loadjava.exe does not give any problem (neither compile-time nor run-time).
    It is not working when I am trying to call EJB from it. It is giving compile-time error.
    If anybody has implemented the same please suggest how to go forward.
    thanks in advance,
    Shashank Agarwal

    I tried the same thing without any luck. I assume you are using OC4J for your EJB ...
    The compiling issue may be because you don't have the classes in your EJB client jar loaded into the database. Once those classes are loaded, you should loadjava without any problem.
    However, you won't be able to call the EJB server because the EJB client (your Java code in the DB) will need the OC4J environment (oc4j.jar). I have tried to load oc4j.jar into the DB as well, and that was a big mess and nothing worked. My DB is 8.1.7, maybe the new 9i have OC4J libs bundled?!?
    I looked around and only found 2 alternatives:
    1. Write a JSP page that acts like an EJB client, then use URLConnection in your DB java code to send params to the JSP for it to invlode the EJB
    2. Replace the JSP with RMI code, and use RMI instead of URLConnection in your DB code to invloke the EJB client.
    If you find any other solution, please share it here.
    Good luck!
    Hi,
    I am trying to call an Enterprise Java Bean from stored procedure. This stored procedure calls a java program. As long as it is a simple java program it works fine and loadjava.exe does not give any problem (neither compile-time nor run-time).
    It is not working when I am trying to call EJB from it. It is giving compile-time error.
    If anybody has implemented the same please suggest how to go forward.
    thanks in advance,
    Shashank Agarwal

  • Clear text  password - how to send it from java.

    I am trying to reset the password of a user from java.
    So I have to open a socket connection to Unix box and send a packet in following format
    "<adminUserid> <adminPassword> PASSWORD <target-userId> <new-passwd>\n"
    So they say that user credentials are to be send in cleartext
    Please tell me how i can send above string as cleartext
    thanks in advance.
    Renjith.

    But this is not working for me , UNIX gurus please help
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.io.BufferedWriter;
    import java.io.OutputStreamWriter;
    import java.io.IOException;
    public class TestUnix {
    public static void main(String args[] ) {
         try {
                 InetAddress addr = InetAddress.getByName("x.x.x.x");
                 int port = 6546;
              System.out.println("Address IP : "+addr);
                 // This constructor will block until the connection succeeds
                 Socket socket = new Socket(addr, port);
              BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
              String command = "<Admin><admin-pwd>PASSWORD<user><user-pwd>\n";
              System.out.println(command);
                     wr.write(command);
                 wr.flush();
              socket.close();
              System.out.println("Finished executing");
             } catch (UnknownHostException e) {
             } catch (IOException e) {
    }

  • Problems connecting with database from java API

    I've benn using XSQLRequest and I found a problem with
    connections, because it can't connect from Java to database, but
    if I access to a .xsql it works.
    And also if I link to a .xsql first and after that I try to
    access to Database form my servlet it works. So I think my
    problem is to initialize the XSQLConfig.xml file in OC4J server.
    Thanks in advance

    Would you provide the way you deploy your XSQL app to OC4J and
    how you get JDBC connection using JAVA? I execute the next code more or less:
    miXSQLRequest = new XSQLRequest(XSQLQuery.getDOM
    (),null);
    miXSQLRequest.process(htParamsIn, pWriter, pErrors);
    but and it's probabily my mistake I don't get any conecction
    from the session or something similar because I thought that
    it's made by XSQLRequest, and the XSQLRequest class takes the
    default values of the connection pool from the file
    XSQLConfig.xml (I put this file inside the lib directory of
    OC4J) as the XSQLServlet.
    Thanks for your help

  • How to pass session from Java to Perl

    Hi,
    I need to pass a session value from Java to Perl, does anyone knows how can I do it?
    Thanks

    If you want to run java code from Perl, and have it return a single value, that's one thing: but having Perl interact with java code - calling methods, returning values - that may not be possible.
    Look into python to see if it may be what you're looking for. It's a scripting language that allows real interaction with java.
    If all you want to do is run java code and have it return some data, that would be trivial, so I assume that's not what you mean. But in case it is heres an idea:
    Set up a network connection between them with your own protocol, seeing as both languages are good at networking.

  • How to call ejb from a Swing gui application client?

    Hi Everyone,
    I am new to EJB and I have question for calling an ejb from a Swing GUI application client. Can anyone give me an example of how my Swing GUI can call an EJB from a SUN ONE Application Server. If anyone can give me some insight, I appreciate it.

    I have looked up various sources and just can't get it to work. I know I have to use the lookup() method, but I have also seen lookups using IIOP://servename......
    Context ctx = getInitialContext();
    DemoHome dhome = (DemoHome)ctx.lookup("demo.DemoHome");
    or
    Context ctx = getInitialContext();
    DemoHome dhome = (DemoHome)ctx.lookup(java:comp/......)
    so can anyone tell what is the difference between using iiop://servername..... as the lookup string and java:comp/......
    and if using java:comp/ what does this mean? Does it mean that lookup() method is looking for the ejb somewhere in this directory. I would really appreciate if someone can give an example of a Swing GUI calling a ejb from an application server and how the code is actually doing the lookup in and what are each steps it goes through.
    Thanks

  • How to call webservice from Java application

    Hi XI gurus
    Pls let me know how to call a webservice from Java application.
    I wanted to build synchronous interface from Java Application to SAP using SAP XI
    For example, i need to create Material master from Java application and the return message from SAP, should be seen in Java application
    Regards
    MD

    Hi,
    If your  JAVA Application is Web based application, you can expose it as Webservice.
    JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
    So we can Use SOAP Adapter or HTTP in XI..
    If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
    If you are dealing with the Webservice and SAP Applications means check this
    Walkthrough - SOAP  XI  RFC/BAPI
    REgards
    Seshagiri

Maybe you are looking for