Exception : JSP & EJB

Hi,
I'm working on a project but it doens't work perfectly.
It use J2EE, EJB and JSP technology but I'm fresh in this field.
At the moment, sometimes (but not for each utilisation and I don't unterdstand why !) there is a Servlet exception which is :
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: Cannot create bean of class util.DocumentationServicesBean
Root Cause:
java.lang.ClassNotFoundException: class util.DocumentationServicesBean : java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
     java.rmi.RemoteException: Client not authorized for this invocation.
     at java.beans.Beans.instantiate(Beans.java:211)
     ... ... ...If someone know the reason of this problem, please let me know.
Thanks !

it's not a servlet exception but when ur jsp/servlet is trying to invoke the EJBs, by any means, like creating a new instance, or just getting the pre-existed data by some finder method etc. etc., some times it doesn't have sufficient rights to do that call. Then ur ejb server throws an error, which ultimately comes to the webserver in the form of ServletException.
java.rmi.RemoteException: Client not authorized for this invocation.
at java.beans.Beans.instantiate(Beans.java:211)check ur deployment descriptor for the different roles and their rights, and different methods and permissions for them.
good luck,

Similar Messages

  • Good books for learning Java(Servlets,JSP,EJB,etc.,),Javascript.

    Hi Experts,
    Can you suggest me some good books on java , javascript.The books should include the internals of Servlets,JSP,EJB.
    Thanks
    vishal

    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=756427&start=7
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=751055
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=743429
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=742997&start=11
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=750775&start=24
    Just a simple search for this forum....
    It took me 10 seconds tofind these..
    JJ

  • Except JSP Agent, other web components are down.

    In my R12 Vision instance, Except JSP Agent, other web components are down. How can i make it up & running? Please help me.
    Web Components Status
    PL/SQL Agent Down
    Servlet Agent Down
    JSP Agent Up
    Discoverer Unmonitored
    Personal Home Page Down
    TCF Down
    Thanking you

    As applmgr user, please do the following:
    - cd %INST_TOP%\apps\<SID>_<hostname>\admin\scripts
    - Issue "adopmnctl.sh start" to startup the components
    - Issue "adopmnctl.sh status" to verify the status of each component, you should get something similar to the following:
    Checking status of OPMN managed processes...
    Processes in Instance: PROD_db2.db2.domain.com
    -------------------+--------------------+---------+---------
    ias-component      | process-type       |     pid | status
    -------------------+--------------------+---------+---------
    OC4J               | oafm               |    3800 | Alive
    OC4J               | forms              |    2528 | Alive
    OC4J               | oacore             |    3112 | Alive
    HTTP_Server        | HTTP_Server        |     172 | Alive
    ASG                | ASG                |     N/A | Down
    exiting with status 0
    ERRORCODE = 0 ERRORCODE_END

  • JSP + EJB + IE + resize = lock exceptions

    I'm getting odd behavior when I resize IE 5.5 with a Servlet/JSP loaded
              that references some EJB's. I'm getting dozens of page reloads, followed
              (eventually) by the server getting lock exceptions thrown from the
              EJB's.
              I've tried adjust the HTTP headers to allow for caching, but that
              doesn't seem to help. Does this sound familar to anyone?
              --Paul
              A wholly owned subsidiary of:
              Schroendinger: DS Bd+W G+Y 10 Y+ L+ W- C+ I++ T++/---
              A+ E++ H+ S++ V++ F- Q++ P B+ PA PL-
              Dirac : DS Bs+W G+Y 10 X L- W C+ I+ T+
              A E- H+ S V+ F- Q++ P++ B+ PA+ PL+
              

    I'm getting odd behavior when I resize IE 5.5 with a Servlet/JSP loaded
              that references some EJB's. I'm getting dozens of page reloads, followed
              (eventually) by the server getting lock exceptions thrown from the
              EJB's.
              I've tried adjust the HTTP headers to allow for caching, but that
              doesn't seem to help. Does this sound familar to anyone?
              --Paul
              A wholly owned subsidiary of:
              Schroendinger: DS Bd+W G+Y 10 Y+ L+ W- C+ I++ T++/---
              A+ E++ H+ S++ V++ F- Q++ P B+ PA PL-
              Dirac : DS Bs+W G+Y 10 X L- W C+ I+ T+
              A E- H+ S V+ F- Q++ P++ B+ PA+ PL+
              

  • JSP- EJB Communication

    I have a client-server application where my client is an applet and the server is an EJB.
    The HTML code to launch the applet is dynamically generated by a JSP page. Now i want this JSP page to be able to communicate with the EJB.
    What i need is that the JSP page will pass a parameter to the Applet and the same parameter will be notified to the EJB. So that when the Applet accesses the EJB, the EJB could verify whether the parameter is correct.
    Could someone show me a way to achieve this.
    I am doing all these bcos since it the applet that acceses the EJB anyone who could manage to get the Applet jar file can access the EJB unauthorizedly,with the help of a decompiler.
    If anyone has a better solution to this problem, kindly let me know
    regards
    Raees

    Greetings,
    What i need is that the JSP page will pass a parameter
    to the Applet and the same parameter will be notified
    to the EJB. So that when the Applet accesses the EJB,
    the EJB could verify whether the parameter is correct.Unless you're using a database to hold the verification parameter you're looking at several problems here, especially if your EJB is a Session Bean. Firstly, if your bean is Stateful (SB) you will get an exception when your Applet tries to access the bean since Session Beans are not shareable among multiple threads (meaning, in this case, "clients"). If your bean is Stateless it can store the parameter internally, however, Stateless beans are poolable. This means when your Applet tries to verify itself there's no guarantee that the bean holding the parameter from the JSP is the same bean the Applet verifies against. However...
    Could someone show me a way to achieve this. One way this can be handled is with a "verification" Stateless SB and a temporary database table. The bean can have a method to generate a temporary "key" which it stores in the temporary table and passes back to the caller (JSP). The JSP then passes this as a parameter to the Applet which invokes a method to validate the key. This method would then check the table for the specified key and delete it upon successful verification. However, since you would be embedding a security construct within the web page it is advisable to perform the page loading over SSL...
    I hope this helps.
    regards
    Raees Regards,
    Tony "Vee Schade" Cook

  • JSP/EJB sample-problem

    Hi,
    I'm having difficulties to get the Oracle JSP sample to wrok.
    I deployed the JSP App and also the StackDemo app and changed the envrionment variables as requested .
    But each time I try to use the DemoStack bean by submitting a 'create stack' I get the message :
    "The requested access method is not allowed for that object"
    Can anybody help me with this problem?
    Michel.

    Alex,
    I use OAS 4.0.8.1.
    I also reloaded the application after deployment.
    I used a clinet snippet that is compiled in JDevelope 3.0 and I run it from there .
    It finds THE EJB , ic reated and deployed without giving any error messages. The problem rises the moment I try to use one of the functions of the remote interface of the EJB. In these functions I try to use functionality of viewObjects that are provided by a bussines component that I generated using JDeveloper 3.0.
    The wrb log file mentions a 'null pointer exeption'.
    I think that I do something wrong when initializing the application module that wraps the business component, but I can't see what is wrong.
    This is the code I use in my EJB :
    String theAM = "EDMpackage.EDMAppModule";
    ApplicationModule root = null;
    String sessionDefName = ApplicationModule.DEFAULT_DEF_FULL_NAME;
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    try
    Context ic = new InitialContext(env);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(sessionDefName);
    root = home.create();
    catch(Exception e)
    e.printStackTrace();
    localAppMod = root.createApplicationModule( "EDMAppMod",theAM );
    This works fine , but when I try to get a ViewObject through the localAppMod, I get the error. So I think I am wrong somewhere here.
    Michel.

  • JSP, EJB in Jboss 4 with mySQL database. Error in connecting to database

    Hi, i using JBoss 4-0-1 with jsp and mySQL database. I get this example from a book using stateless session beans. However i modify it so it can connect to mySQL database.
    This is my code for jsp.
    <%@ page import="asg.MusicEJB.*,
    java.util.*,
    javax.naming.Context,
    javax.naming.InitialContext,
    javax.rmi.PortableRemoteObject" errorPage="error.jsp" %>
    <%--
         The following 3 variables appear in a JSP declaration.
         They appear outside the generated _jspService() method,
         which gives them class scope.
         Since we want to initialize our Music EJB object once
         and read the Music Collection database to get the
         recording titles once, we place this code inside
         method jspInit().
         The EJB business method getMusicList()
         returns a collection of RecordingVO objects which we
         store in ArrayList albums.
    --%>
    <%!
         MusicHome musicHome;
         Music mymusic;
         ArrayList albums;
         Properties properties=new Properties();
         public void jspInit() {
                   properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                   properties.put(Context.PROVIDER_URL, "localhost:3306");
                   System.out.println("............................in properties");
              try {
                   //Context initial = new InitialContext();
                   InitialContext jndiContext = new InitialContext(properties);
                   //Object ref  = jndiContext.lookup("MusicEJB");
                   Object objref = jndiContext.lookup("java:comp/env/ejb/EJBMusic");
                   musicHome = (MusicHome)PortableRemoteObject.narrow(objref, MusicHome.class);
                   mymusic = musicHome.create();
                   albums = mymusic.getMusicList();
                   System.out.println(".............................in line 64");
              } catch (Exception ex) {
                   System.out.println("Unexpected Exception............: " +
                             ex.getMessage());
                   ex.printStackTrace();
    %>
    <%--
         The following scriptlet accesses the implicit
         request object to obtain the current URL
         and saves it to the session object for later retrieval. 
         It also saves variable mymusic, so we can
         make remote calls to our Music EJB, and the collection of
         RecordingVO objects.  These variables will all be available
         to other pages within the session.
    --%>
    <%
         String requestURI = request.getRequestURI();
         session.putValue("url", requestURI);
         session.putValue("mymusic", mymusic);
         session.putValue("albums", albums);
    %>
    <html>
    <head>
    <title>Music Collection Database Using EJB & JSP Version 9.7</title>
    </head>
    <body bgcolor=white>
    <h1><b><center>Music Collection Database Using EJB & JSP</center></b></h1>
    <hr>
    <p>
    There are <%= albums.size() %> recordings.
    <form method="post" action="musicPost.jsp">
    <p>
    Select Music Recording:
    <select name="TITLE">
    <%
         // Generate html <option> elements with the recording
         // titles stored in each RecordingVO element.
         // Obtain the current title from the session object
         // (this will be null the first time).
         String title;
         String currentTitle = (String)session.getValue("curTitle");
         if (currentTitle == null) currentTitle = "";
         RecordingVO r;
         Iterator i = albums.iterator();
         while (i.hasNext()) {
              r = (RecordingVO)i.next();
              title = r.getTitle();
              if (title.equals(currentTitle)) {
                   out.println("<option selected>" + title + "</option>");
              else {
                   out.println("<option>" + title + "</option>");
    %>
    </select><p><p>
    <%--
         Provide a "View Tracks" button to submit
         the requested title to page musicPost.jsp
    --%>
    <input TYPE="submit" NAME="View" VALUE="View Tracks">
    </form>
    </body>
    </html>Message was edited by:
    chongming

    This is the deployment descriptor for the .ear file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
      <display-name>MusicDAOApp</display-name>
      <description>Application description</description>
      <module>
        <web>
          <web-uri>war-ic.war</web-uri>
          <context-root>music</context-root>
        </web>
      </module>
      <module>
        <ejb>ejb-jar-ic.jar</ejb>
      </module>
    <!--
      <module>
        <java>app-client-ic.jar</java>
      </module>
    -->
    </application>
    And this is the deployment for the ejb class files:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
      <display-name>MusicEJB</display-name>
      <enterprise-beans>
        <session>
          <display-name>MusicEJB</display-name>
          <ejb-name>MusicEJB</ejb-name>
          <home>asg.MusicEJB.MusicHome</home>
          <remote>asg.MusicEJB.Music</remote>
          <ejb-class>asg.MusicEJB.MusicBean</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Bean</transaction-type>
          <env-entry>
            <env-entry-name>MusicDAOClass</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>asg.MusicEJB.MusicDAOCloudscape</env-entry-value>
          </env-entry>
         <env-entry>
         <env-entry-name>dbUrl</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>jdbc:mysql://localhost/music</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>dbUserName</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>chongming</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>dbPassword</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>kcm82</env-entry-value>
         </env-entry>
          <security-identity>
            <description></description>
            <use-caller-identity></use-caller-identity>
          </security-identity>
        </session>
      </enterprise-beans>
    </ejb-jar>I can combine the jar and war files into a ear file. deploying is alright without any errors.
    However when i run the jsp, it prompt this error:
    You Have Encountered an Error
    Stack Trace
    java.lang.NullPointerException
         at org.apache.jsp.musicGet_jsp._jspService(org.apache.jsp.musicGet_jsp:111)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    How to i solve the error? I look at he catch results in the command prompt of JBoss , i found that when running, the code will be caught by the exception and display this:int.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
    kerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    13:55:21,375 INFO [STDOUT] Unexpected Exception............: EJBException:; nes
    ted exception is:
    javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
    The url cannot be null
    13:55:21,375 INFO [STDOUT] java.rmi.ServerException: EJBException:; nested exce
    ption is:
    javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
    The url cannot be null 13:55:21,375 INFO[STDOUT] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
    13:55:21,375 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
    What can i do to solve the problem? please helpMessage was edited by:
    chongming
    Message was edited by:
    chongming
    Message was edited by:
    chongming

  • Error Catching Exceptions on EJB Clients

    I'm trying to throw an owm exception from an EJB Session to my EJB
    client. I can catch the exception but when i use the getMessage()
    method the String I receive is not the message I used to create the
    exception. The result of the getMessage() call is the same that them
    call to printStackTrace().
    does anybody knows if weblogic in change the message of the
    exception for the printStackTrace before throws the exception to the
    client?
    Thanks.

    David,
    Refer to the following link for best practices concerning EJB exception handling:
    http://dev2dev.bea.com/articles/Rong.jsp
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Cata" <[email protected]> wrote:
    >
    I'm trying to throw an owm exception from an EJB Session to my EJB
    client. I can catch the exception but when i use the getMessage()
    method the String I receive is not the message I used to create the
    exception. The result of the getMessage() call is the same that them
    call to printStackTrace().
    does anybody knows if weblogic in change the message of the
    exception for the printStackTrace before throws the exception to the
    client?
    Thanks.

  • Need help ASAP : Exception with EJB 3.0 while session.xml

    Hi,
    Kindly help on below exception, which i am getting the exception while changing the mine EJB 2.1 to 3.0.
    Exception raised while loading the session.xml, which is reffering to map file which is used by Toplink.
    **Mine EJB:**
    public class CaseSessionEJBBean implements CaseSessionEJB {
    String inBean="[CaseSessionEJBBean] ";
    private SessionFactory sessionFactory;
    public CaseSessionEJBBean() {
    this.sessionFactory =new SessionFactory("META-INF/sessions.xml", "moj");
    *private SessionFactory getSessionFactory() {*
    return this.sessionFactory;
    *}* public PagedResultList<CasedetailsDTO> searchPayment(SearchCriteriaDTO searchCriteriaDTO,Integer startIndex,Integer endIndex) throws MOJException{
    String inMethod="[searchPayment] ";
    PagedResultList pagedCaseDetailsDTOList=null;
    try{
    System.out.println("[CaseSessionEJBBean] !!!! ENTERED !!!!!");
    Session session = getSessionFactory().acquireSession();
    CaseFacade caseFacade = new CaseFacade();
    pagedCaseDetailsDTOList=caseFacade.searchPayment(session, searchCriteriaDTO,startIndex,endIndex);
    System.out.println("pagedCaseDetailsDTOList.size()="+pagedCaseDetailsDTOList.size());
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("[Exception] While getting payment details:"+e);
    throw new MOJException("1001", e.getMessage(),
    "Exception occured",
    "Exception in searchPayment()",
    "searchPayment", "CaseSessionEJBBean",
    "searchPayment", e);
    return pagedCaseDetailsDTOList;
    Exception:
    Exception Description: Several [1] SessionLoaderExceptions were thrown:
    Exception [TOPLINK-9005] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.SessionLoaderException
    Exception Description: *An exception was thrown while loading the <project-xml> file [META-INF/MOJMap.xml].*
    Internal Exception: oracle.classloader.util.AnnotatedLinkageError: duplicate class definition: oracle/toplink/indirection/IndirectList
    Invalid class: oracle.toplink.indirection.IndirectList
    Loader: current-workspace-app.root:0.0.0
    Code-Source: /D:/MOJ_SVN/Lib/toplink.jar
    Configuration: <library> in /D:/Temp/MOJ_EJB_3.0/CMS-oc4j-app.xml
    Dependent class: oracle.toplink.internal.helper.ConversionManager
    Loader: oracle.toplink:10.1.3
    Code-Source: /D:/jdevstudio/toplink/jlib/toplink.jar
    Configuration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in D:\jdevstudio\j2ee\home\oc4j.jar
    The original class instance was also defined in oracle.toplink:10.1.3.
    Thanks in Advance:
    Need in urgent
    Edited by: user636100 on Feb 6, 2009 7:44 AM

    You have two copies of toplink.jar visible to the application classloader - D:/MOJ_SVN/Lib/toplink.jar should be removed.
    For compilation of the application use toplink.jar provided by the server: D:/jdevstudio/toplink/jlib/toplink.jar

  • How to call jsp/ejb in webdynpro applications

    Hi
    Is It Possible to call jsp and EJB in webdynpro applications.If it is please let me know..
    Regards
    Chandra

    Hi,
    You can call JSp and serlvets using suspend and resume plugs
    /people/bertram.ganz/blog/2006/07/03/web-dynpro-java-foundation--whats-new-in-sap-netweaver-2004s
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/bb8c6cc7131d67e10000000a1553f6/frameset.htm
    For EJbs you can create a DTO and try to make use of the model import available in Webdynpro.
    Regards
    Ayyapparaj

  • JAVA Proxy :: Exception in ejb-jar.xml in NWDS

    Hi All
    I am getting exception while Importing (Inbound) JAVA Proxy ZIP file in NWDS, ejb-jar.xml shows the red cross & when I double click on it got following error -->
    The content of element type "ejb-jar" is incomplete, it must match "(description?,display-name?,small-icon?,large-icon?,enterprise-beans,relationships?,assembly-descriptor?,ejb-client-jar?)".
    I already add the following JAR files in class-path -->
    aii_proxy_xirt.jar
    aii_msg_runtime.jar
    aii_utilxi_misc.jar
    guidgenerator.jar
    One different thing I also notice is that after adding these JAR files in classpath I am not getting my Inbound Interface BEAN under EJB candidates.
    Also nothing is visible under ejbModule usually it shows 4 JAVA files & one template file.
    As a solution I tried searching in google & forum for above exception, most threads suggest to add the Beans to xml files but I am not getting my interface Bean under EJB candidates.
    I also tried reloading all the external JAR files again from System but still same issue.
    Also within the same NWDS one another version of EJB is working fine but I worked on it 6months back, I tried copy its contents to ejb-jar.xml source code but then also nothing happens.
    I am using NWDS Version: 7.0.10
    Can you pls. suggest & let me know what further information I can provide from my side which can help you to investigate it.
    Regards
    Lalit

    hi,
    Your are using server java proxy.
    You can use some other jar files apart from what you are using,.
    ejb20.jar
    exception.jar
    sapj2eeclient.jar
    and after importing your zip file (create a ejb project first ,then add the zar files and then click on the ejbModule and then import your zip file ) close and open your project.
    Do not directly click on ejb-jar.xml.Click on ejbModule and import the .zip file.
    then save your .template file in ejbModule as a .java project.
    then there should not be any error.
    you can refer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06315a6-e66e-2910-039c-ba8bbbd23702
    regards,
    ujjwal kumar

  • Class cast exception in Ejb Look up

    Hi friends,
    Deploying one ejb with JBoss_4_2_2_GA and deploying well.
    But while trying to look up it getting some exception like
    java.lang.ClassCastException: $Proxy78 cannot be cast to stateless.CalculatorRemote
    please help to identify
    here is code
    Remote
    package stateless;
    import java.math.*;
    import javax.ejb.Remote;
    import java.lang.annotation.*;
    @Remote
    public interface CalculatorRemote {
    public float add(float x, float y);
    public float subtract(float x, float y);
    public float multiply(float x, float y);
    public float division(float x, float y);
    and stateless bean
    package stateless;
    import java.math.*;
    import javax.ejb.Stateless;
    import javax.ejb.Remote; 
    @Stateless(name="CalculatorBean")
    @Remote(CalculatorRemote.class) 
    public class CalculatorBean implements CalculatorRemote{
         public float add(float x, float y){     
              return x + y;
       public float subtract(float x, float y){
          return x - y;
        public float multiply(float x, float y){
          return x * y;
       public float division(float x, float y){
            return x / y;
    and lookup code
    public void jspInit() {
            try {
                InitialContext ic = new InitialContext();
                   calculator = (CalculatorRemote) ic.lookup("example/CalculatorBean/remote");
                   System.out.println("Loaded Calculator Bean");
            } catch (Exception ex) {
               e.printStackTrace ();
        }

    hi i have gone through JNDI and
    while calling look up from standard alone application, it will work fine
              InitialContext ctx = null;
              Hashtable<String, String> props = new Hashtable<String, String>();
              props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
              props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
              props.put("java.naming.provider.url", "jnp://localhost:1099");
              try {
                   ctx = new InitialContext(props);
                   CalculatorRemote calc = (CalculatorRemote) ctx.lookup("CalculatorBean/remote");
                   System.out.println( "addition   ==   " + calc .add( 10, 20  ));
              } catch (NamingException e) {
                   e.printStackTrace();
         when i am try to look up it from servlet following way but getting save error.
    i have used following way
    1. InitialContext ic = new InitialContext();
    Object obj = ic.lookup( "CalculatorBean/remote" );
    CalculatorRemote calc= ( CalculatorRemote )PortableRemoteObject.narrow ( obj, CalculatorRemote .class );
    it getting following error
    java.lang.ClassCastException
    at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
    Caused by: java.lang.ClassCastException: $Proxy73 cannot be cast to org.omg.CORBA.Object
    at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
    2. calculator = (CalculatorRemote) ic.lookup("CalculatorBean/remote");
    java.lang.ClassCastException: $Proxy73 cannot be cast to forums.business.ForumManager
    at forums.web.ForumServlet.init(ForumServlet.java:36)

  • ClassNotFound Exception accessing EJBs in a cluster

    I am experiencing some weird behavior when attempting to access EJBs in a
              Weblogic 5.1.0 cluster. The cluster nodes startup fine, and the EJBs are
              correctly deployed. However, when my test client attempts to access them I
              get the ClassNotFoundException listed below. This same client can access the
              same EJBs deployed in a non-clustered environment without any problems, so
              it's definitely related to my cluster configuration. The problem seems to be
              that the client is not receiving the client-side stub. To confim this, I put
              the stub in the client's classpath, and did NOT get the
              ClassNotFoundException. Has anyone else seen this error?
              BTW, I have compiled the EJB both with and without the <home-is-clusterable>
              flag set to true. I get the same exception either way.
              Thanks for any assistance,
              Jason Donnell
              javax.naming.CommunicationException. Root exception is
              java.lang.ClassNotFoundException: class
              com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              previously not found
              at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:184)
              at weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
              at weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
              at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:700)
              at
              weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
              a:34)
              at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
              at weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
              at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
              at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:247)
              at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              --------------- nested within: ------------------
              weblogic.rmi.UnmarshalException: Unmarshalling return
              - with nested exception:
              [java.lang.ClassNotFoundException: class
              com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              previously not found]
              at
              weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
              a:256)
              at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
              at javax.naming.InitialContext.lookup(InitialContext.java:350)
              at
              com.landacorp.maxmc.ejb.security.ClusterSecurityTest.main(ClusterSecurityTes
              t.java:52)
              

    Just a side note: I setup the cluster using the WebLogic recommended
              directory structure (see
              http://www.weblogic.com/docs51/cluster/setup.html#676105) and I no longer
              get the exception. I'm still interested in hearing, though, if anyone has a
              scheme for setting up the cluster in a directory that isn't directly under
              the weblogic installation directory.
              Jason
              "Jason Donnell" <[email protected]> wrote in message
              news:[email protected]...
              > My current idea is that our directory structure is not properly supported
              by
              > WebLogic. We are NOT putting everything under the weblogic install
              > directory, as the documentation suggests. Instead, it looks something like
              > this (on an NT box):
              >
              > \weblogic_install\<Weblogic 5.1.0 installation here>
              >
              > \our_weblogic\startWeblogicNode1.cmd
              > \our_weblogic\startWeblogicNode2.cmd
              > \our_weblogic\weblogic.properties (cluster-wide)
              > \our_weblogic\public_html\
              > \our_weblogic\our_cluster_name\
              > \our_weblogic\our_cluster_name\all_ejbs\<compiled beans are here>
              > \our_weblogic\our_cluster_name\server_node1\
              > \our_weblogic\our_cluster_name\server_node1\weblogic.properties
              > (server-specific)
              > \our_weblogic\our_cluster_name\server_node2\
              > \our_weblogic\our_cluster_name\server_node2\weblogic.properties
              > (server-specific)
              >
              > So, on the command line in our per-server startup scripts, we set the
              > weblogic.system.home=\our_weblogic,
              weblogic.cluster.name=our_cluster_name,
              > and weblogic.system.name=server_nodeX.
              >
              > Now, I want to emphasize that the server claims to start up just fine. It
              > claims the EJBs have been deployed. However, it is unable to deliver
              classes
              > dynamically, as we found by trying the
              > http://yourweblogic..../classes/some/class/name.class suggestion noted
              > previously.
              >
              > We had a similar directory structure for a single server, and it worked
              just
              > fine. However, in that case we obviously did not have the extra level of
              the
              > \our_cluster_name\ directory. It would seem that in the cluster
              > configuration, we cannot do it this way. I would be VERY interested to
              hear
              > if anyone else has setup a cluster in a directory that is not under the
              > weblogic installation directory.
              >
              > Hopefully this may shed some light on your problem. Feel free to contact
              me
              > if you need any additional information (or if you solve the problem!).
              >
              > Jason Donnell
              > [email protected]
              >
              >
              > "Chad" <[email protected]> wrote in message
              > news:[email protected]...
              > > I am very interested in this thread - I am having the same behavior:
              > >
              > > javax.naming.CommunicationException. Root exception is
              > > java.lang.ClassNotFoundException: class
              > > healthecare.drug.ejb.DrugAlternateBeanHomeImpl_ServiceStub previously
              > > not found
              > > at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:181)
              > > at
              > weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
              > > at
              weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
              > > at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:630)
              > > at
              >
              weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
              > a:34)
              > > at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
              > > at weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
              > > at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
              > > at
              > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:247)
              > > at
              > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
              > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
              > >
              > > --------------- nested within: ------------------
              > > weblogic.rmi.UnmarshalException: Unmarshalling return
              > > - with nested exception:
              > > [java.lang.ClassNotFoundException: class
              > > healthecare.drug.ejb.DrugAlternateBeanHomeImpl_ServiceStub previously
              > > not found]
              > > at
              >
              weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
              > a:256)
              > > at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
              > > at javax.naming.InitialContext.lookup(InitialContext.java:350)
              > > at healthecare.util.EJBBase.findHomeInterface(EJBBase.java:178)
              > >
              > > One additional bit of information that I can add is that when I
              > > getInitialContext() like this:
              > >
              > > public static Context getInitialContext() throws Exception
              > > {
              > > String providerURL =
              > > "t3://" + CommonUtil.getProperty("ejb.server.name") +
              > > ":" + CommonUtil.getProperty("ejb.server.port");
              > >
              > > Hashtable ht = new Hashtable();
              > > ht.put(Context.INITIAL_CONTEXT_FACTORY,
              > > "weblogic.jndi.WLInitialContextFactory");
              > > ht.put(Context.PROVIDER_URL, providerURL);
              > >
              > > return new InitialContext(ht);
              > > }
              > >
              > > When the "ejb.server.name" property is one server, like "serverName1",
              > > the code works. But when the "ejb.server.name" property is clustered,
              > > like "serverName1, serverName2", the code throws the exception above.
              > >
              > > I'll definitely re-post if I come up with anything.
              > >
              > > thanks,
              > > chad small
              > >
              > > "Jason Donnell" <[email protected]> wrote in message
              > news:<[email protected]>...
              > > > Well, that was a good test. I discovered I am unable to download
              classes
              > > > from the clustered server when pointing my browser at it. Any ideas
              what
              > > > kind of misconfiguration on my part would cause that behavior?
              > > >
              > > > Thanks,
              > > > Jason Donnell
              > > >
              > > > "Dimitri Rakitine" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > Try to point your browser to make sure you can actually download
              > classes
              > > > from it
              > > > > (point it to http://yourweblogic..../classes/some/class/name.class)
              > > > >
              > > > > Jason Donnell <[email protected]> wrote:
              > > > > > Yes, I know. That's the behavior that I had always seen before. Do
              > you
              > > > know
              > > > > > of any directory configurations or properties file settings that
              > could
              > > > make
              > > > > > the stub not be downloaded correctly, even though the EJB is
              > deployed on
              > > > the
              > > > > > server?
              > > >
              > > > > > "Tao Xie" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > >> That's weird, Replica-aware stub should be downloaded to the
              client
              > > > except
              > > > > >> the client is on another Weblogic server.
              > > > > >>
              > > > > >> "Jason Donnell" <[email protected]> wrote in message
              > > > > >> news:[email protected]...
              > > > > >> | I am experiencing some weird behavior when attempting to access
              > EJBs
              > > > in
              > > > a
              > > > > >> | Weblogic 5.1.0 cluster. The cluster nodes startup fine, and the
              > EJBs
              > > > are
              > > > > >> | correctly deployed. However, when my test client attempts to
              > access
              > > > them
              > > > I
              > > > > >> | get the ClassNotFoundException listed below. This same client
              can
              > > > access
              > > > the
              > > > > >> | same EJBs deployed in a non-clustered environment without any
              > > > problems,
              > > > so
              > > > > >> | it's definitely related to my cluster configuration. The
              problem
              > > > seems
              > > > to
              > > > be
              > > > > >> | that the client is not receiving the client-side stub. To
              confim
              > > > this, I
              > > > put
              > > > > >> | the stub in the client's classpath, and did NOT get the
              > > > > >> | ClassNotFoundException. Has anyone else seen this error?
              > > > > >> |
              > > > > >> | BTW, I have compiled the EJB both with and without the
              > > > <home-is-clusterable>
              > > > > >> | flag set to true. I get the same exception either way.
              > > > > >> |
              > > > > >> | Thanks for any assistance,
              > > > > >> | Jason Donnell
              > > > > >> |
              > > > > >> |
              > > > > >> | javax.naming.CommunicationException. Root exception is
              > > > > >> | java.lang.ClassNotFoundException: class
              > > > > >> |
              > > > > >
              > > >
              > com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              > > > > >> | previously not found
              > > > > >> |
              > > > > >> | at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:184)
              > > > > >> |
              > > > > >> | at
              > > > > >>
              > > >
              > weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
              > > > > >> |
              > > > > >> | at
              > > >
              weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
              > > > > >> |
              > > > > >> | at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:700)
              > > > > >> |
              > > > > >> | at
              > > > > >> |
              > > > > >>
              > > > > >
              > > >
              >
              weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
              > > > > >> | a:34)
              > > > > >> |
              > > > > >> | at
              > > > weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
              > > > > >> |
              > > > > >> | at
              > > > weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
              > > > > >> |
              > > > > >> | at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
              > > > > >> |
              > > > > >> | at
              > > > > >>
              > > >
              > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:247)
              > > > > >> |
              > > > > >> | at
              > > > > >>
              > > >
              > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
              > > > > >> |
              > > > > >> | at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              > > > > >> |
              > > > > >> |
              > > > > >> |
              > > > > >> | --------------- nested within: ------------------
              > > > > >> |
              > > > > >> | weblogic.rmi.UnmarshalException: Unmarshalling return
              > > > > >> | - with nested exception:
              > > > > >> | [java.lang.ClassNotFoundException: class
              > > > > >> |
              > > > > >
              > > >
              > com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              > > > > >> | previously not found]
              > > > > >> |
              > > > > >> | at
              > > > > >> |
              > > > > >>
              > > > > >
              > > >
              >
              weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
              > > > > >> | a:256)
              > > > > >> |
              > > > > >> | at
              > > > weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
              > > > > >> |
              > > > > >> | at javax.naming.InitialContext.lookup(InitialContext.java:350)
              > > > > >> |
              > > > > >> | at
              > > > > >> |
              > > > > >>
              > > > > >
              > > >
              >
              com.landacorp.maxmc.ejb.security.ClusterSecurityTest.main(ClusterSecurityTes
              > > > > >> | t.java:52)
              > > > > >> |
              > > > > >> |
              > > > > >> |
              > > > > >> |
              > > > > >>
              > > > > >>
              > > > >
              > > > >
              > > > >
              > > > > --
              > > > > Dimitri
              >
              >
              >
              >
              >
              >
              

  • Servlet, JSP, EJB

    Hi!
    I have some general questions about jsp and servlets. I develop an internetbased portfoliosystem which uses ejb to extract data from an oracle database.
    q1: How can I create a controlling servlet for page direction?
    q2: How can my jsp file connect to my ejb (session bean)? Can I do it directly or must I go through an AccessBean? (if accessbean, how do I do that?)
    Sincirely,
    Nicolai
    Answers/examples may also be sent to: [email protected]

    1 For a controller servlet you can use a servlet controller model, ie the presentation logic is in the JSP pages , which submits request to the servlet which does appropriate processing and then redirects the flow to another JSP.
    2. Your JSP file can connect to EJBs directly through the remote handle of the bean obtained by JNDI lookups. However the JSP gets cluttered with the JNDI lookup codes.If the HTML programmer is different from Java programmer then go for accessor beans.

  • JSP/EJB compilation:  don't put .java files in EJB jars!

    I was having trouble compiling a JSP that uses an EJB remote interface.
              The Weblogic console printed an error like this:
              Thu Aug 31 14:13:58 PDT 2000:<E> <ServletContext-General> Compilation of
              D:\weblogic\myserver\classfiles\jsp_servlet\_hl
              og.java failed:
              D:\weblogic\myserver\tmp_deployments\ejbjar-6787.jar(hlog/ejb/LogEntry.java):5:
              class LogEntry
              is public, should be declared in a file named LogEntry.java
              (source unavailable)
              1 error
              The fix was not to include source files in my EJB jar. Before I was
              using a simple jar command:
              >jar -cf hlog.jar hlog META-INF
              Which of course included both class and source files in the jar (I
              didn't see the harm in this).
              I changed to:
              >jar -cf hlog.jar hlog\ejb\*.class META-INF
              and the problem went away.
              Thought this might save y'all some time and grief...
              John
              

    In the previous message: "I'd putt String as the return value for all methods"...
    all methods = doInserir, doAlterar and doRemover.
        public String doInserir() {
            this.produtoRemote.inserir(this.produto);
            return "sucesso";
        public String doAlterar() {
            this.produtoRemote.alterar(this.produto);
            return "sucesso";
        public String doRemover() {
            this.produtoRemote.remover(this.produto);
            return "sucesso";
        }Just to clarify.
    Thanks!

Maybe you are looking for

  • Device not working after updating from 8 to 8.1: SMK Ehome Infrared Transceiver and remote control (usb)

    Hi all, An excellent 2015 to you all.  I wonder whether it's possible to get my (USB) SMK Ehome Infrared transceiver (which serves to connect my PC to a remote control)  to work again. It functioned okay under Windows 8, but when I upgraded my system

  • WCM Error while saving Project

    Hi, I am getting following error while saving new created project in cProject. Saving is not possible because the WFM Core data could not be adjusted Message no. PRP086 Diagnosis When checking the project role or project role staffing, differences to

  • Re: How to change the NLS_NCHAR_CHARACTERSET from WE8ISO8859P1 to AL16UTF16 ?

    Hi, Now I have a new problem. I have a Oracle9i instance, with this configurations. PARAMETER VALUE NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET WE8MSWIN1252 NLS_CALEND

  • Scenario Step Design in (Read Only) mode

    Hello, Would anyone know how to change the setting so that we can modify steps of packages, as at the moment it's not allowing us to modify any step of any package. We can see that it states the Scenario Step Design (Read Only) at the very top of the

  • IPod Mini power up problem

    If I press and hold the play/pause button for a couple of seconds to manually turn my mini off, it will turn back on at the touch of click wheel, but only for a short period of time. If I leave it off for awhile (>30 min. or so) I cannot get it to tu