[Deploy Tool] How to create a  Servlet?

Hello,
i try to assemble and deploy a java servlet with the deploy tool in NW4, but to no avail. I managed to use jsps succesfully, but up to now i failed with servlets.
When i try to access the WAS after deploying my exercise, i get:
<b>404 Requested resource ( Ue160/servlet/Login.class ) not found.</b>
The file Login.class, the directory /servlet and the URL mapping are defined in the file tab of 'J2EE Components'. As far as i can see the servlet container is unable to load the class file.
The servlet name is in red, so something is wrong. But i can build the war-file without any error messages.
Any hints?
I can't use the developer studio, because it does not work with NW4.
Message was edited by: Nico Manicone

hi jeff
1. I am not aware of any portal specific screen which can create this screen for you. However to create a servlet you will need to extend from the HttpServlet interface
2. To direct the request to your servlet from your jsr 168 portlet you could use the PortletRequestDispatcher getNamedDispatcher(String s) declared on PortletContext
Hope this helps
anand

Similar Messages

  • How to create the servlet as acontroller  and how to use it

    how to create the servlet as acontroller and how to use it

    >
    John
    Please update your forum profile with a real handle instead of "914824".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I am going to have over 50 buttons in a page, Why? This would be a most unusual UI paradigm. I've never seen such a page, which suggests that whatever you want to do is normally done another way. Please explain the requirement in more detail.
    just wanted to know if its possible to do something like this in java.
    Java is not used in programming APEX UI behaviour. Java and JavaScript may share initial syllables, but they are not closely related.
    It's possible to achieve a great deal in JavaScript, but a clear definition of the requirements is necessary. Do you mean the buttons should be dynamically generated? If so, yes, this is possible in JavaScript. What would drive the process?
    Also, i would like to have dynamic action on it, for example, when the button is pressed, fill a string of text into other items(text field) within the page. Without more detail its not possible to make any specific suggestions. For example, I certainly would not want to create 50+ individual dynamic actions relating to different buttons.

  • How to create a servlet  in PAR Application

    Hi Experts,
    I want to create a servlet in PAR application. This servlet should be capable of accessing the functions of other java files included in PAR Application. Servlet should be capable of accessing the functions say doContent(req, resp) of any class of PAR application.
    Is it possible to create Servlet in PAR application?
    I created one servlet but unable to declare its information in Deployment Descriptor.
    Because the deployment which is provide ie portalapp.xml doesnt allow us to write tags like <servlet-name>, <servlet-mapping>, <url-pattern> etc. These are necessary for declaration of servlet.
    So how can i write a complete working Servlet under PAR application?
    Please help and replies will be appreciated.

    Hi,
    Depending upon your usecase there are different ways to implement this logic.
    Check this for example (Read my answer in this post):
    https://forums.sdn.sap.com/thread.jspa?threadID=349151
    Also check these senarios:
    http://help.sap.com/saphelp_nw70/helpdata/en/42/9ddf20bb211d72e10000000a1553f6/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/42/9ddcc9bb211d72e10000000a1553f6/frameset.htm
    Also the delegation may be interesting for you:
    http://help.sap.com/saphelp_nw70/helpdata/en/a0/44b742cafec96ae10000000a155106/frameset.htm
    Greetings,
    Praveen Gudapati

  • How to create a servlet and write its details in DD in PAR Application

    Hi Experts,
    I want to create a servlet in PAR application. This servlet should be capable of accessing the functions of other java files included in PAR Application. Servlet should be capable of accessing the functions say doContent(req, resp) of any class of PAR application.
    Is it possible to create Servlet in PAR application?
    I created one servlet but unable to declare its information in Deployment Descriptor.
    Because the deployment which is provide ie portalapp.xml doesnt allow us to write tags like <servlet-name>, <servlet-mapping>, <url-pattern> etc. These are necessary for declaration of servlet.
    So how can i write a complete working Servlet under PAR application?
    Please help and replies will be appreciated.

    Hi Pankaj,
    I don't think it is possible to write Servlet in portal applications.
    I guess in Portal Application Projects we can develop portal components and portal services only.
    Thanks and regards,
    -Madhu

  • How to create a servlet to be called by a portlet in weblogic workshop

    Hey,
    In weblogic workshop 8.1.4, I created a portal application. In the portlet(Java portlet- JSR 168), I would like to call a Java Servlet. In the workshop, it seems there is no way to create a Java Servlet.
    Does anybody know how to create a Java Servlet in the Weblogic workshop?
    Thanks!
    Jeff

    How about creating a java class and adding the proper imports, extends, methods etc. to make it a servlet.
    Do the the necessary changes to web.xml
    Then try to invoke it from the portlet's jsp of java code
    HTH,
    Raj

  • How to create a Servlet Exception in jsp

    Greetings,
    I would like to know if someone knows how create a servlet exception in a JSP.
    Thx

    What for? new ServletException() - IIRC it's not abstract.

  • How to create a Servlet

    Hello All,
    I am trying to learn creating a servlet in oaf. Although I kind of understand the concept of a servlet....have doubts about where the servlet class file lives/resides? Does it matter where it resides....at least for now in the Jdeveloper environment?
    The way I understand it is:
    1) In the oaf page need to place the item in which the servlet result is displayed
    2) In the PR of the CO of the above page, need to find the above item
    2.1) set the source of the above item to be the servlet class while passing in the params into the set source call.
    2.2) Does it matter where the servlet class file resides? ie., can it live anywhere in the project??
    Pls. help me understand this concept.
    Practially in steps2,3 of the servlet wizard of the Jdeveloper what do these do?
    Step#2: URL Pattern
    Step#3: Parameters. Do I have to necessarily set up the params here in this step or can they be dynamically set when the serveletis invoked in the PR of the CO? If yes, could you pls. provide a sample code. If params can be done either way...which way is effective. Reason for asking is....in my other post, I mentioned that while trying to create a dynamic VO, it seemed to force me to explicitly set the sql statement instead of simply running the sql statement associate with the VO of the page (I am not sure why it is like that...but that worked)
    Thanks,
    Edited by: OAF_Monkey on Nov 16, 2012 4:11 PM

    The way I understand (after following several older posts) is
    1) When my destination page (say page2 renders), in the CO need to find the image item/bean (I am assuming bean and an item mean the same)
    2) After finding the item item/bean, need to set its source as "ReadImage" telling it to go get it from the web.xml while passing in the id
    for which it needs to find an image/blob in the db.
    At this point, if it finds the class "ReadImage" then it should get the
    2.1)db connection
    2.2)get the parameter passed in using
          String image_id = request.getParameter("s1");
         2.3)get the sql statement provided
    2.4)get the image/blob as an input stream and write to the output stream using the below
            InputStream in = null;
            in = rs.getBinaryStream("IMAGE");
         Below is my code in the PR of CO
          System.out.println("I am back in the IMG CO : primaykey val is "+ s1 );
    BP1-->  OAImageBean imageItem = (OAImageBean)webBean.findIndexedChildRecursive("SJImage");
          System.out.println("I am back in the IMG CO1 : after finding the image item" );
    BP2-->     if (imageItem !=null ){
          System.out.println("I am back in the IMG CO2 : before setting the source of the image item" );    
    BP3-->     imageItem.setSource("/OA_HTML/WEB-INF/ReadImage?id=" + s1);
          System.out.println("I am back in the IMG CO3 : after setting the source of the image item" + imageItem.getSource());
          }When I ran it in the debug mode (break points shown above BP1,2,3), I can see that the value is getting passed in ok with the 's1' at BP1 and BP2.
    However when it reaches BP3, if I expand all the nodes of the debug window, I can see that in the 'Statisfields of the CO', it shows
    "Failed to establish the database connection." for the "DBCONNECT_ERROR_MSG" node.
    In the "ReadImage" class file the code to get connection is shown below:
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
            try
            Class.forName("oracle.jdbc.driver.OracleDriver");
            catch (Exception exception )
            exception.printStackTrace();
            throw new UnavailableException(exception.getMessage());
        }In the doPost method:
            if (conn == null)
            try
            WebAppsContext ctx = null;
            ctx = WebRequestUtil.validateContext(request, response);
            ctx = WebRequestUtil.createWebAppsContext(request, response);
            conn = ctx.getJDBCConnection();
            stmt = conn.createStatement();
            }Is this code correct to get a db connection? Pls. share thoughts/ideas/suggestions...
    Thanks,

  • OAS form services "Deploy Icons" how 2 create Jar file?

    hi all!
    i have win2000 and 10g oas form services
    how 2 execute this command for deploying icon(gif)?
    =====
    My Application Directory is
    D:\myapp\icon
    the commad to execute in this directory is
    <oracle_home>jdk/bin jar -cvf myappIcon.jar *.gif
    HOW TO EXECUTE THIS COMMAND FROM D:\myapp\icon directory?
    i try this
    D:\myapp\icon cd d:\oracle_home\jdk\bin jar -cvf myappicon.jar *.gif
    it gives error
    file name ,directory name, volume lable syntax incorrect
    Please give me commad example for this
    Thanks

    Hi Dear Frank and 422828!
    In responce to ur reply what i have done is ..
    1- I have add the directory "D:\frs\jdk\bin;" to the PATH variable.. (!it works Dear 422828 thanks 4 this)
    2-i have created the .jar file using following command
    D:\myapp\icon> jar -cvf myappicon.jar *.gif
    This myappicon.jar file was created in D:\myapp\icon directory
    then i 'CUT' this myappicon.jar file from here and copy to the
    D:\frs\forms90\java directory
    3-then i stop all component in oas10g(form and services) AS control page
    4- then i open formsweb.cfg and edit this as following..
    [myApp]
    …
    archive_jini=f90all_jini.jar,myAppIcons.jar
    imagebase=codebase
    and save it.
    5-then i start all component in oas10g(form and services) AS control page
    6-then i edit my form's button's icon name property
    some button to "save" and some button to "save.gif"
    7- then i start the form by giving the following URL in the Browser
    http;\\mymachine.com:7778/forms90/f90servlet?config=myapp
    then the browser show this message
    "java.lang.classNotFoundExcption:oracle.forms.engine.Main"
    Note! i have tried "Entering The Fast Lane" in ur white paper
    Now what i should do or what are the error or what i missed please mention or guide me
    Now should i try the "BEST PRACTICES" on ur white paper?
    Please guide me
    thanks
    Rana Adnan

  • Deployment tool not found

    hi, i recently installed jee 5 SDK i cant find the deployment tool how do i get it

    How did you fix this problem?
    Please give me some tips.
    Thx,

  • How to create different log files for each of web applications deployed in OC4J

    Hi All,
    I am using OC4J(from Oracle) v1.0.2.2 and Windows2000. Now I want to know
    1. how to create different log files for each of my deployed web applications ?
    2. what are the advantages in running multiple instances of oc4j and in what case we should run
    multiple instances of OC4J ?
    3. how to run OC4J as Windows2000 Service rather than Windows2000 Application ?
    Thanks and Regards,
    Kumar.

    Hi Avi,
    First of all I have given a first reading to log4j and I think there will some more easy way of logging debugging messages than log4j (If you could provide me a detailed explanation of a servlet,jsp,java bean that uses log4j and how to use log4j then it will be very helpful for me). The other easy ways (if I am not using log4j) to my problem i.e creating different log files for each of web applications deployed in oc4j are
    I have created multiple instances of OC4J that are configured to run on different ports and so on each instance I have deployed a single web application . And I started the 2 oc4j instances by transferring thier error/log messages to a file. And the other way is ..
    I have download from jakarta site a package called servhelper . This servhelper is a thread that is started in a startup servlet and stopped in the destroy method of that startup servlet. So this thread will automatically capture all the system.out.println's and will print those to a file. I believe that this thread program is synchronized. So in this method I need not run multiple instances of OC4J instead each deployed web application on single instance of oc4j uses the same thread program (ofcourse a copy of thread program is put in each of the deployed web applications directories) to log messages on to different log files.
    Can you comment on my above 2 approached to logging debugging messages and a compartive explanation to LOG4J and how to use LOG4J using a simple servlet, simple jsp is appreciated ...
    Thanks and Regards,
    Ravi.

  • How to create a pool of SQL2005 to use in J2EE1.4 deployement tool

    Hi everybody,
    I am RP Singh.
    Can anybody help me???
    I want to create a pool of sql2005 in j2ee1.4 deployment tool. I dont know that how to create it.
    currently i am working on sql2000 and i know the driver name as well the three .jar file. I have included in c:\sun\appserver\lib directory and it is working properly.
    But now i want to do the same thing with sql 2005. Can somebody give me the driver name for sql2005 and (if required) some related .jar file.
    Please mail me to [email protected]
    Thankyou.
    Message was edited by:
    ravinderpalsingh

    Hi Jitender,
    your issue is discussed in SAP Note: [1227965 - UDF are created as nvarchar(max)|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3030303132323739363526]. please take a look at it.
    note: You need your S-Account to access this code
    regards,
    Fidel

  • How to create a .par file from console apart from tools like eclipse,studio

    Plz reply me if any body knows how to create .par file from Console i.e command prompt.just like creation of .jar & .war file in java.I have created some iViews and making .par files from tool Eclipse/Netweave rstudio etc..I waqnt to create from console..How it is possible?
    Regards
    Sridhar Raju

    Hi Sridhar,
    I'm unsure for what you'd need this, but in general there are at least two possibilities:
    - manually pack everything into the dir structure needed (documented here: http://help.sap.com/saphelp_nw04/helpdata/en/f9/561140d72dc442e10000000a1550b0/frameset.htm ), than create a ZIP with some command line tool (e.g. JAR), naming it to .par.
    - use ANT to do this; with this, you can even deploy the file, see PAR-File deployment with ANT (EP6)
    Hope it helps
    Detlev

  • How to create and deploy a simple jstl applicaton in weblogic 10.3.3

    How to create and deploy a simple jstl applicaton in weblogic 10.3.3

    1) Since JSTL libraries are provided as Web application libraries, they must be deployed before the Web application that is using JSTL functionality is deployed. The libraries can be deployed using the Administration Console or with the command-line weblogic.Deployer tool.
    Here’s an example of deploying a JSTL 1.2 library using the weblogic.Deployer command-line:
    java weblogic.Deployer -adminurl t3://localhost:7001
    -user weblogic -password weblogic
    -deploy -library
    d:/beahome/wlserver_10.3/common/deployable-libraries/jstl-1.2.war
    This command deploys the JSTL 1.2 library using the default library-name, specification-version and implementation-version defined by the MANIFEST.MF in the library.
    After a library is deployed, the extension-name, specification-version and implementation-version of the library can be found in Administration console. This information can also be found in the MANIFEST.MF file of the library WAR file.
    For more information on deploying a Web module refer below URL
    http://docs.oracle.com/cd/E15051_01/wls/docs103/deployment/deployunits.html
    2) To reference a JSF or JSTL library, a standard web application can define a <library-ref> descriptor in the application’s weblogic.xml file. Here is an example:
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    <implementation-version>1.2.0</implementation-version>
    <exact-match>false</exact-match>
    </library-ref>
    For more information on referencing a Web application library refer below URL
    http://docs.oracle.com/cd/E15051_01/wls/docs103/programming/libraries.html
    3) Create a sample JSP in your application and JSP should look as shown below
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <title>TestJSTL</title>
    </head>
    <body>
    <c:set var="topic" value="JSTL" />     
    <c:out value="${topic}" />
    </body>
    </html>
    4) Create WAR and deploy and test.
    Edited by: Murali Veligeti on Jul 26, 2012 9:00 AM

  • How to specify JDBC Oracle url using deployment tool - Entity Bean

    Hello I'am new to EJB.
    When creating a entity bean-managed persistence and you need to specify the jdbc url with user name
    and password to establish a connection object, how does one specify that in the deployment
    tool?
    Heres an example of what has in the J2EE tutorial has in AccountEJB to get an connection object
    private String dbName = "java:comp/env/jdbc/AccountDB";
    private void makeConnection() throws NamingException, SQLException {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup(dbName);
    con = ds.getConnection();
    Now if my oracle jdbc url is to be jdbc:oracle:thin:@Abe:1521:dev
    ie My host is Abe, port number 1521 and database name of dev and username/password will be system/manager.
    what would my dbName be at the top?
    Would my JNDI lookup of a DataSource resource "java:comp/env/jdbc/AccountDB" become "java:comp/env/jdbc/dev" for starters?
    In the Resource Factories Reference Code I've add a reference of
    Coded Name: jdbc/dev
    Type: javax.sql.DataSource
    Authentication: Container
    and down the bottom of the I've put JNDI Name: MyAccount
    according to the AccountClient code of:
    Context initial = new InitialContext();
    Object objref = initial.lookup("MyAccount");
    and put User Name of "system" and Password of "manager"
    I'am sure in the source code I have to put
    Class.forName("oracle.jdbc.driver.OracleDriver")
    else you would get that no sutitable driver error, maybe you don't have to if ejb server is smart enough?
    What I'am confuse about is where to specify the jdbc url of "jdbc:oracle:thin:@Abe:1521:dev" ??
    Know it won't work because of this vital part. Do you have to put that somewhere else in the deployment tool or properties file, or some other tool??
    Please help
    Thanks
    Abraham Khalil

    When running the client after successful deployment with jdbc, I'am getting
    javax.naming.CommunicationException: java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is:
    org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : minor code: 1398079699 completed: Maybe
    org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : minor code: 1398079699 completed: Maybe
    at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:923)
    at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:281)
    at com.sun.corba.ee.internal.corba.TCUtility.unmarshalIn(TCUtility.java:274)
    at com.sun.corba.ee.internal.corba.AnyImpl.read_value(AnyImpl.java:554)
    at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:605)
    at com.sun.corba.ee.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:252)
    at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.readAny(Util.java:203)
    at javax.rmi.CORBA.Util.readAny(Unknown Source)
    at org.omg.stub.com.sun.enterprise.naming._SerialContextProvider_Stub.lookup(Unknown Source)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:133)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at AccountClient.main(AccountClient.java:21)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:151)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at AccountClient.main(AccountClient.java:21)
    One thing I don't like about EJB is that everything is transparent which is good! But its much
    harder to debug! :( Tried to see if I can figure it out. Hope someone has seen this problem before?

  • How to create own server account for servlet application

    hi friends..
    i have created a servlet page which recieve some data from a j2me program..
    i am running this aplication on my pc using http://localhost:8080/mypage
    now i want to deploy my j2me program on my mobile phone and need to get data in my servlet page
    for this i need to create my own server account for apache but i dont know how to create my own sserver account
    please help me out if anyone knows it how to do it...
    thanx
    kiran_arora

    if you want to create your own webitem check out the link given by other sdner.
    if you want to be able to execute BW query using abap you can check out the following weblog.
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    Regards
    Raja

Maybe you are looking for