Java class calling ejb

hi,
i need to write a class file that calls an ejb. i found out that i need to include the context and also the object reference. but i still cant get it to call the ejb. does the class file need to be in the same folder as the ejbs?
thanks

this is my code
          Context initial = new InitialContext();
          Object obj = initial.lookup("WFBean");
          WF_RemoteHome home =     (WF_RemoteHome)PortableRemoteObject.narrow(obj,WF_RemoteHome.class);
               WF_Remote wf = home.create();
               int check = wf.getInfo("something");
               if(check==0){
                    System.out.print("YES");
               }else{
                    System.out.print("NO");
               }however when i run it, it gives me this error
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
     java.rmi.RemoteException
     at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:188)
     at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:172)
     at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
     at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
     at com.WF_Remote_DynamicStub.getInfo(WF_Remote_DynamicStub.java)
     at watcher.extBean(watcher.java:100)
     at watcher.main(watcher.java:59)
Caused by: java.rmi.RemoteException
     at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:234)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1280)
     at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
     at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:107)
     at $Proxy552.getnfo(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
     at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
     at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
     at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
     at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
     at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
     at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
     at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)RemoteException occurred in server thread; nested exception is:
     java.rmi.RemoteException
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
     at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)how do i solve this? what i want to archieve is to be able to call the ejb which is in my local application server from my java class file so that i can make the class file run as a service.
thanks

Similar Messages

  • Debug java class called from CF?

    I'm experiencing different behaviour with a Java class called from a CF page to the same class called directly from Java code.
    Is it possible for me to step into the Java class and debug it in CF builder if I attach the correct Java source?
    Pressing F5 (step-in) on the line that the method is called just skips straight over.
    Regards,
    Andy

    P5music wrote:
    I would like to be able to make a java application that has a GUI that is a rich web page.That's what applets are for.
    In this case, this page exists on my system and I can open it with my browser.
    This page does many things that are typical of a web page like displaying information and presenting rich and graphical controls
    but some of this controls are connected to a java application, launched from the web page or viceversa.I don't get this "launched from the web page" business. Is that a requirement or are you describing an existing system? Or are you describing somebody else's system whose architecture you want to imitate? Or are you using the word "launched" simply to describe the action of starting an applet?
    It still isn't clear to me what you are trying to describe. But at any rate if you want a Java program to run in your browser, that's an applet. Note that applets can interact with Javascript code in the page they are embedded in. Or if you want to download a Java application which acts as a separate application, i.e. it still runs when the browser is closed, you can use Web Start for that.

  • Custom Java class called from RTF template generates error

    We are running a report in BI Publisher and the report calls a custom developed Java class that is used to bind PDFs together and sent the result to another application.
    On the RTF template we have some XSLT that reads the input XML and sets a variable which is then passed to the Java class. We are however getting the following error when the report is called simultaneously 2 or more times:
    XML-22044: (Error) Extension function error: Error invoking 'JavaClassName': 'java.lang.Error: Cannot interweave overlay template with pdf input, combined number of pages is odd!
    I read this as the real cause of the error is the Java code but I'm not 100% sure. Also I don't understand what the error message means.
    Could someone help out please?
    Many thanks

    Since our this requirement is in Quotes module, its not using OAF. It is using plain JSPs and java classes.
    What i was thinking is, create the Option values as flex fields, and write a custom java class to fetch these data from the flex tables and use it in the JSP.
    The main problem we are facing now is,
    "...we wrote a simple java class, which establishes database connection, executes a simple insert & select query to our custom table. compiled & placed the class file under our new pkg structure under $JAVA_TOP eg. oracle.apps.xxx.quot.tmpl , bounced the apache."
    But when we tried to import this class in the jsp (which is being customized), the app just throwed Internal Server Error and we couldnt find any info in the Log file.
    Couldnt guess, why is this simple thing failing. Any idea ?

  • Java class call from form

    Hi
    I'm doing single sign on via cookie and I able to get the cookie value and for decrypting I loaded java classes on the back end, When I called via form the jvm is crashing with some frm-92101 error.
    First I want if anybody can help if I have to run any packages to execute java class from forms, I already created pl/sql wrapper class.
    When I execute the function on the backend and got the decrypted value via pl/sql wrapper package but from forms the web servver is crashing, Can any body help.
    Also where do I see the log file location.
    Thanks in advance for the pro's for helping me
    Thanks
    Murthy

    Dump from the application file.
    08/06/23 14:21:58 formsweb: Forms session <10> exception stack trace:
    java.io.IOException: FRM-93000: Unexpected internal error.
    Details : No HTTP headers received from runform
         at oracle.forms.servlet.ListenerServlet.forwardResponseFromRunform(Unknown Source)
         at oracle.forms.servlet.ListenerServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    08/06/23 14:52:17 formsweb: Forms session <11> aborted: unable to communicate with runtime process.
    08/06/23 14:52:17 formsweb: Forms session <11> exception stack trace:
    java.io.IOException: FRM-93000: Unexpected internal error.
    Details : No HTTP headers received from runform
         at oracle.forms.servlet.ListenerServlet.forwardResponseFromRunform(Unknown Source)
         at oracle.forms.servlet.ListenerServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    08/06/23 15:03:21 formsweb: Forms session <12> aborted: unable to communicate with runtime process.
    08/06/23 15:03:21 formsweb: Forms session <12> exception stack trace:
    java.io.IOException: FRM-93000: Unexpected internal error.
    Details : No HTTP headers received from runform
         at oracle.forms.servlet.ListenerServlet.forwardResponseFromRunform(Unknown Source)
         at oracle.forms.servlet.ListenerServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    08/06/23 15:08:21 formsweb: lservlet: destroy
    08/06/23 15:08:21 formsweb: Stopped
    08/06/23 15:08:21 Stopped (Shutdown executed by jazn.com/admin from 127.0.0.1 (localhost))

  • Java class call from Stored Proc or trigger

    Hi Experts!
    I have windows 2K server with Oracle 8i Enterprise Edition installed. Please let me know if I can call a java class from Stored Procedure or Trigger. If there is a way, then help me out with code sample or description.
    Regards,
    Atul
    [email protected]

    Atul,
    Couple of questions to you, off the subject,
    * Why NULL NULL registration?(You already revealed your name at the bottom)
    * Why email at the bottom? This is already a discussion forum.
    To your qn, it is very much possible. It is not something that one can explain in a single thread. It takes your machine setup for JVM, your knowledgebase on JAVA and other things. Please find notes on External Procedure Calls, which should give you a start. If you are running into problems, please come back with specifics.
    Thx,
    SriDHAR

  • Standard B2C application Order page Java class called on Update?

    Hi All,
    On the Standard B2C application, on adding CampaignKey to the order or Changing the Quantity of the Items. We click UPDATE to update the sales order.
    Please can anyone help to find out which JAVA action Class is linked with the Update button.
    I need to create one Z java action class to update the order.
    Thanks a lot!
    Ekta

    Hi
    I used session logging to trace the class called. I am not able to use HTTP Watch. It is on the Client's network using Citrix. Hence cannot install it. but no doubt that is a better way.
    Classes and the action path is
    main java action class 
    MaintainBasketB2CDispatcherAction"
    linked action path for Update is
    Action path="/b2c/maintainBasket"
    Forward path name   
    <forward name="update" path="/b2c/basketupdate.do"/>
    and for action path
    action path="/b2c/basketupdate"
    java action class :
    MaintainBasketB2CUpdateAction"
    I am making Z action claa for MaintainBasketB2CUpdateAction" and i am updating the condig.xml file.
    I am making this thread open. To trace the flow if in case i get some problem
    Thanks to all of you for your support!
    Thanks
    Ekta

  • Access a normal java class from EJB

    how can i access normal java class from an EJB.
    I do not want to write the business logic inside the EJB. How can I achieve this.

    There's no special API for doing this. Just use normal java. E.g.
    @Stateless
    public class FooBean implements Foo {
    public void foo() {
    // access non-EJB utility class Bar
    Bar b = new Bar();
    b.bar();
    }

  • Java Class calling another class?

    i have a class called infix and a separate class called postfix. what i am trying to do is make the infix class create a string of postfix notation and then call the postfix class to do the computation.
    i have the string all ready to be passed to the postfix class for computation..my question is...how do i get it to that class?

    HERE ARE THE TWO CLASSES. THE POSTFIX WORKS FOR SURE AND I AM TRYING TO GET THE INFIX TO WORK. THE QUESTION IS IN THE RETURN OF THE INFIX. DONT TRY TO CORRECT THE INFIX CODE. I AM WORKING ON THAT BY MYSELF. I JUST NEED HELP ON CONNECTING THEM IF POSSIBLE. CHECK THE RETURN OF INFIX. THANKS ALOT
    import java.util.*;
    public class PostFix
         private Set<String> ops = new HashSet<String>();
         private List<String> lst = new LinkedList<String>();
         private static Map<String, String> m = new HashMap<String, String>();
         public List<String> getLst()
              return lst;
         public Map<String, String> getMap()
              return m;
         public PostFix( String s )
              ops.add("+");
              ops.add("-");
              ops.add("*");
              ops.add("/");
              ops.add("%");
              StringTokenizer sTok = new StringTokenizer(s);
              while( sTok.hasMoreTokens() )
                   lst.add( sTok.nextToken() );
              m.put( "a" , "26" );
              m.put( "b" , "25" );
              m.put( "c" , "24" );
              m.put( "d" , "23" );
              m.put( "e" , "22" );
              m.put( "f" , "21" );
              m.put( "g" , "20" );
              m.put( "h" , "19" );
              m.put( "i" , "18" );
              m.put( "j" , "17" );
              m.put( "k" , "16" );
              m.put( "l" , "15" );
              m.put( "m" , "14" );
              m.put( "n" , "13" );
              m.put( "o" , "12" );
              m.put( "p" , "11" );
              m.put( "q" , "10" );
              m.put( "r" , "9" );
              m.put( "s" , "8" );
              m.put( "t" , "7" );
              m.put( "u" , "6" );
              m.put( "v" , "5" );
              m.put( "w" , "4" );
              m.put( "x" , "3" );
              m.put( "y" , "2" );
              m.put( "z" , "1" );
         public int Value()
              Stack<Integer>operandStack = new Stack<Integer>();
              Iterator<String> iterator = lst.iterator();
              String tmp;
              int val1 = 0;
              int val2 = 0;
              int tmpInt = 0;
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( !ops.contains( tmp ) )
                        operandStack.push(Integer.parseInt(tmp));
                   else
                        val1 = operandStack.pop();
                        val2 = operandStack.pop();     
                        Character c = new Character( tmp.charAt(0) );
                        switch( c )
                             case '+':
                                  operandStack.push(val1 + val2);
                                  break;
                             case '-':
                                  operandStack.push(val2 - val1);
                                  break;
                             case '*':
                                  operandStack.push(val1 * val2);
                                  break;
                             case '/':
                                  operandStack.push(val2 / val1);
                                  break;
                             case '%':
                                  operandStack.push(val2 % val1);
                                  break;
              return operandStack.peek();
         public int Value( Map m )
              Stack<Integer> operandStack = new Stack<Integer>();
              Iterator<String> iterator = lst.iterator();
              String tmp;
              String x;
              int val1 = 0;
              int val2 = 0;
              int tmpInt = 0;
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( !ops.contains( tmp ) && !m.containsKey( tmp )  )
                        operandStack.push(Integer.parseInt(tmp));
                   else if ( !ops.contains(tmp) && m.containsKey(tmp) )
                        x = m.get(tmp).toString();
                        operandStack.push(Integer.parseInt(x));
                   else{          
                        val1 = operandStack.pop();
                        val2 = operandStack.pop();     
                        Character c = new Character( tmp.charAt(0) );
                        switch( c )
                             case '+':
                                  operandStack.push(val1 + val2);
                                  break;
                             case '-':
                                  operandStack.push(val2 - val1);
                                  break;
                             case '*':
                                  operandStack.push(val1 * val2);
                                  break;
                             case '/':
                                  operandStack.push(val2 / val1);
                                  break;
                             case '%':
                                  operandStack.push(val2 % val1);
                                  break;
              return operandStack.peek();
         and the infix is
    import java.util.*;
    public class InFix
         PostFix pFix;
         private Set<String> LowOps = new HashSet<String>();
         //private Set<String> parenthesis = new HashSet<String>();
         private Set<String> HighOps = new HashSet<String>();
         private List<String> lst = new LinkedList<String>();
         public List<String> getLst()
              return lst;
         public InFix( String s )
              LowOps.add("+");
              LowOps.add("-");
              HighOps.add("*");
              HighOps.add("/");
              //ops.add("%");
              StringTokenizer sTok = new StringTokenizer(s);
              while( sTok.hasMoreTokens() )
                   lst.add( sTok.nextToken() );
         public int Value()
              Stack <String> operatorStack = new Stack<String>();
              Iterator<String> iterator = lst.iterator();
              String tmp = "";
              String pFixStr = "";
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( tmp == "(" )
                        operatorStack.push(tmp);
                   else if( tmp == ")" )
                        String peektmp = operatorStack.peek();
                        while( peektmp != "(" )
                             pFixStr.concat(operatorStack.pop() );
                   else if( !LowOps.contains(tmp) && !HighOps.contains(tmp) )//pushes if its a number
                        pFixStr.concat( tmp );
                   else if( LowOps.contains( tmp ) )
                        operatorStack.push(tmp);
                   else if( HighOps.contains( tmp ) )
                        operatorStack.push(tmp);
              while ( !operatorStack.empty() )
                   pFixStr.concat(operatorStack.pop());
              System.out.println( pFixStr );
         return <THIS IS WHERE I WANT TO RETURN THE COMPUTATION FROM THE POSTFIX CLASS. IS THIS CORRECT TO TRY AND RETURN A POSTFIX(PFIXSTR) OR SOMETHING LIKE THAT>     
         }THANKS

  • Accessing Java Class using JNDI

    Hi,
    I am looking for a way for accessing a java class (non-ejb) and invoking a method in it using JNDI.
    Thanks

    See if the follwing helps u
    1).implement Referencable interface for your java class. Implement serialize interface also.
    2).Referencable interface has a methd referencable() which will be invoked by JNDI naming system when a lookup is made by client.
    3) in referencable method create a Refrence object.(Reference is a api class).This Reference object can be created to contain a lot of info about the remote obj u have registered. In that u can say the class that be used to create your client side stub.
    4).now when client does a lookup, jndi creates a stub using Reference object and sends it to client.
    5)the methods now u call gets passed on to actual machine running ur remote object

  • Add java classes as Additional Classes to web service and JAXB 2.0 usage

    Hi,
    I start using JDeveloper 11g TP3 to create web service. I encounter two problems.
    1. I created a schema file as the following,
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://FromWSDL/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://FromWSDL/">
    <xsd:complexType name="sayHello">
    <xsd:sequence>
    <xsd:element name="arg0" type="xsd:string" default="Tommy"/>
    <xsd:element name="arg1" type="tns:arg1Enum"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="arg1Enum">
         <xsd:restriction base="xsd:string">
         <xsd:enumeration value="preserve"/>
         <xsd:enumeration value="replace"/>
         <xsd:enumeration value="collapse"/>
         </xsd:restriction>
    </xsd:simpleType>                         
    <xsd:element name="sayHello" type="tns:sayHello"/>
    <xsd:complexType name="sayHelloResponse">
    <xsd:sequence>
    <xsd:element name="return" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
    </schema>
    then I used TopLink/JPA-->JAXB 2.0 Content Model from Schema, I got four java files: Arg1Enum.java, ObjectFactory.java, SayHello.java, and SayHelloResponse.java.
    After, I create a java class with @WebService and @WebMethod annotation. Right Click on the web service class,
    select Web Service Properties-->Additional Classes, I added the four java classes. but there are error message for SayHello and Arg1Enum
    "the type SayHello cannot be serialized into XML and no custom serilizer has been defined for it"
    2. In JDeveloper, I create Java model from the above schema, then reverse the steps, create a new schema from Java Model, the original schema and the schema from Java Model are not same, especially for "defaultValue" and "required" fields for the custom element(SayHello and Arg1Enum).
    Any help will be appreciated

    First what you mean by "deploying classes as web services"? Chances are you
    can do it with something like Glue from The Mind Electric ... but chances
    are that you don't want to. What are you trying to accomplish?
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Simon Wallis" <[email protected]> wrote in message
    news:[email protected]..
    Hi, can WebLogic deploy simple Java classes (not EJB's or JB's, just
    classes) as a web service? How easy it is to do?
    The WebLogic installation has one measly web services example, and it's an
    EJB which is not what I want to do.
    Thanks,
    Simon.

  • Looking for java class

    Hi everyone!
    I'm new to java programming and looking for a java class called
    JPlot2D.
    I have a java application that needs this class to run and i'm using netbeans v3.6 to write the programme. Please if anyone can help ,do it quickly.

    sorry, one last test
    http://forum.java.sun.com/thread.jspa?threadID=55
    8245&messageID=32322 26
    Nice try, but Sun improved that one out of existence too.

  • Java/Template called by JSP Suggestion

    Hi, I have a java class called it "A.java" (for the look and feel) that contains the template for the front end(JSP).
    Then, the jsp call the "A.java", asking for appropriate template for this page, and the "A.java" returning a string (appended string) containing a bunch of html code.
    for examples, inside "A.java"
    public String template (String content, String title)
    String a = "<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">";
    a+= title;
    a += "<table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr>" + content;
    a += "<td colspan="2" align="left" valign="top"> <font size="1" face="Impact"> <font size="7">";
    return a;
    My questions is, is there any better way to return that whole html code in some other way, instead of returning the string appended w/ long html code?
    Any Idea will be appreciated, THANKS

    Hint...
    Usually, I jsp:include a header.html file at the top and a footer.html file at the bottom.
    Anything in between is the JSP...
    Sometimes my header.html starts a table, row, cell <td> ...
    then the footer.html file finishis it </td>, row, table, etc... The entire JSP output is contained in the cell. Easy to re-use.

  • Initiate request from java class

    Hello
    I got a peculiar question
    My web container contains the following
    a JSP page[b] page1.jsp
    second JSP page page2.jsp
    A servlet PushPage
    A java class ContactServlet
    What I want to achieve is when browser is displaying page1.jsp. The ContactSevlet.java class calls the servlet PushPage which redirects to page2.jsp
    I am able to successfully load the servlet from ContactServlet.java since I am able to print the response(the contents of page2.jsp) on to console.
    But the page2.jsp does not display on the browser, it still displays page1.jsp after servlet completes its function.
    Any idea how can I make the page2.jsp to display on the browser?
    In other words i should make the Servlet feel like the request has come from page1.jsp for page2.jsp.
    The code for servlet and java class are below
    package testpackage;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    * Servlet implementation class for Servlet: PushPage
    public class PushPage extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
         public PushPage() {
              super();
         protected void processAll(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              response.sendRedirect("http://localhost/rimpush/page2.jsp");
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
               processAll( request,  response);
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              processAll( request,  response);
    /*Java class*/
    package testpackage;
    import java.io.*;
    import java.net.*;
    import javax.servlet.http.HttpServletRequest;
    public class ContactServlet {
         public ContactServlet(){
         public static void main( String [] args ) {
              /*Call the servlet PushPage*/
              try {
                URL url = new URL("http://localhost/rimpush/PushPage");
                URLConnection conn = url.openConnection();
                conn.setDoOutput(true);
            catch ( MalformedURLException ex ) {
                // a real program would need to handle this exception
            catch ( IOException ex ) {
                // a real program would need to handle this exception
    }Any idea would be gracefully appreciated
    Thank you.

    Your ContactServlet program does makes a request to the "PushPage" servlet independant of the browser. In fact you may as well have just opened up a new browser window - it is the same effect.
    In most cases the only way you can put a new page in the browser is if the browser requests it. So if you want something to be loaded into the browser with page1.jsp displayed in it, then that browser needs to make a request to the server.
    The standard way of doing this is to either use a meta-refresh tag on the page, or a javascript window.setTimeout.
    If you want a "push" technology, you might take a look at [url http://www.pushlets.com] pushlets . I haven't actually used them, but they might be applicable in this case.
    Cheers,
    evnafets

  • [b]What is content Provider java Class & How is it useful?.[/b]

    Hi,
    I would like to know more details on What is content Provider java Class & How is it useful?. Appreciate precise answers on this.
    Thank you,
    Renga
    Email : [email protected]

    Portal Server allows multiple sources of information, applications, and services to be displayed within a single page or set of pages that the user can view in a browser. The page in which the content is included is known as the desktop. The various sources of content are displayed in rectangular areas arranged in rows and columns within the desktop called channels. A Java class, called a provider, is responsible for converting the content in a file, or the output of an application or service into the proper format for a channel. A number of providers are shipped with the Portal Server including a bookmark provider, an application provider, and a notes provider. As the desktop is imaged, each provider is queried in turn for the content of its associated channel.

  • WDP calling EJB and passing objects of classes from Java project

    Hi.
    We have <b>Java</b> project which contains some classes common for all projects (like xxx.Version).
    We have <b>EJB</b> project which defines EJB interface using these common classes (like getVersion(String,int): xxx.Version and getCurrency(String,xxx.Version,int):xxx.Currency ).
    We have <b>Web Dynpro</b> project which calls EJB:
    1. Lookup is successful
    2. call to getVersion is successful
    3. call to getCurrency fails with <b>NoSuchMethodException</b>:
    xxx.XXXObjectImpl0.getCurrency(java.lang.String, xxx.Version, int)
         at java.lang.Class.getMethod(Class.java:986)
         at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.invokeInternal(LocalInvocationHandler.java:51)
         at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:53)
         at $Proxy346.getCurrency(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy347.getCurrency(Unknown Source)
         at xxx.XXX.getCurrencyWrapper(XXXXX.java:24)
    How can I set dependencies to get this running?
    Thanks to all
           Volker

    Hi,
    Is it available in the interface you are using..
    If the answer is yes.. you might have probably forgotten to deploy the EJBs ear file after making the changes..
    Rebuild it.. and deploy the EJB s ear file again..
    It will solve the problem.. If that also does not work,it might be a problem with the cache.. restart the server..
    It should work now !
    Regards
    Bharathwaj

Maybe you are looking for