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

Similar Messages

  • How to access MDB database from JSP Web Application?

    hi
    i am using tomact and developing appplication in which i have to insert data into MDB database and read/Update/Delete Data in MDB DataBase.
    could any help in this issue?
    Thanks
    Regards
    Oersla Afroze Ahmed

    Hi,
    For accessing MDB database, you must have a jdbc:odbc driver, u can get it from sun site.
    just put it into the lib folder of web server.
    or
    just follow the following link:
    http://www.developer.com/db/article.php/3571661
    keshri

  • How to access HTTP Header from within Web service?

    Hello,
    Is there a way to access HTTP header variables like CONTENT_TYPE, CONTENT_LENGTH from within Web Logic web service.
    I was able to get the HTTP header variable from within Apache AXIS services by calling context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST
    How can i do this from weblogic web service.
    I need this to verify the client SSL_CLIENT_DN
    In access I can get the header as follows.
    HttpServletRequest req = (HttpServletRequest) context
              .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
    clientID = req.getHeader("SSL_CLIENT_S_DN_Email");
    Thanks
    --Arun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hi
    the following link may helpful to you
    http://e-docs.bea.com/wls/docs81/webserv/anttasks.html#1111537
    Regards
    Prasanna Yalam

  • How to call a report from a web application

    Hi,
    I have a web server in wich is installed Reports 6i. My question is how can I call reports 6i to generate a pdf using a .rep file from my web application (built with java)?

    Hi,
    The below link will be very useful for one who need idea on calling Oracle Report from Java Application,
    http://www.oracle.com/technology/products/reports/htdocs/getstart/examples/reportswebservice/index.html
    Thanks & Rgds,
    M T

  • How can I cope iPhotos from one to another user on the same mac

    How can I copy my iphotos from on user to another on the same mac?

    Depending on how many pictures you wish to share there are different options.
    1) Steps to share your whole iPhoto Library
    A) Share your photos
    Firstly setup a shared folder that the other user(s) will be able to access. This can be done in System Preferences, Sharing, then selecting the checkbox next to 'File Sharing'. You'll then want to select the folder to share and also the users who can access it.
    In your instance, I would suggest sharing the folder where your 'iPhoto Library' file resides, which is most likely going to be in the default 'Pictures' folder. The other user will then be able to access your 'iPhoto Library' in their iPhoto application under their user account and see all contents in your iPhoto library.
    B) Configure the other users iPhoto to access your shared iPhoto Library (or any library of your choice)
    Logout of your account and into the user who requires access to your iPhoto Library. Find the iPhoto application, press and hold the option/alt key and click to open the application. 'What photo library do you want iPhoto to use?' will appear in a window, click 'Choose', navigate to your preferred iPhoto Library and iPhoto will now load your pictures.
    2) Steps to share a few selected pictures
    You will follow the same steps as above in order to setup a shared pictures folder, however in your user account, drag and drop photos out of your iPhoto library into a shared folder which the other user can access.
    Notes:
    The method of sharing your whole iPhoto Library means that both users will be accessing/editing the same library. This means you will be able to see pictures imported/edited by each other. If this is undesired, you can create a copy of your iPhoto library on the 2nd user account instead of both accounts running the same library from a shared folder.

  • How can I migrate file shares & permissions from one volume to another on the same server?

    I am replacing a storage array and as part of that process, I need to move files/folders and Shares/permissions from one Volume to another volume within the same server.
    The server is Windows 2003 file server.  The file transfers are not a problem, moving all 40 shares with permissions etc. is my main concern because in order to maintain everything I need to change the drive letter of the new volume to match the old
    one so that links to various resources throughout the network do not break.

    Hi, 
    If you want to copy files/folders from one Volume to another volume within the same server, you could use the File Server Migration Tool (FSMT) or Robocopy to accomplish your goals. The tool can move all of the files from the shares on your original volume
    to the new volume.
    For more detailed information, you could refer to the articles below:
    File Server Migration Toolkit
    http://technet.microsoft.com/en-us/magazine/2006.10.utilityspotlight.aspx
    The File Server Migration Toolkit (FSMT) is a free download available at:
    http://www.microsoft.com/en-us/download/details.aspx?DisplayLang=en&id=10268
    Robocopy
    http://technet.microsoft.com/en-us/library/cc733145.aspx
    FSMT and Robocopy will not copy Share permissions but only NTFS permissions. So if the drive letter will not be changed, you can backup and restore the Share permission with steps here:
    Saving and restoring existing Windows shares
    http://support.microsoft.com/kb/125996
    Regards, 
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How Can I create a cluster of two instances running on the same server?

    Hello,
    I can't find how to create a cluster or even a failover rule for my two instances running on the same server ODSEE 11gR1.
    Could you please help?
    Thanks,

    Hello,
    Clustering (intended as Sun Cluster, Veritas Cluster, etc... ) IS NOT SUPPORTED since 7.0:
    http://docs.oracle.com/cd/E20295_01/pdf/821-1216.pdf [page 20]
    and, based on my own experience, is the WORST way of achieving high availability of an LDAP Directory Service and an almost GRANTED way to get replication issues in your topology (lock, split, re-init, etc...).
    Please use instead the 'application-level' clustering that you get out of the box with the Multi-Master Replication.
    http://docs.oracle.com/cd/E20295_01/html/821-1217/index.html
    http://docs.oracle.com/cd/E20295_01/html/821-1220/fhkry.html#scrolltoc
    HTH,
    Marco

  • How to access HttpRequest Object from Axis web service?

    Hi all,
    I have Axis web service named shoppingcartService,
    and i have ShoppingCartImpl as implemention class which
    implements passfamily() method
    When client access my web service, ShoppingCartImpl's passFamily method is executed.
    I have one more servlet under my axis web application which implements business logic.
    problem is that i want to call/invoke this servlet from passfamily method of ShopingCartImpl class.
    So how can i call/invoke servlet from passFamily method of ShoppingCartImpl class ?
    (All stuff is under Axis web application under Tomcat).

    hi
    the following link may helpful to you
    http://e-docs.bea.com/wls/docs81/webserv/anttasks.html#1111537
    Regards
    Prasanna Yalam

  • Accessing Object Clusters From non-web applications

              Say I have a three-tiered WebLogic cluster (web proxy, servlet, EJB).
              I have an application that wants to access the EJBs directly from
              the object cluster via RMI or Corba.
              If I'm correct, the only load balancing/failover would be provided
              by DNS. So how are non-web applications able to enjoy the benefits
              of the cluster?
              I suppose you could send your EJB requests through a servlet??
              Is that the only way?
              Please share your ideas!
              Thanks,
              Dave
              

    See http://www.weblogic.com/docs51/cluster/concepts.html#1024225
              David Mrozek <[email protected]> wrote:
              > Say I have a three-tiered WebLogic cluster (web proxy, servlet, EJB).
              > I have an application that wants to access the EJBs directly from
              > the object cluster via RMI or Corba.
              > If I'm correct, the only load balancing/failover would be provided
              > by DNS. So how are non-web applications able to enjoy the benefits
              > of the cluster?
              > I suppose you could send your EJB requests through a servlet??
              > Is that the only way?
              > Please share your ideas!
              > Thanks,
              > Dave
              Dimitri
              

  • How to execute ODI scenario from a web application

    Hi
    I need to execute ODI scenario from ApEx form.
    how to execute ODI scenario from application. Using 10.1.3.5.5
    -app

    In the SQL property of the TQuery object, enter the call as an anonymous block:
    begin
      pkg_name.procedure_name(true);
    end;

  • How to access SQL tables from WebDynPro ABAP application ?

    Hi,
    I am trying a scenario, where I need to send an user ID to SQL server table (update/modify/delete) from webDynpro ABAP application.
    Basically ,I am trying to know:---
    a>How to write a SQL Connection from ABAP code within webdynpro ABAP application
    b>What are the ways to do it.(by code or any other API/mechanism)
    I appreciate if anybody knows this.
    Thanks
    Praveen

    Hi,
    The EXEC CONNECT ... is usually used in the procedural ABAP code. For this you can refer to the ABAPDOCU.
    I dont have any sample code on the classes I listed try to check out them for the parameters and the methods they have.
    In WD for Java, we have these connection classes to connect to any databsae server.
    Or try to create an RFC with DESTINATION for this
    Pls check out this link for this -
    Pull data from another r3 server using abap dynpro
    Regards
    Lekha

  • How do I move songs from one library to another on the same computer? Also, how do I change the name of a library?

    I have created a separate Apple account, but want to use the same computer for multiple accounts. How do I do this? I also want to transfer songs from one account to the new one.

    is this second library in a different account on the computer?
    Look at Home Sharing.
    iTunes: How to share music and video - http://support.apple.com/kb/HT2688 - about Music Sharing and Home Sharing
    Home Sharing Support page - http://www.apple.com/support/homesharing/
    iTunes: Setting up Home Sharing on your computer - http://support.apple.com/kb/HT4620
    iTunes Home Sharing now works between users on same computer - https://discussions.apple.com/thread/3865597

  • How to access Apex environments that exist in multiple SID's on same Server

    HI,
    I've got a Linux Server which has 3 11gr2 Development instances (SID's), in each instance I'd like to setup Apex environment (I know Apex comes with the 11gr2 DB). How can I access a specific Apex environment (on one of the SID's) when all the database instances share the same IP Address?
    Any suggestions?
    TIA

    Sorry for the silly Q, all I need to do is run EXEC DBMS_XDB.SETHTTPPORT(port); specifying a different port for each SID!

  • WLS 7.0 : How to call a webservice from a webservice, both running on a same server?

    Server settings :
    Two webservices running on a server.
    WEB-INF\lib contains the respective XXX_client.jar files.
    One webservice calls another one using service Port and gets the Exception NoClassDef...
    How to resolve?

    It seems that there is no answer to my problem stated below
    "Archana Padhye" <[email protected]> wrote:
    >
    Before putting the stack trace I should supply more information.
    There are two webservices viz. Trigger and Proxy
    Trigger needs the Proxy_client.jar in its classpath at the time of building
    the
    Trigger webservice.
    The server classpath doesn't have this particular jar.
    So the Exception is about not finding the class for the service.
    If that jar is added in the classpath, there is error at server startup
    since
    the method signatures mismatch.
    Having client jar in the classpath is not the way, I assume.
    "manoj cheenath" <[email protected]> wrote:
    Sure, you should be able to do this.
    Can you post the full stack trace?
    "Archana Padhye" <[email protected]> wrote in message =
    news:[email protected]..
    Server settings :=20
    Two webservices running on a server.
    WEB-INF\lib contains the respective XXX_client.jar files.
    One webservice calls another one using service Port and gets the =
    Exception NoClassDef...
    How to resolve?
    So I am trying for dynamic client using WSDL. My webservice is returning a complex
    data type. But the test client, which is a Java class, is giving exception which
    I am unable to dig.
    I attach the client java class and here is the stack trace of the exception
    Exception in thread "main" javax.xml.rpc.JAXRPCException: failed to read wsdl
    fi
    le:weblogic.webservice.tools.wsdlp.WSDLParseException: ERROR[WSDL Parser]:The
    ja
    va Class of an xml name cannot be null:['java:eVisharad.BEMEE.Client.Data']:CLIC
    oncept
    at weblogic.webservice.core.rpc.ServiceFactoryImpl.createService(Service
    FactoryImpl.java:33)
    at WebServiceClient_DII.main(WebServiceClient_DII.java:57)
    [WebServiceClient_DII.java]

  • How to transfer user settings from one account to another (on the same Mac)

    I'd like to create separate user accounts for "work" and "play" (so that I can do things like have separate address books, etc...). However, I already have LOTS of personalized settings (trackpad behavior, login items, etc) that I'd like to keep the same between the two accounts.
    Is there a way to transfer all of the user settings from one account to another?

    You'll need to copy your /Home/Library folder. Make sure you back up first before doing the following. Log out of both your Work and Play accounts. Log in to a third account with administrator privileges. Assuming you are copying from the account called "work" to the account called "play", enter the following in Terminal:
    sudo rm -rf ~play/Library (this deletes Play's Library folder.)
    sudo cp -R ~work/Library ~play/Library (this copies Work's Library folder to Play's folder.)
    sudo chown -R play ~play/Library (this fixes permissions of Play's new Library folder.)

Maybe you are looking for

  • Program to look for texts in reports (like EWK1)

    Hi, i need to look for a remote function used in crm but tx EWK1 doesn't exist in CRM, is there any program or report similar ?? thanks in advance !!

  • I colored the spry menu, but it's not showing up in preview.

    I changed the color of my spry menu from beige to black. It shows up on my work page, but when I try to preview it, it's as if I had never changed the color. I also tried going to the page through Firefox, but it's not showing up there either. The co

  • Fastest way to enter multiple events (monthly work schedule)?

    I have a question that has been driving me mad. I am wondering what is the fastest ways to enter multple events into iCal. Every month, my wife gets her work schedule which is composed of various shifts throughout the week. What I would like to do, i

  • Having trouble importing .MOV files

    I have a Canon EOS 60D which shoots video clips with a file extension of .MOV.  I have Premier Elements Vers.8.0 and when I try to import the clips, it errors out and says it doesn't support .MOV files or Codec is missing...I'm not even sure what tha

  • Saving of variant Dynpro of the screen - does not work in version 6

    In the specified theme [/people/alvaro.tejadagalindo/blog/2007/05/22/save-a-variant-from-a-dynpro-screen|/people/alvaro.tejadagalindo/blog/2007/05/22/save-a-variant-from-a-dynpro-screen] examples on use of the module for preservation dynpro the scree