Java standalone and EJB

Hi everyone,
I want my java class to call an EJB.
I created an EJB and deployed it on my J2EE server.
I now want to call that EJB.
I created a Context and looked up that EJB...but it doesn't work.
The exception occurs when I try to get the Home object using the narrow method.
Any idea is welcome.
Thanks,
Regards.

Hi,
have you created jndi name for that bean in ejb-j2ee-engine.xml.
other wise it will take the jndi name as sap.co/youEAR/Bean name.
check the jndi name once in visual administrator.
ithink you have created the properties object and give that as a parameter to initial context.
regards,
null

Similar Messages

  • Java Beans and EJBs

    Hi friends,
    I am quite new to Java and am interested in understanding EJBs and their use in deploying distributed applications.
    I am not sure if I am supposed to first understand Java Beans before jumping to EJBs. I did read some of the messages under the Java Beans forum page but am confused..please help!!!
    Regards,
    Ritu

    if I am supposed to first understand Java Beans before jumping to EJBsYes! Even before understanding objects and inheritence and so on.

  • What is the difference between Java Beans and EJBs ?

    Hi,
    Can someone tell me that ? Kind of confused... Thanks !
    Philip

    Hmm, I'm gonna have a go at this - hopefully someone will build on it with more differences or requirements:
    A Java Bean is merely a Java class written to conform to some simply rules for construction and method naming eg:
    public class MyBean
      private String myField;
      public MyBean()
      public void setMyField(String myField)
        this.myField = myField;
      public String getMyField()
        return myField;
    }Applications can use Java Beans without having to know about the class in advance - a typical situation might be their use in visual GUI editors where the properties of the bean can be exposed and manipulated by the editor through examination of the method names or an accompanying descriptor.
    An Enterprise Java Bean doesn't have all that much in common with a Java Bean. An EJB is a small set of classes meeting a single (usually) business requirement written to conform to the EJB specification. This enables them to be used by J2EE Application servers to perform enterprise business functions (data storage, manipulation, business logic etc.). The whole idea is that by writing to the specification the server can automatically provide support for transaction management, concurrent access, scaleability, etc that a mission-critical system might require without the programmer having to understand the workings of the application server.
    Essentially an EJB can either
    1) maintain the permanent state of a business object (eg, hold the data for a single product in a catalogue)
    2) perform a small set of business operations (eg, place an order for a customer)
    3) act in response to messages passed around the system (eg, send a mail to the user when the items have been shipped)
    I would have a look at the following two pages to get a better overview:
    http://java.sun.com/products/javabeans/
    http://java.sun.com/products/ejb/
    Hope this helps.

  • Diff between java beans and EJB

    What is Java Bean

    http://www.google.co.uk/search?hl=en&q=What+is+Java+Bean&btnG=Google+Search&meta=

  • Webdynpro java and EJB integration

    Hi,
    I am new to Webdynpro Java, would require your help in the following area:
    my requirement is I need to read values from oracle database using EJB/Java Beans and display the same using webdynpro JAVA(as user interface).
    Pls suggest the possible solution with required docs & videos(if possible)
    FYI:
    Tools: NWDS 7.0, SAP portal 7.3
    Thanks
    Nag

    Hello Nag,
    there are two possibilities to use your ejb in WD4J:
    1. Via JNDI Lookup
      try {
            InitialContext ctx = new InitialContext();
            <YourEJBInterface Class> service = (<YourEJBInterface Class>) ctx.lookup(<JNDI-Name>);
      } catch (NamingException e) {
            throw new RuntimeException(e);
    2. Via EJB Model:
    here a guide --> http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70d2638c-4b04-2d10-d2a3-992fdf1e3d55?quicklink=index&…
    hope this helps.
    Regards
    Tobi

  • Whether java component (Not ejb, not servlet) can be deployed in App Server and get the services provided by App Server

    As I mentioned in subject, I am just wondering Whether the java component (Not
    ejb, not servlet) can be deployed in App Server and get the services provided
    by App Server or not?

    Nevermind folks - I got it to work. All my configuration was correct; I had other issues with the ejb-jar file that the verifier informed me of (my previous deployments were with the verifier turned-off).

  • Java and EJB Skills

    Hi Everybody,
       I know we need to know little to bit of Java for Java Mapping. Do we also need to know EJB for any reason? What is the skill level or how deep we need to knwo about EJB. Is there any document or thread which gives some info.
    Thanks you.

    Hi sonia,,,
    Stefan is absolutely correct..
    Java mapping and UDF coding just require simple java ....no EJB concept involved in tht...
    EJB concept is required for creating adapter modules ....
    Regards ,
    Sushil

  • Ejb exampples and i want to know where to store java files and how make jar file and how to run

    hi,
    I am Nidhin Benjamin.This is the first i am working in Weblogic81 and EJB also.please
    can you tell about whole procedure and from where i want to start and

    Hi Nidhin,
    You could start by reading the EJB docs at
    http://e-docs/wls/docs81/ejb/index.html and playing with the examples at
    C:\bea810\weblogic81\samples\server\examples\src\examples\ejb20
    - Nick
    "Nidhin Benjamin" <[email protected]> wrote in message
    news:3ff127ff$[email protected]..
    >
    hi,
    I am Nidhin Benjamin.This is the first i am working in Weblogic81 and EJBalso.please
    can you tell about whole procedure and from where i want to start and

  • Strange behaviour between standalone and enterprise

    Hi
    I'v been running my app on 9.0.3 standalone for weeks now. Very stable and happy.
    Now I'm trying to get this going on 9.0.3 with WebCache and HTTP server install. Also 9.0.3 on Windows 2000 Server.
    The application part that I'm testing is two servlets receiving a HTTP post from within an Oracle 8.1.7 database.
    The one servlet (no 1) does a lookup of EJB's depending on data received and send a XML document back.
    The other servlet (no 2) submits a JMS queue entry with a MDB doing its own database action after calling EJB's.
    What happens is that when servlet no 1 runs on its own, no problem.
    Starting servlet 2 causes no problem until after approximately 10 minutes.
    Each handles approx 2 requests/second.
    The problem condition is as follows:
    Having a look at the oc4j.out file I can see the EJB Create and EJB setContext methods being called creating more and more EJB's (stateless session beans). Under normal conditions one can see the create/context and then later the remove and so on - quite normal. Under the error condition the number of EJB's just keep increasing without being removed AND without returning data! The whole server responds to the server:1810 admin interface but no user can use the system. JSP's, etc all are hanging.
    The JMS bit is not using Oracle AQ but is a very primitive implementation.
    This all works fine on OC4J standalone!
    I had to change the JMS.xml port value from 9127 to 3201 to get it going.
    Looking at the OC4J instance (I created a new one to deploy my ear files with only one VM) the number of active sessions and active requests idle at 1 to 2 but once the "error condition" starts keeps climbing as none gets processed. The number of open JDBC connections also keeps climbing. Memory usage was approx 184 Meg with Heap size at 154 Meg before.
    The oc4j.err file didn't record any abnormal activity.
    Any help/ideas appreciated!!
    Here is the Servlet no 2 code:
    import javax.servlet.ServletContext;
    import javax.servlet.ServletInputStream;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpSession;
    import javax.servlet.SingleThreadModel;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.jms.QueueSession;
    import javax.jms.QueueConnection;
    import javax.jms.Session;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.Queue;
    import javax.jms.TextMessage;
    import javax.jms.QueueSender;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Date;
    import org.xml.sax.SAXException;
    import oracle.xml.parser.v2.XMLDocument;
    import org.xml.sax.SAXParseException;
    import Util_XML.XMLHelper;
    public class WizMesServlet extends HttpServlet implements SingleThreadModel
    ServletContext context;
    XMLDocument outXMLDoc;
    private Queue queue;
    private QueueConnectionFactory queueConnectionFactory;
    private String qName;
    private String qConnFactory;
    private QueueConnection queueConnection;
    private PrintWriter out;
    private int reqCounter = 0;
    private Date startDate;
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    startDate = new Date();
    try
    Context ctx = new InitialContext();
    catch (Exception ex)
    System.out.println("Error in servlet init method =>"+ex.toString());
    public void doPost (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    out = response.getWriter();
    response.setContentType("text/xml");
    HttpSession session = request.getSession();
    session.setMaxInactiveInterval(120); //(value in seconds)
    try
    incCounter();
    IncomingRequestParams inReqParams;
    XMLDocument inXMLDoc = new XMLDocument();
    ServletInputStream inStream = request.getInputStream();
    boolean hasRecords = true;
    inXMLDoc = XMLHelper.parse(inStream, null);
    inStream.close();
    //((XMLDocument)inXMLDoc).print(System.out);
    IncomingMesRequest inRequest = new IncomingMesRequest();
    BuildMesRequest br = new BuildMesRequest(inRequest, inXMLDoc);
    XMLDocument xmlDocToPost = SubmitJMS(inRequest);
    //System.out.println("Returnvalue for jms is ");
    //((XMLDocument)xmlDocToPost).print(System.out);
    xmlDocToPost.print(out);
    catch (SAXException saxe)
    System.err.println("SAX exception occurred =>"+saxe.toString());
    catch (WizIntException wie)
    System.err.println("Wizard exception extracting XML data =>"+wie.toString());
    try
    String xmlOut="<xmlreturn>"+
    "<retmessage>Error extracting XML Data</retmessage>"+
    "<retcode>2</retcode>"+
    "</xmlreturn>";
    XMLDocument xmlDocToPost = new XMLDocument();
    xmlDocToPost = XMLHelper.parse(xmlOut, null);
    xmlDocToPost.print(out);
    catch (SAXParseException spe)
    spe.printStackTrace();
    catch (SAXException saxe)
    saxe.printStackTrace();
    out.close();
    session.invalidate();
    private XMLDocument SubmitJMS(IncomingMesRequest inreq)
    try
    qName = inreq.queueName;
    qConnFactory = inreq.queueConnFactory;
    Context jndiContext = new InitialContext();
    queueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup(qConnFactory);
    queue = (Queue)jndiContext.lookup(qName);
    // Now determine how many parameters and of what data type we have to pass
    //System.out.println("Calling Message Bean on queue "+qName+" with connFactory "+queueConnectionFactory);
    queueConnection = queueConnectionFactory.createQueueConnection();
    queueConnection.start();
    QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    QueueSender queueSender = queueSession.createSender(queue);
    TextMessage message = queueSession.createTextMessage();
    //System.out.println("Name is >"+qName+"<");
    if (qName.equals("jms/EscalationsQueue"))
    message.setText("Escalation Data From Wizard");
    message.setStringProperty("username",inreq.username);
    message.setStringProperty("password",inreq.password);
    message.setStringProperty("escalationRefNo",inreq.escalationRefNo);
    message.setStringProperty("escalationActNo",inreq.escalationActNo);
    message.setStringProperty("escalationDest",inreq.escalationDest);
    message.setStringProperty("escalationAction",inreq.escalationAction);
    message.setStringProperty("dataBase",inreq.dataBase);
    message.setStringProperty("msisdnNo",inreq.msisdn);
    message.setStringProperty("machineURL",inreq.machineURL);
    else if (qName.equals("jms/IMEIUpdateQueue"))
    message.setText("IMEI Update Data From Wizard");
    message.setStringProperty("eventRefNo",inreq.eventRefNo);
    message.setStringProperty("msisdn",inreq.msisdn);
    message.setStringProperty("dataBase",inreq.dataBase);
    queueSender.send(message);
    queueSender.close();
    outXMLDoc = new XMLDocument();
    String xmlOut="<xmlreturn>"+
    "<retmessage>success</retmessage>"+
    "<retcode>1</retcode>"+
    "</xmlreturn>";
    XMLDocument xmlDocToPost = new XMLDocument();
    xmlDocToPost = XMLHelper.parse(xmlOut, null);
    //System.out.println("At returning xml doc pos for msisdn "+inreq.msisdn);
    //((XMLDocument)xmlDocToPost).print(System.out);
    return xmlDocToPost;
    catch (Exception ex)
    System.out.println("Originator=> WizMesServlet = Error in call queue =>"+qName+" Error =>"+ex.toString());
    return null;
    private synchronized void incCounter()
    reqCounter++;

    Thanks all for your help. I'm looking into the code you sent me but at the moment I get a compile error:
    "DecimalFormat cannot be resolved into a type"
    for information, my header reads:
    //Caravan loading program
    //Written by CPGL
    //August/September 2007
    //Applet will calculate nose weight, mass and inertia of a caravan and use this to
    //determine damping ratio (crudely speaking)
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Math;
    public class caravansnake6 extends Applet
    implements MouseListener, MouseMotionListener, ActionListener, Runnable
    Do I need to import some other class to be able to use the DecimalFormat code?
    thanks again - this is my first real use of a forum by the way and I'm totally sold!
    cheers
    Chris

  • How I create a client standalone in EJB, help me please

    I need create a client standalone but the application no find my JNDI. Will be anyone give me one step by step client standalone in EJB?
    Hugs, thanks

    needing multiple usernames and passwords is going to force you into using a database type log in system. There is no "simple" way to accomplish this. You can also use java, ajax and a number of other types. But for the most secure you want to use a server sided language like ColdFusion, PHP, ASP, etc. That's where your server configuration comes in. What server sided language will it support? That's a good place to start.
    Another good place to start is do you know anything about code to write some on your own? DW does some coding for you, there are plug ins but it is always best to be able to understand the code.
    you can always look through the DW exchange for a small log in system that might be easy for you to change to your needs.

  • Questions on Java Reflection in EJB

    Hi,
    Recently, I use reflection technology on EJB to get/set properties of a bean.
    We need it because we need to encapsulate data in a map to transfer data between
    presentation layer and business back end(i.e. the so-called value data object).
    A bean is packed into a map as following:
    The property name of a bean becomes the key in the map, and its value becomes the
    corresponding value in the map.
    So we have to do two things:
    1)Given a bean, convert it to a map;
    2)Given a data map, assign the value to a bean
    It would be nice if we can implement the two requirements in a base class. So I use
    reflection. And succeed to achieve the goal.
    But there are two problems occured and I can't understand why.
    1)If I use Class.forName() to load the entity bean implementation class(BMP or CMP abstract
    schema) I got a ClassNotFoundException. A workaround is to jar the BMP or CMP bean class
    and place it on the classpath.
    So, I want to know why there is such restriction.
    2)For the classes java.lang.reflect.Method, java.lang.reflect.InvocationTargetException
    I reference to in bean class, the IDE(I use IntelliJ Idea) give me a
    warning: "Use java.lang.reflect.Method are not allowed in EJB". Are the methods really
    dangerous in EJB environment?
    Can anyone explain me these pluzzles?
    Thank you in advance!
    BTW, I develop under weblogic 7.0. Now, my program functions well, I just can't understand
    the above phenomena.
    Regards,
    Justine

    1) You should never directly manipulate the EJB implementation class. That class is for the container. When accessing EJBs (no matter the means), you should use the Home/Remote or Local interfaces - those your client should already have. If what you're doing is actually working for you, I can only say that you're not using EJBs properly and are not getting the actual "bang for the buck" you paid for. And you're damn lucky it hasn't blown bits all over the place...
    2) Yes, it is potentially dangerous to be dorking around with reflection on EJBs. When you're using the Home/Remote or Local interfaces, you're actually using an Object that the vendor supplies to perform the actual remote operations. Using reflection could potentially invoke one of the "hidden" vendor methods with extremely unpredictable results - like deleting your entire table.
    As for using a map for transferring data, I would strongly recommend against it, especially in this case, because you've not only lost the strong typing you get with ValueObjects, but you have to do a lot of extra work on both "sides" (client and EJB) to make sure all your data is present and/or correct.

  • Using java class and variables declared in java file in jsp

    hi everyone
    i m trying to seperate business logic form web layer. i don't know i am doing in a right way or not.
    i wanted to access my own java class and its variables in jsp.
    for this i created java file like this
    package ris;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class  NewClass{
        public static void main(String args[]){
            Connection con = null;
            ResultSet rs=null;
            Statement smt=null;
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con=DriverManager.getConnection("jdbc:mysql:///net","root", "anthony111");
                smt=con.createStatement();
               rs= smt.executeQuery("SELECT * FROM emp");
               while(rs.next()){
                String  str = rs.getString("Name");
                }catch( Exception e){
                    String msg="Exception:"+e.getMessage();
                }finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
    }next i created a jsp where i want to access String str defined in java class above.
    <%--
        Document   : fisrt
        Created on : Jul 25, 2009, 3:00:38 PM
        Author     : REiSHI
    --%>
    <%@page import="ris.NewClass"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h1><%=str%></h1>
        </body>
    </html>I wanted to print the name field extracted from database by ResultSet.
    but it gives error cannot find symbol str.
    please help me to find right way to do this.
    i am using netbeans ide.

    Very bad approach
    1) Think if your table contains more than one NAMEs then you will get only the last one with your code.
    2) Your String is declared as local variable in the method.
    3) You have not created any object of NewClass nor called the method in JSP page. Then who will call the method to run sql?
    4) Your NewClass contains main method which will not work in web application, it's not standalone desktop application so remove main.
    Better create an ArrayList and then call the method of NewClass and then store the data into ArrayList and return the ArrayList.
    It should look like
    {code:java}
    package ris;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class  NewClass{
        public static ArrayList getNames(){
            Connection con = null;
            ResultSet rs=null;
            Statement smt=null;
            ArrayList nameList = new ArrayList();
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con=DriverManager.getConnection("jdbc:mysql:///net","root", "anthony111");
                smt=con.createStatement();
               rs= smt.executeQuery("SELECT * FROM emp");
               while(rs.next()){
                nameList.add(rs.getString("Name"));
               return nameList;
                }catch( Exception e){
                    String msg="Exception:"+e.getMessage();
                   </code><code class="jive-code jive-java"><font>return nameList;</code><code class="jive-code jive-java">
                }finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
          </code><code>return nameList;</code>
    <code class="jive-code jive-java">    }

  • Could not lookup PortalManagerHome in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager

    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:802)
    at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:173)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:36)
    at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:124)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at com.bea.p13n.util.JndiHelper.lookupNarrow(JndiHelper.java:96)
    at com.bea.portal.appflow.PortalAppflowHelper.<clinit>(PortalAppflowHelper.java:64)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.init(PortalWebflowServlet.java:78)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:700)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:643)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:588)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    <Nov 6, 2002 5:37:59 PM IST> <Error> <HTTP> <[WebAppServletContext(19695286,FirstWebApp,/FirstWebApp)]
    Servlet failed with Exception
    java.lang.NullPointerException:
    at com.bea.portal.appflow.PortalAppflowHelper.createPortalManager(PortalAppflowHelper.java:82)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.setupPortalRequest(PortalWebflowServlet.java:187)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.doGet(PortalWebflowServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    When I decompiled the class PortalAppflowHelper, I found a static block in it,
    which was as under-
    static
    debug = Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB reference java:comp/env/ejb/PortalManager");
    portalManagerHome = (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome " + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

    Neeraj -
    The Portal framework code (including PortalAppflowHelper) uses ejb
    references to find the PortalManager (and other EJBs) from servlets and
    taglibs; that is what is signified by the java:comp/env/... name.
    Since you built your webapp from scratch (instead of using the portal
    wizard), you will need to make sure the you have the appropriate
    <ejb-ref> entries in your web.xml, and the corresponding
    <ejb-reference-description> entries in your weblogic.xml. By default,
    you will need at least mappings for:
    - ejb/PortalManager
    - ejb/UserManager
    - ejb/GroupManager
    - ejb/PipelineExecutor
    - ejb/EventService
    See either the resulting webapp from using the portal wizard or
    BEA_HOME/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/sampleportal/WEB-INF
    for example syntax.
    Greg
    Neeraj Hans wrote:
    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have
    synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my
    application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup
    PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve
    comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at <stack trace lines snipped>
    When I decompiled the class PortalAppflowHelper, I found a static
    block in it,
    which was as under-
    static
    debug =
    Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB
    reference java:comp/env/ejb/PortalManager");
    portalManagerHome =
    (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome "
    + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its
    ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

  • Java.rmi.RemoteException: EJB Exception: while calling an EJB method,

    Hi
    I am getting below error while calling a stateless EJB method. There is some validation checks while performing ejb's modify() method and a RuntimeException is thrown in case of validation failure.The modify() method internally calls other stateless ejb as well.
    The problem I'm facing is, instead of getting the expected RuntimeException in the Servlet, i am getting RemoteException. I am using WLS 9 MP1, all participating ejbs are stateless and i am using default transaction attributes(Supports) for these ejbs.
    The interesting part is, at the ejb layer RuntimeException is thrown as expected, but this exception changed to RemoteException at the servlet's end where i am catching the ejb call exceptions.
    I am new to WLS, please suggest/help me out of this exception.
    Any help is truly appreciated.
    java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.RuntimeException:
         at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
         at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
         at com.mycomp.base.BaseController_8x2e52_EOImpl.modify(BaseController_8x2e52_EOImpl.java:149)
         at com.mycomp.webgui.servlet.FrontComponent.service(FrontComponent.java:207)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Thanks!
    Edited by: user10721298 on Feb 23, 2009 4:16 AM

    Hi,
    If i don't misunderstand, you are using the RuntimeException as an application exception, right?
    Have you annotated it or denoted it in deployment descriptor?
    Thanks,
    Amy

  • WebLogic 10 and EJB 3.0 for Message Driven Bean

    Hi,
    I am trying to deploy Message Driven Bean using EJB3.0 on weblogic 10. I am using annotations and don't want to use deployment descriptors.
    The Bean class:
    CalculatorBean.java
    import javax.ejb.*;
    import javax.jms.*;
    import java.sql.Timestamp;
    import java.util.StringTokenizer;
    @MessageDriven(activationConfig =
    @ActivationConfigProperty(propertyName="destinationType",
    propertyValue="javax.jms.Queue"),
    @ActivationConfigProperty(propertyName="destination",
    propertyValue="queue/mdb")
    public class CalculatorBean implements MessageListener {
    public void onMessage (Message msg) {
    TextMessage tmsg=null;
    try {
    if (msg instanceof TextMessage) {
    tmsg = (TextMessage) msg;
    System.out.println
    ("MESSAGE BEAN1: Message received: "
    + tmsg.getText());
    } else {
    System.out.println
    ("Message of wrong type1: "
    + msg.getClass().getName());
    catch (JMSException e) {
    e.printStackTrace();
    catch (Throwable te) {
    te.printStackTrace();
    My client:
    import javax.naming.*;
    import javax.naming.InitialContext;
    import java.text.*;
    import javax.jms.*;
    public class MsgClient {
    public static void main(String args[])
    QueueConnection cnn=null;
    QueueSender sender=null;
    QueueSession sess=null;
    Queue queue=null;
    try {
    java.util.Properties p = new java.util.Properties();
    p.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
    p.put("java.naming.provider.url","t3://10.6.74.79:7001");
    Context ctx=new InitialContext(p);
    //InitialContext ctx=new InitialContext(p);
    queue = (Queue)ctx.lookup("queue/mdb");
    QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
    cnn = factory.createQueueConnection();
    sess= cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
    sender = sess.createSender(queue);
    TextMessage message = sess.createTextMessage();
    message.setText("This is message by Gurumurthy" );
    System.out.println("Sending message: " +message.getText());
    sender.send(message);
    sess.close();
    catch (Exception e)
    e.printStackTrace();
    I am compiling and creating jar file for this class. Then I am creating a .ear file for this.
    The meta-inf/application.xml contains the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
    <display-name>MDBWorking1</display-name>
    <description>Application description</description>
    <module>
    <ejb>MDBWorking1.jar</ejb>
    </module>
    </application>
    I don't want to use deployment descriptor (ejb-jar.xml or weblogic-ejb-jar-xml), because I want to utilize the annotation feature of EJB3.0
    So, after creating the .ear file for this, and try to deploy on weblogic 10, I get the following error:
    An error occurred during activation of changes, please see the log for details.
    Exception preparing module: EJBModule(MDBWorking1.jar) Unable to deploy EJB: CalculatorBean from MDBWorking1.jar: [EJB:011113]Error: The Message Driven Bean 'CalculatorBean(Application: MDBWorking1, EJBComponent: MDBWorking1.jar)', does not have a message destination configured. The message destination must be set using a message-destination-link, destination-resource-link, destination-jndi-name or a resource-adapter-jndi-name.
    Substituted for missing class [EJB - 11113]Error: The Message Driven Bean 'CalculatorBean(Application: MDBWorking1, EJBComponent: MDBWorking1.jar)', does not have a message destination configured. The message destination must be set using a message-destination-link, destination-resource-link, destination-jndi-name or a resource-adapter-jndi-name.
    How to solve this?
    Note:
    I don't want to use Deployment Descriptor and all I want to use is EJB3.0's annotation feature.
    Thanks,
    Guru

    Dear gurubbc,
    I don't know if it still matters to you but you can use the javax.ejb.MessageDriven annotation to point your bean on your queue. I had the same issue like you but i could not solve it properly by switchihg to weblogic.ejb.MessageDriven.
    Use the following annotation and it should work out:
    @MessageDriven
    (mappedName = "queue/mdb",
    name = "CalculatorBean",
    activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
    Here you can see that the mappedName is the JNDI name of the queue you are trying to connect to. The name is the name for your Bean, and the only property passed is the destination type.
    Hope this helps.
    Cheers,
    Istvan

Maybe you are looking for

  • Date and number display format

    Hello all, I am new to Adobe Form, and I am quite unimpressed with how difficult it is to do the most simple things. I have managed one way or another to solve all my problems until now, but this one got me stuck. I have date and number fields in my

  • Application Catalog Website Point Status Critical - But why?

    I am having some tracking down what is causing this status on a customer's primary site. I've checked the portlctl.log and awebsctl.log where both show a status 0 of running. When I try to reset the status of the Application Catalog website point the

  • BO Data Services - Reading from excel file and writing to SQL Server Table

    Hi, I would like to read data from an excel file and write it to a SQL Server Data base table without making any transformations using Data Services. I have created an excel file format as source and created target table in SQL Server. The data flow

  • ECC 6.0 install error

    Hi, i am getting error as "runMigratioMonitor error" (FCO-001). OS= win 2003 Enterprice edition.-32 bit no support pack database= Oracle 10g. h/w=32 bit hp p-4 system. java= j2sdk1.2.04_09 problem getting in ABAP import phase. Please let me know, wha

  • Mac Mini will not read dvd data disk ie osx install disk with internal drive but will read dvd movies

    As title said , cant get internal drive to read data dvd's havent tried cd's. I also tried to use an external drive with no luck with any disks. system info shows the drive though. So i guess i have 2 issues. any ideas will help thank you