Trouble looking up EJB from a JSP in another server

I'm using the Sun Reference Implementation of J2EE. I'm deploying a session EJB in one J2EE app on one machine, and accessing it from a JSP in another J2EE app on another machine. My lookup code that is called from the JSP first sets the properties of the InitialContext as follows:
        Properties env = new Properties();
        env.put(Context.INITIAL_CONTEXT_FACTORY,
                "com.sun.jndi.cosnaming.CNCtxFactory");
        env.put(Context.PROVIDER_URL, "iiop://afowlertest:1050");
        Context initial = new InitialContext(env);When I run both apps in the same server using this code, they work fine. However, when I run them in separate servers, the code throws the following exception (even if the JSP and EJB are deployed in the same server):
javax.naming.NameNotFoundException.  Root exception is org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
        at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
        at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
        at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
        at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
        at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:599)
        at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:90)
        at microminer.client.SearchHandler.search(SearchHandler.java:127)
        at org.apache.jsp.test$jsp._jspService(test$jsp.java:79)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        . . .(My class is the microminer.client.SearchHandler in the stack above.)
I've searched the forum for answers, but have not hit on anything yet. Any ideas? Thanks in advance!
Abraham Fowler

I'm going to answer my own question, because I kept searching the forums and eventually found the answer... maybe someone else in the same situation will find this answer here too. I got the answer from the following thread:
http://forum.java.sun.com/thread.jsp?forum=13&thread=256151
Basically, if you are doing a JNDI lookup with "java:comp/env" prefixed to the JNDI name, the app server will try to do a lookup within the current machine. If you leave that prefix off, it will look up using whatever properties you set in the InitialContext. At least, this is how I understood it from the thread I mentioned above.

Similar Messages

  • How can I access to an EJB from a JSP, using a taglib?

    I'm trying to access to an EJB from a JSP using a taglib,
              and I get the example in
              http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Advanced5.html.
              But I colund't run this example because in the weblogic Log appears many
              errors when I run the JSP.
              Can you help me?
              

    Backing files is an option. If you need to do it from the controller, you
    could use the Forward object. The forward object constructor can take a URL
    object as a parameter. This should do the trick.
    Regards,
    Kunal
    "Panji Aryaputra" <[email protected]> wrote in message
    news:[email protected]..
    Hi, you have to use backing file to get what you want. In my case, I am
    using a page backing file. Perhaps a portlet backing file can do thatalso.
    Cmiiw, the redirect header makes the page redirected only if the httpheader
    has not been sent to client. In your case, the header has been sent (i.e.
    the portal header.jsp has been displayed, etc). So the header need to be
    sent before anything else sent to client browser. This is where thebacking
    file comes handy.
    hth
    panji.a
    "A Hagen" <[email protected]> wrote in message
    news:[email protected]..
    I'm using Bea Workshop 8.1 and trying to perform a redirect from inside
    a
    portlet
    using HTTPServletResponse.sendRedirect(String url)... but nothing
    happens
    I tryed the same trick with a simple JSP, and that's ok, but portal
    pages
    obviously
    catch the redirect somehow.
    Please could you tell the correct way of redirecting the whole browser
    to
    another
    page from inside portlets?
    Thanks!!!

  • Passing variables from one jsp to another

    Hi All,
    I've searched thru the forum and can't find an answer to a prob I'm having, trying to pass a variable from one jsp to another.
    in file searchBar.jsp i have
    <%
    String archiveSearch = "off";
    %>
    and
    <%
    if (userUtils != null && userUtils.getSearch().equals("on"))
    %>
    <a href="/webLayout/webSideBar.jsp?searchState=<%=archiveSearch%>onclick="archiveSearch = "on""></a>
    and in file webSideBar.jsp
    <%
    String searchState = "off";
    String archiveSearch = (String)request.getParameter("searchState");
    %>
    basically it will give me a variable archiveSearch set to on in webSideBar when the user clicks on the search button, but as it is it's not passing the variable from the searchBar.jsp to the webSideBar.jsp and I think it looks ok !!!! but it's not
    Help

    Looks good to me as well.
    Couple of suggestions
    1 - view source on searchbar.jsp - see what the generated source code for that link is
    2 - Look at the url used to generate webSideBar.jsp. If its not in the address bar, right click the webSideBar page and choose properties.
    Check to see what parameter was passed.
    Are these pages in a frameset? Do you have to specify a target frame for your link?

  • HOW TO MOVE FROM ONE JSP TO ANOTHER BY HIDING URL CHANGES

    HOW TO MOVE FROM ONE JSP TO ANOTHER BY HIDING URL CHANGES IN AN ADDRESS BAR

    Please check before posting that you have not accidentally turned on the CAPS LOCK feature of your keyboard.
    To answer your question. You can't do that. There are alterate ways to solve this sort of problem. What exactly is the nature of the problem you are seeking to solve?

  • Passing variable from one JSP to another

    Hi....
    I am working on customizing Oracle Application(istore).
    I need to pass variable from 1 JSP to another.
    JSP 1 contains the following line of code:
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    How can I pass this to another JSP Page. The other JSP should take the 'soldtoCustPartyName' and find out the primary address country.
    So please help me in getting variable passed from 1st JSP to next.
    By default, 1st JSP is not fwded to 2nd JSP.
    This is very very urgent...Please help.....

    When you push the submit button on jsp1 - it goes to jsp2?
    ie
    // in jsp1.jsp
    <form action="jsp2.jsp">
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    <input type="submit">
    </form>
    //Then in jsp2.jsp all you need is
    request.getParameter("soldtoCustPartyName");This will pick up the value that is coming from the hidden field on jsp1

  • Passing value from one jsp to another?

    how to pass value from one jsp to another? i have a value assigned in the link, i want to pass that value to another jsp page?
    please help with code?

    Instead of the value being passed, i am getting a null value.
    Here is my calendar code:
    <%@page import="java.util.*,java.text.*" %>
    <html>
    <head>
    <title>Print a month page.</title>
    </head>
    <body bgcolor="white">
    <%
                  boolean yyok = false;
                  int yy = 0, mm = 0;
                  String yyString = request.getParameter("year");
                  if (yyString != null && yyString.length() > 0)
                      try
                          yy = Integer.parseInt(yyString);
                                  yyok = true;
                       catch (NumberFormatException e)
                          out.println("Year " + yyString + " invalid" );
                  Calendar c = Calendar.getInstance( );
                  if (!yyok)yy = c.get(Calendar.YEAR);  
                         mm = c.get(Calendar.MONTH);
    %>
                  <table align="center">
                      <tr>
                  <td>
                       <form method=post action="calendar.jsp">
                          Enter Year : <select name="year">
    <%         
                 for(int i= yy;i<=2010;i++)
    %>
                  <OPTION VALUE= <%=i%> > <%=i%> </option>
    <%       
    %>
              </select>
                      <input type=submit value="Display">
                      </form>
                      </td>
                    </tr>
    <tr>
                     <table>
    <%!
    String[] months = {"January","February","March",
                    "April","May","June",
                    "July","August","September",
                    "October","November", "December"
    int dom[] =     {
                        31, 28, 31, 30,
                        31, 30, 31, 31,
                        30, 31, 30, 31
    %>
    <%
                int leadGap =0;
    %>
    <div id="t1" class="tip"><table border="4" cellpadding=3 cellspacing="3" width="250" align="center" bgcolor="lavender">
    <tr>
    <td halign="centre" colgroup span="7" style="color:#FF0000;">
    </colgroup>
    <tr>
    <td>
    <%
              GregorianCalendar calendar =null;
              for(int j=0;j<12;j++)
                        calendar = new GregorianCalendar(yy, j, 1);
                  int row = 1 ;
                  row = row + j;
        %>
              <table>
                <tr>
              <colgroup span="7" style="color:#FF0000;">
              </colgroup>
                </tr>
              <tr align="center">
              <th colspan=7>
                  <%= months[j] %>
                  <%= yy %>
              </th>
              </tr>
    <tr>
    <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
    </tr>
    <%
        leadGap = calendar.get(Calendar.DAY_OF_WEEK)-1;
        int daysInMonth = dom[j];
        if ( calendar.isLeapYear( calendar.get(Calendar.YEAR) ) && j == 1)
        ++daysInMonth;
        out.print("<tr>");
        out.print(" ");
          for (int h = 0; h < leadGap; h++)
           out.print("<td>");
          out.print("</td>");
        for (int h = 1; h <= daysInMonth; h++)
          out.print("<td>");
          out.print("<a href=desc.jsp>" + h + "</a>" );
          out.print("</td>");
        if ((leadGap + h) % 7 == 0)
            out.println("</tr>");
    out.println("</tr></table></div>");
    if( row%3 != 0)
    out.println("</td><td>");
    else
    out.println("</td></tr>\n<tr><td>");
    %>
    </html>I need to pass the value in 'h' to the desc.jsp page.
    my code for desc.jsp is :
    <html>
    <head>
    </head>
    <body bgcolor="lightblue">
    <form method=post action="Calenda.jsp">
    <br>
    <%= request.getParameter("h") %>
    <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
    <BR> <INPUT TYPE=SUBMIT VALUE="submit">
    </form>
    </body>
    </html>But i am not able to pass the value. The 'h' value contains all the date. i want to pass only a single date, the user clicks to the other page. please help

  • How to pass information from one JSP to another JSP? help please

    hi there
    my question is how to pass some information such from one JSP to another one. for exmple, on one page there is a form, and i need to pass some values from the form to another jsp, or some values that were calculated on one JSP and need to be passed to another one. thanks

    You can do this in several ways...here is a simple one...
    When you call the second page url, use this
    http://www.mysite.com?myVariableFromPageOne="hello"
    on the second page use this:
    String firstPageVariable = request.getParameter("myVariableFromPageOne");
    Thanks

  • How to carry an object from one JSP to another JSP?

    How can I carry an object from one JSP to another JSP?
    I have a servlet where I am setting an object in request as an attribute and then forwarding to PageA.jsp.
    MyDTO myDTO = new MyDTO();
    request.setAttribute("MyDTO", myDTO);
    RequestDispatcher rd = getServletContext().getRequestDispatcher("/PageA.jsp");
    rd.forward(request, response);
    I can get MyDTO object in PageA.jsp:
    MyDTO myDTO = (MyDTO) request.getAttribute("MyDTO");
    Now PageA.jsp has a form named form_pageA which submits to PageB.jsp. How can I make sure that myDTO object is available in PageB.jsp? I would like to not store it in session.
    Edited by: srhcan on May 4, 2012 7:52 PM

    srhcan wrote:
    but its not a text I want to store; instead its a JavaBean object. Thats why I cannot use a hidden text type input field.No, but perhaps you could stick something in there which you can use to reconstruct your DTO object on the next request?

  • How to forward from a jsp  to another jsp on another server

    I am facing issue in forwarding to a jsp residing in another server. While using response.redirect(url), the response is send back to the browser and then redirected(which is not expected as it would create problem in production). i am facing issue while using the <jsp: forward> tag and forward() as they seem to be taking relative URL. Please help me with this issue.

    probably, you could use <c:redirect url=""/> tag to request to jsp on another server and pass ur parameters as 'GET' so that u can get all your respective params values. Other way (or crude) way is to do a scoket or HttpConnection to post your all datas via 'POST' and expect respective values on the server side.

  • From one day do another server admin don't connect to the server

    I have an Intel XServe with OSX Server 10.4.10.
    From one day do another server admin don't connect to the server locally and remotely. The workgroup admin shows not the sharing button. The other services works correct. (FileService, NetBoot, ping etc ...). In the CrashReporter I've only find a crash from dashboardadvisoryd. I don't want restart the server.
    I there an other solution?
    Thanks Sven

    I found the solution in a message three above:
    http://discussions.apple.com/thread.jspa?threadID=1184552&tstart=0
    With
    sudo kill -HUP `ps aux|grep 'servermgrd'|grep -v 'grep'|awk '{print $2;}'`
    from the terminal ... and after any minute's later the problem was solved
    Sven

  • Linkage Error Looking up EJB from BPEL (11g)

    I am using 11g TP3.
    I have a BPEL process that is using WSIF to call a plain java class. Then from this class I am attempting to lookup an EJB in another application (but on the same server).
    My code looks like this...
    env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
    env.put( Context.SECURITY_PRINCIPAL, "fmwadmin" );
    env.put( Context.SECURITY_CREDENTIALS, "welcome" );
    env.put(Context.PROVIDER_URL, "ormi://localhost:23891/DisEM");
    javax.naming.InitialContext ctx =
    new javax.naming.InitialContext(env);
    Object obj = ctx.lookup("DisConfigManager");
    I get a Linkage error on the lookup stating it "violates loader constraints" on class com/evermind/server/rmi/RMIClientConnection
    Below is the full error text. Any help would be appreciated. Thanks.
    Mar 26, 2008 8:49:31 AM oracle.j2ee.util.AnnotatedLogger log
    WARNING: Exception returned by remote server: java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints
    08/03/26 08:49:31 got an exception looking up DisConfigManager: javax.naming.NamingException: Error resolving reference <Reference Class Name: javax.ejb.EJBObject
    Type: location
    Content: test-managers_DisConfigManager_BeanBinding
    Type: CachePolicy
    Content: NEVER
    : javax.naming.NamingException: Lookup error: javax.naming.NamingException: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints [Root exception is java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints]; nested exception is:      javax.naming.NamingException: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints [Root exception is java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints] [Root exception is javax.naming.NamingException: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints [Root exception is java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints]]
    08/03/26 08:49:31 <INFO> WSIFBinding=> [MIB2ScanCartridge/MIB2ScanCartridge!1.0*2008-02-27_13-37-54_124.FinalizeScanService]:finalize Performing outbound request/response interaction..
    Mar 26, 2008 8:49:43 AM oracle.j2ee.util.AnnotatedLogger log

    I was mistaken in this posting. I was able to access the EJB from the startup class so there must be something else that I am doing to cause this problem. I'd still like to know why I get those invalid guid errors though.
    By the way, please forgive me for using the gender-specific gentlemen in my posting. That was accidental.

  • Looking up EJBs from a java client

    While trying to migrate my application from standalone-oc4j
    to Oracle Application Server 10g, I ran into the following problem.
    My application has a stateless session bean. When trying to lookup the bean (from a java client), I get the following exception:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException
    Invalid username/password for UnifyoccEAR (ias_admin)
    My code used the username/password I used to log into web-based console (which I used to deploy the application). The lookup code follows:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    OracleJASLayer.INITIAL_CONTEXT_FACTORY);
    env.put(Context.PROVIDER_URL, "ormi://localhost:3201/UnifyoccEAR");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    Object obj = ctx.lookup("unify/nxj/controlCenters/occ/ControlCenterEJB");
    On a whim, I tried the old SCOTT/TIGER username/password and got the following
    exception:
    javax.naming.NoPermissionException: Not allowed to look up unify/nxj/controlCenters/occ/ControlCenterEJB,
    check the namespace-access tag setting in orion-application.xml for details
    So evidently, SCOTT/TIGER is in the security database used by the app (but isn't
    authorized) while the ias_admin user is not in the security database.
    I have the following questions:
    1. In the default configuration, is there a username/password I can use to
    lookup EJB homes in the jndi namespace of an OC4J instance? If so, what
    is it?
    2. Where is the security database? I tried looking in the web-based console
    to find how to configure security and could not figure it out. I did find
    the Security page for the application, but when I tried to add a user,
    it had no effect. Furthermore, this page did not show a user entry for
    SCOTT; hence, it doesn't seem that OC4J is actually using the information
    on this page. This is strange because the path to this page is:
    Farm > Application Server: ias_admin.lab10.sac.unify.com > OC4J: home > Application: UnifyoccEAR > Security
    I then went to the Security page for the default application and found
    that it did have a SCOTT user. So I added a new user and tried to run
    my java client. This resulted in the javax.naming.AuthenticationException
    described above (I was expected the NoPermissionException encounted when
    using SCOTT/TIGER). Next, I used the Security page for the default application
    to change the password for SCOTT and reran my java client using SCOTT/TIGER.
    This time I was expecting an AuthenticationException exception, but got the
    NoPermission exception. Therefore, it seems that OC4J isn't using this
    security data either.
    Hunting in the console (again) for the security database, I stumble accross
    the Infrasturcture page and see an Identity Management section and see that
    it is configure to use an Oracle Internet Directory server. Using
    <ORACLE_HOME>/bin/oidadmin, I connect to the directory server and look
    for the SCOTT user. I don't find it, so I believe that this can't be the
    security database either.
    3. Finally, how do I configure the OC4J instance such that it will allow
    anonymous users to lookup my EJB from a java client?
    Please help a confused and frustrated user.

    Looking at your example, it looks like you are using a J2EE client container or some properties file to specify the JNDI environment used to create the initial context (for you use the no-arg constructor to InitialContext). Since our application needs to the ability to dynamically connect to ejb's running on different Java application servers (e.g., WebLogic, WebSphere, JBoss), such an approach will not work. Instead we must do it the old-fashioned way and pass the jdni connection info to the InitialContext constructor.
    In any event, our problem isn't how to write the connection code, it is how to test it. Specifically, we can't figure out a valid username/password that will allow us to look up the home. Nor can we figure out how to configure security for the oc4j instance.

  • Accessing a EJB from a JSP

              A scenario from some one new to web server, server application development.
              I have downloaded and installed an evaluation copy of WebLogic 7.x and successfully
              installed it (W2K version). The product starts up without error and I can connect
              to is successfully. I have created a simple java bean (actually an EJB) and have
              been able to deploy it successfully without any errors.
              I have a simple JSP invoked from a simple HTML page that contains a simple form.
              The JSP is attempting to instaniate the bean via the jsp:useBean tag however,
              all I am able to get back is an error that tells me that my class "could not be
              loaded". Here is the stack trace:
              weblogic.servlet.jsp.JspException: (line 3): class 'USDataworks.MICRworks.MICRworksBean'
              could not be loaded
                   at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:710)
                   at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1372)
                   at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java:3612)
                   at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1924)
                   at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1817)
                   at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1745)
                   at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:959)
                   at weblogic.servlet.jsp.JspParser.doit(JspParser.java:90)
                   at weblogic.servlet.jsp.JspParser.parse(JspParser.java:213)
                   at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
                   at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
                   at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
                   at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:517)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
                   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
                   at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
              If I leave out the jsp:useBean tag I am able to return a simple HTML page based
              on information sent to the server, so I know some of the environment is properly
              set up.
              I have browsed through some of the WebLogic site and have been referred to any
              number of configuration files (*.properties) which do not appear to exist. I
              am frustrated and confused and would appreciate any help in getting this to work.
              Thank you.
              

              In the Weblogic 7.0.2 instalation, there is a tool for creating taglibrary to wrap
              an ejb cals to jsp tags. The tool names simply ejb2jsp and is described in document
              : "Programming Weblogic JSP" (pdf). My problem is: when I try to load my ejb ...jar
              file, the tool throws this Null pointer exception: (below).
              Have anybody some experience with this? It's the same for gui and cmd-line version.
              Could you advice me?
              Thank you.
              D:\SRC\jbproject\TestEntity>java weblogic.servlet.ejb2jsp.gui.Main
              error occurred: java.lang.NullPointerException
              java.lang.NullPointerException
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
              at weblogic.servlet.ejb2jsp.Utils.createBeanDescriptor(Utils.java:343)
              at weblogic.servlet.ejb2jsp.Utils.createDefaultDescriptor(Utils.java:314
              at weblogic.servlet.ejb2jsp.Utils.createDefaultDescriptor(Utils.java:266
              at weblogic.servlet.ejb2jsp.gui.Main.loadFromPaths(Main.java:391)
              at weblogic.servlet.ejb2jsp.gui.Main.doNew(Main.java:378)
              at weblogic.servlet.ejb2jsp.gui.Main$5.run(Main.java:575)
              at weblogic.servlet.ejb2jsp.gui.MainWorker.run(Main.java:757)
              at java.lang.Thread.run(Thread.java:479)
              error occurred: java.lang.NullPointerException
              java.lang.NullPointerException
              at weblogic.servlet.ejb2jsp.gui.Main.doNew(Main.java:379)
              at weblogic.servlet.ejb2jsp.gui.Main$5.run(Main.java:575)
              at weblogic.servlet.ejb2jsp.gui.MainWorker.run(Main.java:757)
              at java.lang.Thread.run(Thread.java:479)
              "Xiang Rao" <[email protected]> wrote:
              >
              >EJB and Java Bean are two different things. I don't think you can use
              >useBean tag
              >for EJB. On the other hand, you can write a Java Bean to wrap your EJB
              >and use
              >useBean tag.
              >
              >"Marek Kossak" <[email protected]> wrote:
              >>
              >>A scenario from some one new to web server, server application development.
              >>
              >>I have downloaded and installed an evaluation copy of WebLogic 7.x and
              >>successfully
              >>installed it (W2K version). The product starts up without error and
              >>I can connect
              >>to is successfully. I have created a simple java bean (actually an
              >EJB)
              >>and have
              >>been able to deploy it successfully without any errors.
              >>
              >>I have a simple JSP invoked from a simple HTML page that contains a
              >simple
              >>form.
              >> The JSP is attempting to instaniate the bean via the jsp:useBean tag
              >>however,
              >>all I am able to get back is an error that tells me that my class "could
              >>not be
              >>loaded". Here is the stack trace:
              >>
              >>weblogic.servlet.jsp.JspException: (line 3): class 'USDataworks.MICRworks.MICRworksBean'
              >>could not be loaded
              >>     at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:710)
              >>     at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1372)
              >>     at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java:3612)
              >>     at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1924)
              >>     at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1817)
              >>     at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1745)
              >>     at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:959)
              >>     at weblogic.servlet.jsp.JspParser.doit(JspParser.java:90)
              >>     at weblogic.servlet.jsp.JspParser.parse(JspParser.java:213)
              >>     at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
              >>     at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
              >>     at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
              >>     at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
              >>     at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
              >>     at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:517)
              >>     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
              >>     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
              >>     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
              >>     at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
              >>     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
              >>     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
              >>     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
              >>     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
              >>
              >>If I leave out the jsp:useBean tag I am able to return a simple HTML
              >>page based
              >>on information sent to the server, so I know some of the environment
              >>is properly
              >>set up.
              >>
              >>I have browsed through some of the WebLogic site and have been referred
              >>to any
              >>number of configuration files (*.properties) which do not appear to
              >exist.
              >> I
              >>am frustrated and confused and would appreciate any help in getting
              >this
              >>to work.
              >>
              >>Thank you.
              >
              

  • Invalid guid error looking up EJB from a startup class

    Gentlemen,
    I am receiving an "invalid guid at GDS" error that is similar to others reported at:
    http://softwareforum.sun.com/servlet/ProcessRequest?RHIVEID=181&RPAGEID=135&HOID=50B500000008000000FE090000&UCATEGORY_0=_29_%24_24_6_&UCATEGORY_S=0
    and
    http://softwareforum.sun.com/servlet/ProcessRequest?RHIVEID=181&RPAGEID=135&HOID=50B500000008000000FE090000&UCATEGORY_0=_29_%24_24_6_&UCATEGORY_S=0
    In my case, I can retrieve the EJB from my rich client with no problems. However, if I execute the exact
    same code from within a startup class (i.e. com.iplanet.ias.startup.StartupClass) then I get the following error repeated until memory runs out:
    javax.naming.NameNotFoundException: MessageRepositoryBean : Invalid guid null in
    GDS
    at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(InitialContext.java:357)
    at com.netscape.ejb.CorbaHomeFactoryImpl.ConstructEJBHome(Unknown Source
    at com.netscape.CosNaming.NamingContextImpl.resolve(Unknown Source)
    at org.omg.CosNaming._NamingContextImplBase.invoke(_NamingContextImplBas
    e.java:233)
    at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch(ServerDelegat
    e.java:236)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:227)
    at com.sun.corba.ee.internal.iiop.CachedWorkerThread.doWork(IIOPConnecti
    on.java:262)
    at com.sun.corba.ee.internal.iiop.CachedWorkerThread.run(IIOPConnection.
    java:230)
    javax.naming.NameNotFoundException: MessageRepositoryBean : Invalid guid null in
    In previous answers people have suggested adding various things to the app server classpath. This does not make any difference for me. I am puzzled why code runs fine in a normal rich client, but not in a startup class. Here is the code that I am running:
    try
    String contextFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
    String providerURL = "iiop://localhost:9010";
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
    p.put(Context.PROVIDER_URL, providerURL);
    Context context = new InitialContext(p);
    MessageRepositoryHome home = (MessageRepositoryHome)
    PortableRemoteObject.narrow(context.lookup("ejb/MessageRepository"), MessageRepositoryHome.class);
    MessageRepository repository = home.create();
    catch(Exception e)
    e.printStackTrace(Log.err);
    System.exit(1);
    Thanks for your help,
    Mark

    I was mistaken in this posting. I was able to access the EJB from the startup class so there must be something else that I am doing to cause this problem. I'd still like to know why I get those invalid guid errors though.
    By the way, please forgive me for using the gender-specific gentlemen in my posting. That was accidental.

  • Having trouble moving mail messages from one user to another

    I am trying to move mail messages from one user to another on my Macbook, and I cannot seem to do it. I've tried archive, but I don't think I'm doing it right. Any suggestions?
    Thanks,
    Noreen
    Message was edited by: reensjp

    I had to go to the Mac store to get the answer to this one... i was archiving correctly, but you need to save the mbox files to your desktop, then move them to the shared folder, that way all users have access. I also had to edit the permissions on the files, as the user i wanted to have the emails didn't have permission to even look at the files.
    Noreen

Maybe you are looking for