Accessing EJB components from a Remote Client

Hi,
When an web component (Servlet/JSP/Java appl.) need to invoke an business method from an EJB, it first lookup for the registered name from the Application server and obtain the remote reference i.e. the EJB Remote interface. To do this, the client must have got the client-jar file containing the stub. Now, if in a distributed environment, my client is in a different machine and need to access the J2EE server across network, what would be the scenereo.
Is it so, for every EJB the client need to call, it must have got the client-jar file in it's local classpath ? this seems to be not at all feasible.
Is it so, the client loads the Stub acroos the network while obtaining the remote reference ?
Please inform me, what actually happens when a client invokes a EJB call deployed in any application server, across the network !!!
Regards,
Kaustuv Bhattacharya

Greetings,
Hi,
When an web component (Servlet/JSP/Java appl.) need to
invoke an business method from an EJB, it first lookup
for the registered name from the Application server
and obtain the remote reference i.e. the EJB Remote
interface. To do this, the client must have got the
client-jar file containing the stub. Now, if in aFor web components running in the same application context, the client-jar is not required - the server-jar also contains the necessary stubs. However, for application clients, the client-jar is required...
distributed environment, my client is in a different
machine and need to access the J2EE server across
network, what would be the scenereo.The client-jar must be distributed with your application, or accessible from a shared network resource, either way...
Is it so, for every EJB the client need to call, it
must have got the client-jar file in it's local
classpath? this seems to be not at all feasible.Yes, the client-jar must be included in the client's classpath... Why isn't it feasible? The client-jar(s) can easily be distributed with your application. The necessity to include them in the application's CLASSPATH does not necessitate their inclusion into the client-machine's CLASSPATH. Simply include the jar(s) as part of the JVM's -cp option.
Is it so, the client loads the Stub acroos the network
while obtaining the remote reference?A copy of the remote interface's stub file is included for casting purposes. However, a copy of the stub containing the correct communication parameters (such as TCP/IP port number, reference ID, etc. per vendor implementation...), for the remote reference does get downloaded.
Please inform me, what actually happens when a client
invokes a EJB call deployed in any application server,
across the network !!!The exact details are vendor specific and depends on the actual protocol in use by the stub-layer. However, the general behaviour is in-line with RMI(-IIOP) communication.
Regards,
Kaustuv BhattacharyaRegards,
Tony "Vee Schade" Cook

Similar Messages

  • Accessing EJB's from CORBA clients

    Hi!
    Can someone answer one badly important question?
    Is it possible to access EJB's from CORBA clients directly, as if the
    beans were ordinary CORBA objects? I mean DIRECT access - WIDHOUT
    CORBA/Java server application as a liason between CORBA client and EJB
    server!
    I'm using WebLogic Enterprise 5.0.1.
    Thanks in advance.
    Aleksey.

    Please reference a later posting on this very same question.
    -- Lou Caraballo
    Sr. Systems Engineer
    BEA Systems Inc., Denver Telco Group
    719-332-0818 (cell)
    720-528-6073 (denver)
    Aleksey Bukavnev <[email protected]> wrote in message
    news:[email protected]..
    Thank you!
    Aleksey.
    Bill Lloyd wrote:
    There is a java to IDL mapping, which is quite complex. To use it, you
    must
    have an ORB which supports, at minimum, CORBA 2.3. ORBs I know of which
    support this include Orbix 2000 for Java, Visibroker 4.0 for Java, and
    Orbacus 4.0 for Java.
    Also, check out the June 2000 "Java Report" which has an article onthis.
    >>
    To be perfectly honest, though, the best solution is to write a bridge,in
    Java. One side is IDL, which CORBA clients use. The implementation ofthat
    IDL makes RMI requests to get the necessary info. This solution willwork,
    guaranteed. The portion of the spec for the java to IDL mapping isstill
    quite new, and I would expect some, uh, "unexpected features" at thistime.
    >>
    -B
    "Aleksey Bukavnev" <[email protected]> wrote in message
    news:[email protected]..
    Hi!
    Can someone answer one badly important question?
    Is it possible to access EJB's from CORBA clients directly, as if the
    beans were ordinary CORBA objects? I mean DIRECT access - WIDHOUT
    CORBA/Java server application as a liason between CORBA client and EJB
    server!
    I'm using WebLogic Enterprise 5.0.1.
    Thanks in advance.
    Aleksey.

  • Not able to access javaFx charts from a remote system after using ext. jars

    We are facing following issue. Any recommendations to resolve these issues are highly appreciated.
    1. Not able to access javaFx charts from a remote system (More details at the end of mail).This is high priority requirement as we have a web based reporting application and users access it over our static IP address.
    We are using Java Fx charts in our web application where we built jnlp and jar files in a separate fx project and kept jar and jnlp’s inside our web project.
    It is working fine when we did not used any external jar files and remotely it is accessible. But when we used external jars our project is running on local
    system but remotely it is not working due to some path settings. We modified jnlp files where entry of jar files exists and modified the jar path as per our
    project. But still it did not work.
    Before using external jars inside our java fx project my jnlp looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8083/servlet/org.netbeans.modules.javafx.project.JnlpDownloadServlet/F%3A/New+FX+Projects+08-12-
    2009/JavaFXApplication3/dist/" href="JavaFXApplication3.jnlp">
    <information>
    <title>JavaFXApplication3</title>
    <vendor>Saurabh</vendor>
    <homepage href="http://localhost:8083/servlet/org.netbeans.modules.javafx.project.JnlpDownloadServlet/F%3A/New+FX+Projects+08-12-
    2009/JavaFXApplication3/dist/"/>
    <description>JavaFXApplication3</description>
    <offline-allowed/>
    <shortcut>
    <desktop/>
    </shortcut>
    </information>
    <resources>
    <j2se version="1.5+"/>
    <extension name="JavaFX Runtime" href="http://dl.javafx.com/1.2/javafx-rt.jnlp"/>
    <jar href="JavaFXApplication3.jar" main="true"/>
    </resources>
    <application-desc main-class="com.sun.javafx.runtime.main.Main">
    <argument>MainJavaFXScript=misc.Test</argument>
    </application-desc>
    <update check="background">
    </jnlp>
    After modifying my jnlp as per my project as
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="/PiFx/FxFiles/" href="JavaFXApplication3_browser.jnlp">
    <information>
    <title>JavaFXApplication3</title>
    <vendor>Saurabh</vendor>
    <homepage href="/PiFx/FxFiles/"/>
    <description>JavaFXApplication3</description>
    <offline-allowed/>
    <shortcut>
    <desktop/>
    </shortcut>
    </information>
    <resources>
    <j2se version="1.5+"/>
    <extension name="JavaFX Runtime" href="/PiFx/FxFiles/javafx-rt.jnlp"/>
    <jar href="/PiFx/FxFiles/JavaFXApplication3.jar" main="true"/>
    </resources>
    <applet-desc name="JavaFXApplication3" main-class="com.sun.javafx.runtime.adapter.Applet" width="500" height="500">
    <param name="MainJavaFXScript" value="misc.MyChart">
    </applet-desc>
    <update check="background">
    </jnlp>
    After adding external jars my jnlp looks like this :
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8083/servlet/org.netbeans.modules.javafx.project.JnlpDownloadServlet/F%3A/New+FX+Projects+08-12-
    2009/JavaFXApplication3/dist/" href="JavaFXApplication3.jnlp">
    <information>
    <title>JavaFXApplication3</title>
    <vendor>Saurabh</vendor>
    <homepage href="http://localhost:8083/servlet/org.netbeans.modules.javafx.project.JnlpDownloadServlet/F%3A/New+FX+Projects+08-12-
    2009/JavaFXApplication3/dist/"/>
    <description>JavaFXApplication3</description>
    <offline-allowed/>
    <shortcut>
    <desktop/>
    </shortcut>
    </information>
    <resources>
    <j2se version="1.5+"/>
    <extension name="JavaFX Runtime" href="http://dl.javafx.com/1.2/javafx-rt.jnlp"/>
    <jar href="JavaFXApplication3.jar" main="true"/>
    <jar href="lib/jdom.jar"/>
    </resources>
    <application-desc main-class="com.sun.javafx.runtime.main.Main">
    <argument>MainJavaFXScript=misc.Test</argument>
    </application-desc>
    <update check="background">
    </jnlp>
    I have modified the jnlp as per my project :
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="/PiFx/FxFiles/" href="JavaFXApplication3_browser.jnlp">
    <information>
    <title>JavaFXApplication3</title>
    <vendor>Saurabh</vendor>
    <homepage href="/PiFx/FxFiles/"/>
    <description>JavaFXApplication3</description>
    <offline-allowed/>
    <shortcut>
    <desktop/>
    </shortcut>
    </information>
    <resources>
    <j2se version="1.5+"/>
    <extension name="JavaFX Runtime" href="/PiFx/FxFiles/javafx-rt.jnlp"/>
    <jar href="/PiFx/FxFiles/JavaFXApplication3.jar" main="true"/>
    <jar href="/PiFx/FxFiles/lib/jdom.jar"/>
    </resources>
    <applet-desc name="JavaFXApplication3" main-class="com.sun.javafx.runtime.adapter.Applet" width="500" height="500">
    <param name="MainJavaFXScript" value="misc.MyChart">
    </applet-desc>
    <update check="background">
    </jnlp>
    where PiFx is our project Name

    We have tried few things given in thread : http://forums.sun.com/thread.jspa?threadID=5401999
    Now it is not able to get the external jar file only
    exception: Cannot find cached resource for URL: http://192.168.0.111:8086/PiFx/FxFiles/lib/jdom.jar.
    java.io.IOException: Cannot find cached resource for URL: http://192.168.0.111:8086/PiFx/FxFiles/lib/jdom.jar
         at com.sun.deploy.net.DownloadEngine.getCachedResourceFilePath(Unknown Source)
         at com.sun.javaws.LaunchDownload.getSignedJNLPFile(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedLaunchDescHelper(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedLaunchDesc(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.io.IOException: Cannot find cached resource for URL: http://192.168.0.111:8086/PiFx/FxFiles/lib/jdom.jar
    exception: Cannot find cached resource for URL: http://192.168.0.111:8086/PiFx/FxFiles/lib/jdom.jar.
    java.io.IOException: Cannot find cached resource for URL: http://192.168.0.111:8086/PiFx/FxFiles/lib/jdom.jar
         at com.sun.deploy.net.DownloadEngine.getCachedResourceFilePath(Unknown Source)
         at com.sun.javaws.LaunchDownload.getSignedJNLPFile(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedLaunchDescHelper(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedLaunchDesc(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.io.IOException: Cannot find cached resource for URL: http://192.168.0.111:8086/PiFx/FxFiles/lib/jdom.jar
    JavaFXApplication3.jnlp
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="/PiFx/FxFiles/" href="JavaFXApplication3.jnlp">
        <information>
            <title>JavaFXApplication3</title>
            <vendor>Saurabh</vendor>
            <homepage href="/PiFx/FxFiles/"/>
            <description>JavaFXApplication3</description>
            <offline-allowed/>
            <shortcut>
                <desktop/>
            </shortcut>
        </information>
        <resources>
            <j2se version="1.5+"/>
            <extension name="JavaFX Runtime" href="/PiFx/FxFiles/javafx-rt.jnlp"/>
            <jar href="/PiFx/FxFiles/JavaFXApplication3.jar" main="true"/>
            <jar href="/PiFx/FxFiles/lib/jdom.jar" main="true" />
        </resources>
        <application-desc main-class="com.sun.javafx.runtime.main.Main">
            <argument>MainJavaFXScript=misc.MyChart</argument>
        </application-desc>
        <update check="background">
    </jnlp>JavaFXApplication3_browser.jnlp
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="/PiFx/FxFiles/" href="JavaFXApplication3_browser.jnlp">
        <information>
            <title>JavaFXApplication3</title>
            <vendor>Saurabh</vendor>
            <homepage href="/PiFx/FxFiles/"/>
            <description>JavaFXApplication3</description>
            <offline-allowed/>
            <shortcut>
                <desktop/>
            </shortcut>
        </information>
        <resources>
            <j2se version="1.5+"/>
            <extension name="JavaFX Runtime" href="/PiFx/FxFiles/javafx-rt.jnlp"/>
           <jar href="/PiFx/FxFiles/JavaFXApplication3.jar"  main="true"/>
            <jar href="/PiFx/FxFiles/lib/jdom.jar" main="true"/>
        </resources>
        <applet-desc name="JavaFXApplication3" main-class="com.sun.javafx.runtime.adapter.Applet" width="500" height="500">
            <param name="MainJavaFXScript" value="misc.MyChart">
        </applet-desc>
        <update check="background">
    </jnlp>Applet Code
    javafx({
    archive: "../FxFiles/JavaFXApplication3.jar",
    draggable: true,
    height:hgt,
    width:wdt,
    code: "misc.MyChart",
    name: appletName,
    id: appletName
    });

  • Connection to a tuxedo server from a  remote client

    How do we connect from a remote client to a Tuxedo server?
    When we tried to build a workstation client using buildtuxedo 8.0,it is unable
    to link "libnwi.lib" file.But there is no "libnwi.lib" file in the system
    please resolve this error

    subhash,
    You should be able to build a workstation client using buildclient -w
    {other options}
    If this isn't woking, you should contact BEA support.
    Regards,
    Peter.
    Got a Question? Ask BEA at http://askbea.bea.com
    The views expressed in this posting are solely those of the author, and BEA
    Systems, Inc. does not endorse any of these views.
    BEA Systems, Inc. is not responsible for the accuracy or completeness of
    the
    information provided
    and assumes no duty to correct, expand upon, delete or update any of the
    information contained in this posting.
    subhash wrote:
    How do we connect from a remote client to a Tuxedo server?
    When we tried to build a workstation client using buildtuxedo 8.0,it is unable
    to link "libnwi.lib" file.But there is no "libnwi.lib" file in the system
    please resolve this error

  • Accessing EJB's from Applet

    Hai friends,
    I want to access the ejb form the applet is it possible ?
    if passible please let me know how we access?
    Please send souce code to this id
    [email protected]
    Ok Friends i am wating for replys

    Is it possible to access EJB's from applet?Yes, but not recommended.
    if Yes,Please let me know how will happen and also if
    possible send me the peace of source code for this.
    mail id is : [email protected]
    Are you inviting spam by passing your mail id?
    Google and find out how EJB lookups are performed.

  • Error while accessing EJB method from JSP

    Hi,
    I am trying to access a bean from a JSP and have the foll. code piece:
    String url = "t3://localhost:7001";
    public Context getInitialContext() throws Exception {
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, url);
    return new InitialContext(p);
    String getStackTraceAsString(Exception e)
    // Dump the stack trace to a buffered stream, then send it's contents
    // to the JSPWriter.
    ByteArrayOutputStream ostr = new ByteArrayOutputStream();
    e.printStackTrace(new PrintWriter(ostr));
    return(ostr.toString());
    %>
    <%
    String op="";
    try {
    // Contact the AccountBean container (the "AccountHome") through JNDI.
    Context ctx = getInitialContext();
    out.println("initial context got !!");
    DemoHome home = (DemoHome) ctx.lookup("demo.DemoHome");
    out.println("home got !!");
    %>
    <p>
    <%
    Demo ac = null;
    try {
    ac = (Demo) home.create();
    out.println("create called!!");
    if (ac==null)
    out.println("ac is null!");
    catch (Exception ee) {
    out.print("exception 1");
    %>
    <p>
    <%
    try {
    out.println("going to call method!");
    if (ac!= null)
    op = ac.demoSelect(); /* FAILURE POINT */
    else
    out.println("ac is null->error!!");
    out.println(ac.demoSelect());
    out.println("string got!!");
    out.println(op);
    catch (Exception e) {
    getStackTraceAsString(e);
    e.printStackTrace();
    out.println("error 2");
    catch(Exception e)
    out.println("error 3!");
    It gives an error on trying to access the method "demoSelect".
    e.printStackTrace gives the output:
    java.lang.RuntimeException: javax.ejb.EJBContext.getEnvironment is deprecated in EJB 1.1. EJB 1.1 compli
    ant containers are not required to implement this method. Use java:comp/env instead.
    <<no stack trace available>>
    JSP output is as foll.-->
    getting initial context initial context got !! home got !!
    create called!!
    going to call method! error 2
    What is wrong???
    pls help!

    Greetings,
    Hi,
    I am trying to access a bean from a JSP and have the
    foll. code piece:
    <%
    String op="";
    try {
    // Contact the AccountBean container (the "AccountHome") through JNDI.
    Context ctx = getInitialContext();
    out.println("initial context got !!");
    DemoHome home = (DemoHome) ctx.lookup("demo.DemoHome");
    out.println("home got !!");Though it doesn't seem to be the problem in this case, good EJB coding practices dictate that your code should be narrowing the home reference before calling any of it's methods (i.e. create(...) )... WebLogic may allow handling of its protocol objects in their native state, but other vendors do not... your application is not portable without narrowing.
    It gives an error on trying to access the method "demoSelect".
    e.printStackTrace gives the output:
    java.lang.RuntimeException: javax.ejb.EJBContext.getEnvironment is deprecated inThe error is not in your JSP, but in the bean... it seems your bean is attempting to acquire its "environment properties" in the pre-1.1 style, when...
    EJB 1.1. EJB 1.1 compliant containers are not required to implement this
    method. Use java:comp/env instead. ...instead, it should be looking them up in its JNDI namespace.
    What is wrong???
    pls help! Regards,
    Tony "Vee Schade" Cook

  • Accessing XI Components from SAP GUI

    hi folks,
    I was just wordering, can we Access XI Components(IR, ID, SLD..etc) from with in SAP GUI ,i.e. is there any transaction used to see XI components and can we build the Application from with in it...!!
    help and Suggestions wud be appreciated.
    Thanks
    Jeet.

    Hi,
    Refer to following weblog for quick transactions.
    /people/morten.wittrock/blog/2006/03/23/getting-started-with-xi-part-1-xi-30-cheat-sheet
    Thanks,
    Prateek

  • I can't access my server from a remote PC

    I can access a mac mini running snow leopard from remote Macs but I cannot access it from a remote PC. Are there special ports that need to be opened on the router to permit this?

    Access how?  ssh?  telnet?  Server Admin?  screen sharing?  File sharing?
    If it's screen sharing as I might guess, that's VNC, and VNC works the same on both Windows and Mac.  There are differences around authentication settings, but the IP ports are the same. 
    (Please Google the forums for previous discussions of using VNC from Windows to Mac, too.  Depending on what tools you're using for VNC, see, for instance, this thread.)
    if it's file sharing, then it's usually either via Windows SMB or Apple AFP.  Running either of these over the open Internet is not something I'd recommend.  I'd suggest using a VPN to connect to your server or to your firewall.  Using VNC over a VPN is a good idea, too.
    If it's file sharing, and depending on which Windows version you're using, there are settings you'll want to tweak.  Here are some settings for interoperation using SMB.

  • Windows 2003 server access getting slow from Windows7/8 client

    We have Windows 2003 Enterprise Server. If I try to access through Windows 7 or Windows 8 client PC then I am getting very slow access. Slow access in terms of, if I am taking remote desktop of server [OR] if I directly browse server directory [OR] even
    accessing any web application on server it is very slow.
    But if I am accessing though any Windows-XP base client or even other servers having Windows 2003 or Windows 2008 then access in good.
    But interesting thing is even we have other Windows 2003 server for which I am getting normal response.
    Can someone guide me on the same? I am not able to understand the root cause of it.
    -Abhay

    Start with decreasing SMB version in clients. For inspiration look here
    http://www.petri.co.il/how-to-disable-smb-2-on-windows-vista-or-server-2008.htm
    Rgds
    Milos

  • New install issue-unable to connect to DB server from a remote client.

    Hi experts,
    I am new to setting up oracle server so pls bear with me...
    I setup a db server (11g on top of 64bit Oracle Linux) at home (static 192.168.1.90). I verified that db, listener are up and running. However, I tried to connect to the server from a different client machine (192.168.1.108) within my home network but the server cannot be reached. I was able to ping both client and server using the IP addresses and hostnames. I followed the following steps to perform troubleshooting but was unable to move on beyond step 3, telnet-ing the server on port 1521. Can someone help me out what I should do make the port # (1521) is reachable by the client?
    1. Check with "ping" using the IP address ("ping 198.11.34.43"
    2. Check with "ping" using DNS name (e.g. "tnsping uranus")
    3. Try telnet to the IP on port 1521 (telnet 1.2.3.4 1521)
    4. Check with "tnsping" using TNS service name
    5. Invoke SQL*Plus from the OS command line "sqlplus fred@flintstone". If this fails, check to ensure that your listener is the flintstone service defined.
    6. Sign-on to SQL*Plus and connect with the TNS name ("connect fred/flintstome@service_name"
    7. Within SQL*Plus, try a select from table@remote_db_link
    thanks a lot in advance.

    user6391746 wrote:
    Hi experts,
    I am new to setting up oracle server so pls bear with me...
    I setup a db server (11g on top of 64bit Oracle Linux) at home (static 192.168.1.90). I verified that db, listener are up and running. However, I tried to connect to the server from a different client machine (192.168.1.108) within my home network but the server cannot be reached. I was able to ping both client and server using the IP addresses and hostnames. I followed the following steps to perform troubleshooting but was unable to move on beyond step 3, telnet-ing the server on port 1521. Can someone help me out what I should do make the port # (1521) is reachable by the client?
    1. Check with "ping" using the IP address ("ping 198.11.34.43"
    2. Check with "ping" using DNS name (e.g. "tnsping uranus")
    3. Try telnet to the IP on port 1521 (telnet 1.2.3.4 1521)
    4. Check with "tnsping" using TNS service name
    5. Invoke SQL*Plus from the OS command line "sqlplus fred@flintstone". If this fails, check to ensure that your listener is the flintstone service defined.
    6. Sign-on to SQL*Plus and connect with the TNS name ("connect fred/flintstome@service_name"
    7. Within SQL*Plus, try a select from table@remote_db_link
    thanks a lot in advance.solution depends upon which ERROR is thrown.
    Is COPY & PASTE broken for you?
    It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.

  • Accessing interface components from a seperate class

    Hi there,
    I've just been given a Java project to build, that involves writing an applet to allow text based communication between pairs of people. I've always thought the best way to go about it was to divide code into functional units, i.e. put the user interface code in one class and the code that responds to user interface interactions in other classes (of the same package).
    The problem is getting the other classes to access the interface components created in the interface class.
    So for brevity, here is my interface Applet class;
    package name;
    import statements here;
    public class Communicate extends Applet {
    declare all variables, strings, labels, combo boxes etc
    //Construct the applet
    public Communicate() {
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    //Initialize the applet
    public void init() {
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    add components here
    //Now the problem. In the interface there are combo boxes. When the user clicks a button it constructs a jframe that asks the user for a string. The idea is that the string be added to a combobox using add item. If I leave this code in the applet class it works fine, e.g.
    public void jButton5_actionPerformed(ActionEvent actionEvent) {
    JFrame f = new JFrame();
    f.setSize(200, 200);
    f.setLocation(200, 200);
    f.setVisible(false);
    //Add those boxes to the JFrame
    JTextField titleField = new JTextField();
    String title = "Please enter the title";
    int result = JOptionPane.showOptionDialog(f,
    new Object[] { message },
    "New title", JOptionPane.OK_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null, null, null);
    String title = titleField.getText();
    jComboBox2.addItem(title);
    //as jComboBox2 is decalred in the applet above, it adds the string no problem.
    But what I'd like is the following, a title class on its own to make it easier to update and modify,
    e.g.
    public void jButton5_actionPerformed(ActionEvent actionEvent) {
    try {
    Title title = new Title();
    catch (Exception ex) {
    ex.printStackTrace();
    with the Title class written as such:
    package name;
    import statements;
    class Title {
    Title() {
    //Set the new title
    JFrame f = new JFrame();
    f.setSize(200, 200);
    f.setLocation(200, 200);
    f.setVisible(false);
    //Add those boxes to the JFrame
    JTextField titleField = new JTextField();
    String title = "Please enter the title";
    int result = JOptionPane.showOptionDialog(f,
    new Object[] { message },
    "New title", JOptionPane.OK_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null, null, null);
    String title = titleField.getText();
    *** Here is the problem: How do I reference jComboBox2 which is declared in the original applet class?
    jComboBox2.addItem(title); (this wont work!)
    public static void main(String[] args) {
    Title title = new Title();
    I'd thought perhaps I needed to create an instance of the applet and pass it to the second class to use it, so it can reference the components, but I'm not sure how to do this with an applet.
    Thanks
    Maria

    I'm not going to look at your unformatted code, but I'll give you some general hints:
    Have one set of classes being the GUI
    Have one set of classes being the data (the chat history, basically)
    Have one set of classes being the logic
    Have one interface for the logic to manipulate the data (e.g. addNewMessage(String)
    Have one interface for the GUI to get the data that's to be displayed (e.g. getLastTenMessages())
    Have one interface for the logic to notify the GUI of changed data (refresh())
    Have one interface for the GUI to notify the logic of user input (e.g. sendMessage(String))
    The logic will receive data either from the user and send it, as well as storing it in your chat log, or it will receive it from the network and add it to the data model, both times notifying the GUI of changes afterwards.

  • Urgent: How to invoke webservice from a remote client?

    How could I invoke webservice deployed on the weblogic server on different System from client residing on my System?
    I would like to know the different ways to do this and the advantages and dis-advantages of each one of them.
    Thanks in advance.
    Nitin

    nitind,
    Did you figure out how to connect to Weblogic web-service remotely?
    I tried doing so, but I get the following error on the client-side.
    A exception was thrown from the client handler sending a JAXM message.
    A stack trace for a previously logged message.
    Exception in handler handleRequest() method.
    Exception in thread "main" java.rmi.RemoteException: null; nested exception is:
    java.lang.NoSuchMethodError
    java.lang.NoSuchMethodError
    at weblogic.webservice.util.FaultUtil.fillDetail(FaultUtil.java:84)
    at weblogic.webservice.util.FaultUtil.fillFault(FaultUtil.java:141)
    at weblogic.webservice.util.FaultUtil.exception2Fault(FaultUtil.java:184
    at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainI
    mpl.java:183)
    at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:
    218)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.j
    ava:143)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
    a:444)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
    a:430)
    at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:270)
    at myapp.myservice.client.NoCallbackWebServiceSoap_Stub.addition(NoCallb
    ackWebServiceSoap_Stub.java:62)
    at myapp.myservice.client.NoCallbackWebServiceSoap_Stub.addition(NoCallb
    ackWebServiceSoap_Stub.java:84)
    at testclient.example(testclient.java:48)
    at testclient.main(testclient.java:27)

  • How to Access MXML components  from ActionScript class

    Hi ,
    I am having a Application Conataner , in which i am having a Form Container with some Label in it .
    This is some thing similar to this as shown :
    <Mx:Application>
    <Mx:Form>
    <Mx:Label text="Hello world"/>
    </Mx:Form>
    </Mx:Application>
    Can any body please let me know how can i access this Form's Label , from an ActionScript class .
    catch(error:*)
    // Here i want to access these Objects and set data to that Label .
    Basically My requirement is that iinside the catch block of my ActionScript class , i want to set some text to the Label , Please
    let me know if this is possible or not also ??
    Waiting for your Replies .

    Hi these both are not same these refer to different one...
    Well let me explain...
    Application.application.myCustomComp.myLabel.text = "sometext"; sets the label "myLabel" which is present inside your customcomponent(which is in main application).
    Application.application.myLabel.text = "sometext"; sets the label "myLabel" which is present directly inside your main application.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Label id="myLabel"  text=""/> // So inorder to set the label(myLabel) present here you will use directly the 2nd line of code.
    <mx:CustomComp id="myCustomComp" /> // So inorder to set the label(myLabel) present inside this component you use 1st line of code.
    </mx:Application>
    Hope now its clear.
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • How to access graphic components from classes?

    Hi,
    I am creating a Flex application. In my Main.mxml, I add
    different UI elements, such as panels. I also have a few
    actionscript files. Everything is in the same folder. So my
    question is : how can I access a panel created in Main.mxml from an
    actionscript class ? By accessing the panel, I mean things like
    change its properties, etc. Is it possible to access those in a
    'Flash-like' way, using something like _root.myPanel, or is it only
    possible through passing parameters?

    Well...it pains me to see someone obviously new to programming struggle here...so I'll take this one on:
    Here is the BAD way to do it...but it is basically what you are looking for...to learn GOOD ways to do this, please invest in some programming books and learn about encapsulation, MVC, and other programming/architectural styles...anyways...here is the BAD, but easy way:
    In your SGui class, right after the constructor you have to "declare" your object reference as a class member, so edit your file to make it say:
    public class SGui {
         public JButton addStickButton;Then, edit the line in SGui that says:
    final JButton addStickButton = new JButton();so that it just says:
    addStickButton = new JButton();Then, in your Soft class, you can access it just the way you wanted to in your comment:
    gui.addStickButton.setEnabled(false);Other Java programmers reading this thread will probably shoot me for showing you how to do it this way, because it violates principles of encapsulation...but go ahead and use it so you can move forward...but study a little more online or in books to get the hang of it :)
    Message was edited by:
    beauanderson
    Message was edited by:
    beauanderson

  • Error accessing mysql database from a remote host

    Hi all,
    I'm running the following PL/SQL script and encountered some errors. The MySQL server is hosted off campus by a hosting company. However, when I run the same script against a MySQL database server hosted on campus, the script works fine. Here's the error:
    ERROR at line 3:
    ORA-04052: error occurred when looking up remote object
    cmswhit_odbc13.mdl_user@RLTEST
    ORA-00604: error occurred at recursive SQL level 1
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [MySQL][ODBC 5.1 Driver][mysqld-4.1.22-standard]SELECT command denied to user
    'cmswhit_odbc13'@'192.160.216.13' for table 'mdl_user'
    ORA-02063: preceding 2 lines from RLTEST
    Here's the script:
    sqlplus -s <<endofit
    $USERPASS
    set serveroutput on;
    DECLARE
    user_name varchar2(30);
    moo_user_name varchar2(300);
    routine VARCHAR2(40);
    cntr NUMBER(8);
    CURSOR read_saradap is
    select gobtpac_external_user
    from gobtpac
    where gobtpac_external_user in ('greenup','yfeng');
    CURSOR read_mdl_user is
    select "username" from "mdl_user"@rltest where "username" = user_name;
    -- E N D O F C U R S O R S --
    BEGIN
    dbms_output.enable(1000000000);
    -- STEP 1: Read through Banner
    cntr := 0;
    OPEN read_saradap;
    LOOP
    routine := 'Read applicant';
    -- Read an applicant record
    dbms_output.put_line('Reading Banner user');
    FETCH read_saradap INTO user_name;
    EXIT WHEN read_saradap%NOTFOUND;
    dbms_output.put_line('Read Banner username=' || user_name);
    cntr := cntr + 1;
    -- Read the Moodle user;
    routine := 'Read moodle user';
    OPEN read_mdl_user;
    FETCH read_mdl_user INTO moo_user_name;
    IF read_mdl_user%NOTFOUND THEN
    dbms_output.put_line('Moodle user not found');
    ELSE
    dbms_output.put_line('Read Moodle username=' || moo_user_name);
    END IF;
    CLOSE read_mdl_user;
    END LOOP;
    rollback;
    CLOSE read_saradap;
    dbms_output.put_line('Total processed: ' || cntr);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE);
    dbms_output.put_line(SQLERRM);
    dbms_output.put_line('Error user=' || user_name);
    dbms_output.put_line(routine);
    END;
    EXIT;
    endofit

    The error seems to be quite clear: the user 'cmswhit_odbc13'@'192.160.216.13' lacks the SELECT privilege on the 'mdl_user' table...
    Max
    http://oracleitalia.wordpress.com

Maybe you are looking for

  • BADI/User Exit suggestion - for determining Partner in PO header

    Hi All, I want to be able to automatically populate and determine a manual partner function within the header of a purchase order creation. Example, when PO is allocated against account assignment 'P' then go to the WBS element assigned and retrieve

  • Dynamic Table not displaying data

    First off, i have searched high and low, and havent been able to find much help. That said, i have been trying to create a simple search/results page in dream weaver, i am using ASP and sql express.  Ive been following the adobe tutorial, and everyth

  • Adobe acrobat error

    I'm attempting to export a pdf file to microsoft powerpoint using acrobat plus. I reach the 90% completion level and am told an erroor has occured and the process stops. There is no explanation of the error or description of anything I've done wrong.

  • Strange SQL behaviour

    Hi, Please refer the below given script. CREATE TABLE ITLINEQBOOKEDPROFIT (DATAAREAID     VARCHAR2(200), EQUITYCODE     VARCHAR2(200), PORTFOLIOID     VARCHAR2(200), PROFIT NUMBER); CREATE TABLE ITLINEQMISTABLE (DATAAREAID     VARCHAR2(200), EQUITYCO

  • BI apps 7.9.6.3 on Linux 64 Bit

    Has anyone had any success in installing OBIEE (11.1.1.5), DAC (10.1.3.4.1), Informatica (9.0.1 hotfix 2) and Oracle BI Apps (7.9.6.3) on Linux 64 bit? We have been provided 2 physical Linux servers (say A & B) and 2 virtual server (say C & D) for th