PageNotFound when using servlets as clients for EJB

Can anyone help me? I have a container managed EJB. I'm using servlets as my client. I placed my EJB's in a jar file and my servlets and html pages in a WAR file. I deployed them using J2EE's deploytool. I can access my html files but not my servlet files. It always says file not found or a 405 error (resource not allowed) I access my servlet this way...
http://localhost:8000/ReservationContextRoot/ReservationAlias
my web.xml file looks like the following:
<?xml version="1.0" encoding="Cp1252"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN' 'http://java.sun.com/j2ee/dtds/web-app_2.2.dtd'>
<web-app>
<display-name>ReservationWAR</display-name>
<description>no description</description>
<servlet> <servlet-name>ReservationServlet</servlet-name>
<display-name>ReservationServlet</display-name>
<description>no description</description>
<servlet-class>ReservationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ReservationServlet</servlet-name>
<url-pattern>ReservationAlias</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<resource-ref>
<description>no description</description>
<res-ref-name>jdbc/ReservationDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-ref> <description>no description</description>
<ejb-ref-name>ejb/Reservation</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>ReservationHome</home>
<remote>Reservation</remote>
</ejb-ref>
</web-app>

Are you sure your servlet class itself can run without problem? Try debug in the these steps:
1. Change your servlet to simply output some HTML text, so you can be sure tomcat can get to your servlet. If this is OK, it means the servlet itself has problem, probably the EJB stuff.
2. Make sure the EJB container is running.
3. Make your servlet a standalone client (not a servlet) and see if it can run. Pay attention to how you do JNDI lookup of the EJB.
Yi

Similar Messages

  • Rmi-iiop client for EJBs

    [att1.html]

    I've been fighting the same issues over the past few days. The answer you gave still left me
    wondering which tool to use. Should it be rmi -iiop or ejbc -iiop? I get the idl files on
    WLS 5.1 generated but then I can't get the idlj to execute properly on the generated
    HelloHome.idl and Hello.idl.
    Wayne
    Andy Piper wrote:
    Abhishek <[email protected]> writes:
    But How do I write Rmi - iiop clients for EJBs.
    when I try to generate the IDL for my EJB by running the weblogic.rmic utility I get an
    error that none of my classes ( Remote, Home and Impl ) implement the remote
    interface. Which is true as EJBs do not directly implement the remote interface.You may be able to get this to work with WLS6.0SP1 and the
    -idlMethodSignatures flag. Take a look at the methods target in
    examples/rmi_iiop/ejb/generic_idl or at
    examples/rmi_iiop/ejb/simplified_idl. This all works fine in
    Silversword.
    andy

  • I recently upgraded to the latest version of FF and now when using a webmail client I am routinely logged out when I try to search e-mail. Why? I go to IE and it works... but, I hate IE.

    I recently upgraded to the latest version of FF and now when using a webmail client I am routinely logged out when I try to search e-mail. It works in IE, but I don't like or want to use IE.
    == This happened ==
    Every time Firefox opened
    == Today

    Unstable means it can vary in stability day by day as it can be crash prone to being stable. Features can be a work in progress for a while. The May 24 Nighty build was crash prone for a lot of testers for example.

  • Total crash when using a torrent client.

    Hi,
    I am experiencing a great problem last 2 weeks. I was using Transmission torrent client for 2 months, but suddenly it started to crash during the first 15 minutes after i start it. The crash is huge, because every time the computer requires a restart (you know the black window explaining how to restart in several languages).
    First i thought the problem came from the updated version of Transmission, but then i tried with BitTorrent, Azureus, Tomato, xTorrent and many more and the problem was the same... perfectly working for 15 minutes and after this the huge crash.
    This crash also causes for the fans of my MAC to work very loudly and fast.
    Please help with this, because i don't want to re-install my MACOSX
    P.S. My OSX - 10.4.10 ; My MAC - Dual 2GHz PowerPC G5, 512 RAM
    Thanks in advance,
    Georgi Toshkov
    Message was edited by: siromaha

    I am coming to this thread a little late but really "a brody" the guy just wants some help and not a lecture on illegal software use. I also think your rush to condemn bit torrents as only for illegal downloads is completely over blown. Firstly, it was the open source software movement that developed and utilized bit torrents. There are many open source distributions that you can only get through torrents. For example, the new qt4 and amorak project for the mac. This is hardly illegal and I don't think the forum policy would limit discussion of it or any other subject on torrents. You personal views may differ but those would fit better in a different discussion forum.
    Siromaha, your problems seem to be severe and may indicate a hardware failure possibly a network card or memory. Are you sure this only happens when the torrent is running? If so try using a different client for a few days. I have found transmission to be a little buggy sometimes. Have you added any other software lately that could be the problem. I see you have a G5 is it staying cool enough?
    Message was edited by: tll123

  • When using adobe flash player, for example, in the game. Screen will fade after a few seconds of inactivity.

    Hi, i have windows 7 hp, sp1. When using adobe flash player, for example, in the game. Screen will fade after a few seconds of inactivity. But the pixels on are highlighted. This is accomplished by installing the latest update flash.If I move the mouse the screen returns. Screen goes from one second to several, and sometimes not at all. Pleas help me

    To give you any useful advice, I'm going to need to know more about your computer and browser:
    https://forums.adobe.com/thread/1195540

  • When using Lightroom Book module for Blurb book making, why do I keep getting a low image quality message if it's supposedly accessing my large raw files in my library?

    When using Lightroom Book module for Blurb book making, why do I keep getting a low image quality message if it's supposedly accessing my large raw files in my library?

    I think I've solved my problem with a Google Search. I came across a free slide show generator
    (contributions requested) that shows much higher quality slide shows than either iPhoto or Aperture 3.
    You click on a folder of jpegs and it almost immediately generates thumbnails and within a few seconds
    I can be viewing a full screen, tack sharp, slideshow of all of the files in the folder. Much sharper than
    I'm used to seeing.
    I think I'll keep the Aperture 3 and use if for the purpose it's intended for in the future. I'll also redo the
    image preview files to the small size it started with and then I'll copy all of the files I'm interested in from
    iPhoto into a separate folder on another disk. I'll use Aperture to catalog and to perform image manipulations
    on but I won't try to use it as an iPhoto replacement. I don't think I'll be using iPhoto much as an image
    viewer in the future either after I finish moving my favorite pictures to the Phoenix Slides folder.
    The name of the free program is Phoenix Slides. It's free to download and try, free to keep (though I
    think you'd want to pay the small amount requested) and fast. My pictures have never looked so good
    before.
    http://blyt.net/phxslides/
    Message was edited by: Jimbo2001

  • Flash crashing when using Command + Option + S for Scale and Rotate?

    Flash crashing when using Command + Option + S for Scale and Rotate?
    It's happening to me when I use those hotkeys
    Please let me know if it's happening to you too.
    I don't know the cause but I need a fix.
    I'm using Adobe FLASH cs6 for Mac
    My computer:
    Mac mini
    Mid 2011
    Software  OS X 10.8.1 (12B19)
    -Line

    With all due respect to your totally coindescending reply, this is a bug in Flash. Happens every 4-5 times I use that menu item. Been happening for months, but  we just installed a Brand new iMac (1/13). Quadcore 3.4 16G RAM and 1TB Fusion drive. Fresh install of CS6. Not running any other 3rd Party Software. Problem STILL happens in new Flash docs with small, simple vector Graphics.
    So instead of blaming the users computers, how about you guys just fix the effin' problem? Thanks.

  • Rich Client For EJB asking for  'ioser12.dll' when using PortableRemoteObject.narrow()

    Hi,
    When using narrow down the object to home interface after performing lookup(), it gives error for
    'ioser12.dll' not found. If doing 'SomeHome someHome = (SomeHome)obj;' it's working fine.
    Regards,
    Jitendra Kumar

    Remove the j2ee.jar from your classpath and narrow will work.
    The correct version is in weblogicaux.jar.
    -- Rob
    Jitendra Kumar wrote:
    >
    Hi,
    When using narrow down the object to home interface after performing lookup(), it gives error for
    'ioser12.dll' not found. If doing 'SomeHome someHome = (SomeHome)obj;' it's working fine.
    Regards,
    Jitendra Kumar

  • Servlet Client for EJB

    Hi,
    Till now i had normal java client for my EJB Programs.. I use j2ee 1.4 AppServer
    Whenever i run my java program i used to set classpath for the returned client jar file and appserv-rt.jar but now when i run my servlet client program i don know how to set them and hence when i run the servlet i get an error saying No class def found for home interface...
    How do i rectify this?
    Waiting for ur replies!
    Thanks,
    Akshatha

    Hi,
    Inspite of putting my jar file i am getting the no
    class def found error. So how do i
    proceed further?
    AkshathaDid you put the EJB client jar in the WEB-INF/lib directory for your web application as suggested?

  • Font smoothing settings doesn't consistently work for every login on Windows 2008 R2 when using a RDP client

    I'm trying to use the MSTSC client on a Windows 8.1 machine to connect to a Windows 2008 R2 server. In the MSTSC experience tab I checked the font smoothing option. Font smoothing works some times and doesn't work the other times. I don't see a pattern here.
    any kind of help is much appreciated.
    Thanks,
    Prasanna

    Hi Prasanna,
    Thank you for posting in Windows Server Forum.
    As you have Server 2008 R2, there is GPO setting available to specify whether font smoothing is allowed for remote connections.
    Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment
    Do not allow font smoothing
    If you disable or do not configure this policy setting, font smoothing is allowed for remote connections.
    You can configure font smoothing on the Experience tab in Remote Desktop Connection (RDC) or by using the {allow font smoothing:i:1} setting in a Remote Desktop Protocol (.rdp) file.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Nullpointerexception when using servlet with Mysql on a cobalt Raq3 Server

    I'm a student and i have to use servlets and Mysql to make a Database application. Our school has a Cobalt Raq3 server and has installed Java Dev Kit 1.3a.
    First problem they can't tell me their driver manager for Mysql.
    Second problem when i try my servlet it gives a NullpointerException
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class Testingo2 extends HttpServlet {
    // Hier word een Statement en Connectie object aangemaakt die later zullen worden gebruikt om een database aan te spreken
    Statement stm;
    Connection con;
         // Hier word de servlet geinitialiseerd
    public void init() throws ServletException {
         try {
              // Hier wordt de database driver geladen
              Class.forName("org.gjt.mm.mysql.Driver");
              /** Hier gaan we gebruik maken van het Connection Object om verbinding te maken met de database CFP door een           * jdbc.odbc bridge en dit zonder username en passwoord
              con = DriverManager.getConnection("jdbc:mysql://cfp.ehsal.be:3306/cfp","bjorn","disaronno");
              // Hier zorgen we ervoor dat als er een zich een fout voordoet dat deze getoond wordt
                   catch (ClassNotFoundException cnfe ) {
                   System.out.println(cnfe.toString());
                   catch (SQLException e) {
                   System.out.println(e.toString());
    // Als de servlet het einde van zijn levenscyclus heeft bereikt gaat het connectie object worden afgesloten
    public void destroy() {
         try { con.close();}
         catch (SQLException e) {}
    public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    try {
         /** Hier gaat men met het Connectie object een statement aanmaken,welk dan later zal worden gebruikt voor het           * uitvoeren van query's
         stm = con.createStatement();
         /** Hier gaat men de query "selecteer alles van de tabel projecten" uitvoeren op de cfp database dankzij het      * statement en connection object. Deze gegevens worden dan opgeslagen in de Resultset rs.
         ResultSet rs = stm.executeQuery("SELECT project,land,titel,omschrijving,budget,informatie FROM PROJECTEN ");
         /** Hier gaat men informatie, over de gegevens die in de ResultSet rs zijn opgeslagen, opslaan in ResultSetMetaData      * meta.
         ResultSetMetaData meta = rs.getMetaData();
         // Hiergaat men het aantal kolommen van de tabel tellen en opslagen in de Integer kolom
         int kolom;
         kolom = meta.getColumnCount();
         // Hier declareerd men welk soort meta type we naar browser sturen, hier dus HTML tekst
         res.setContentType("text/html");
         // Hier gaan we een PrintWriter object out aanmaken dat gebruikt zal worden om de html tekst naar de client te sturen
         PrintWriter out = res.getWriter();
         // De basis html code voor deze pagina
         out.println("<HTML >");
         out.println("<BODY BGCOLOR =fd8017>");
         out.println("<H1> <B><CENTER><FONT COLOR='#00008b'> Overzicht van de projecten </FONT></CENTER></B></H1>");
         /** Hier defini�ren we een tabel die van de hoogte en breedte van het scherm volledig gebruik maakt, waarvan de boord      * van de tabel een dikte van 1 heeft, de ruimte tussen de cellen in de tabel en tussen de randen van een cel en de      * inhoud is gelijk aan 2 (in pixels) en een achtergrondkleur fd8017
         out.println("<TABLE HEIGHT='100%' WIDTH='100%' BORDER=1 CELLPADDING = 2 CELLSPACING = 2 BGCOLOR =fd8017>");
              // begintag voor een nieuwe rij
              out.println("<TR>");
              /** Hier creeren we een lus om de kolom hoofden naar de client te sturen. Deze lus begint als j=1 en gaat           * door tot j = aantal kolommen en na elke loop wordt j verhoogd met 1. Normaal werden alle kolom hoofden           * uit de database opgehaald en afgebeeld, maar vermits MySQL geen kolom hoofden aanvaard waar spaties           * inzitten heb ik gekozen om hier de kolom hoofden die uit meer dan 1 woord bestaan op te halen en aan te           * passen. Dit voor estetische redenen, voor het functioneren van de servlet heeft dit echter geen belang
    for(int j=1;j<=kolom;j++){
              if (meta.getColumnName(j).equals("project")) {
              out.println("<TH><FONT COLOR='#00008b'> project nr </TH>");
              else if (meta.getColumnName(j).equals("budget")) {
              out.println("<TH><FONT COLOR='#00008b'> budget (in 1000 �) </TH>");
              else if (meta.getColumnName(j).equals("informatie")) {
              out.println("<TH><FONT COLOR='#00008b'> meer informatie ? </TH>");
              else {
              out.println("<TH><FONT COLOR='#00008b'>");     
              out.println(meta.getColumnName(j)+" ");
              out.println("</TH>");
              // Hier wordt de tag voor een nieuwe rij afgesloten
              out.println("</TR>");
              // Hier initialiseren we een Integer en String die later zullen worden gebruikt
              int k = 0;
              String nummer ="";
    // Dit deel van de programma code gaan we uitvoeren zolang er nog een volgende rij in de database bestaat
    while (rs.next()) {
              // Voor elke nieuwe rij wordt k verhoogd met 1
              k =k +1;
              // De tag voor een nieuwe rij
              out.println("<TR>");
         // Dit deel van de code wordt uitgevoerd zolang Integer i kleiner is dan het aantal kolommen
         for(int i=1;i <= kolom;i++) {
              // Een nieuwe cel waarin de data worden afgebeeld in de kleur #00008b
              out.println("<TD ALIGN='left' VALIGN ='top'>");
              out.println("<FONT COLOR='#00008b'> ");
              /** Hier halen we de kolomnaam op van kolom i en slagen we deze op in de String kolomnaam. Dan gaan we van           * deze naam de overtollige spaties (links en rechts van de naam) wegwerken.
              String kolomnaam = meta.getColumnName(i);
              kolomnaam = kolomnaam.trim();
              /** Als de kolomnaam gelijk is aan "project" dan gaan we de data van deze cel opslagen in de String nummer en           * deze dan doorsturen naar de client. Anders gaan we voort in onze programma code.
              if (kolomnaam.equals("project")) {
              nummer = rs.getString(i);
              out.println(nummer);
              /** Als het vorige niet waar is dan gaan we zien of de kolomnaam gelijk is aan "informatie", als dat zo is           * dan gaan we de data van de cel opslaan in de String celwaarde.
              else if ( kolomnaam.equals("informatie")) {
                   String celwaarde = rs.getString(i);
                   char punt = '.';
                   char under ='_';
                   nummer = nummer.replace(punt,under);               
                   /** Als deze String celwaade gelijk is aan "Y" dan gaan we een hyperlink afbeelden die opgebouwd is                * uit drie delen : de naam "project", de String nummer (de data uit de cel van project waar het                * "." is vervangen door "_" ) en de extensie ".html"
                   if (celwaarde.equals("Y") ){
                   out.println("<A HREF=project" + nummer + ".html> Project" +" "+ k +" </A>");     
                   /** Als de celwaarde niet gelijk is aan "Y" dan gaan we gewoon de naam "Project" en de Integer k                * afbeelden
                   else {
                   out.println("Project" +" " + k);
              else {
              out.println(rs.getString(i));
              out.println("</FONT>");
              out.println("</TD>");
              out.println("</TR>");
         out.println(" </TABLE>");
         out.println("</BODY>");
         out.println("</HTML>");
         // Hier wordt het object Satement afgesloten vermts we het niet meer nodig hebben
         stm.close();
    // Als er bij het uitvoeren van de programma code een fout zich voordoet dan wordt er een foutmelding weergegeven
    catch (SQLException e) {
    System.out.println(e.toString());

    The exception is thrown in the Doget method namely stm = con.createStatement();
    But i think that when i run my servlet that the init method is not used. I believe the problem is the access to the database.
    Thanks for the answer because i'm beginning to hate the cobalt server at my school

  • APPLETS AS CLIENT FOR EJB

    Hi
    We 've deployed our EJB APPLN. in OAS 4.0.8.2. We use OASDEPLOY for deploying our source. Now we r migrating to 9IAS whic has a different deployment scenario.
    I am quite sucessful in deploying some sample EJB's which uses servlets. But we r using APPLETS to call EJB. For this what will be the exploded directory look like.
    Thanks for the efforts.
    RAJ
    Thanks for u r efforts.

    Hi
    I have also tried setting permissions in the policy file. but i could not figure out exactly which all permission have to be set. it worked when i granted ALL permissions, which is ofcourse not recomended..
    grant {
    permission java.security.AllPermission;
    A more practicable way would be to sign ur applet. anyway, You cant expect all the users of the applet to make changes in their policy files.
    take a look at http://developer.java.sun.com/developer/qow/archive/99/index.html
    remember, u may need to sign all the accompanying jar files aslo(oc4j.jar, ejb.jar, etc..)
    regards
    raees

  • Corba Client For EJB

    Hello
    I am trying to connect Corba Client to EJB deployed in OC4J.
    I followed the instructions given on
    http://otn.oracle.com/tech/java/oc4j/htdocs/how-to-rmi-iiop.html
    But I am not getting success after making tries in different ways.
    Can some body tell how to connect to EJB by a corba client using Oc4j.
    If OC4J does't support RMI-IIOP , can you suggest other server which supports that.
    Thanx in advance.

    I'm stuck exactly with the same issue while trying to port my application from weblogic to jboss.
    I tried to specify different ORB implementations (JacORB, OpenORB) for jvm option org.omg.CORBA.ORBClass, but JBoss couldn't get them instantiated. Native Sun implementation which is used in JBoss by default and can be instantiated, apparently is not fully compatible with weblogic security module.
    So did you manage to find out the solution?
    Edited by DigitalDude at 04/09/2008 11:47 PM

  • Writing a Standalone Client for EJB 3.0 Bean For Weblogic 10

    Steps for Writing a Standalone Client
    Client Code
    package com.client;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.StatelessService;
    public class StatelessClient {
         public static void main(String [] args){
              Context ctx = null;
              try {
                   ctx = getInitialContext("t3://localhost:7001/protossbservice","weblogic","weblogic");
                   Object ref = ctx.lookup("StatelessService#"+StatelessService.class.getName());
                   StatelessService service = (StatelessService)PortableRemoteObject.narrow(ref,StatelessService.class);     
                   System.out.println("StatelessClient.getMessage() ++");
                   String  message = service.getMessage();
                   System.out.println("StatelessClient.getMessage --");
                        System.out.println("Message from Bean "+message);
         } catch (NamingException e) {
                   e.printStackTrace();
         private static Context getInitialContext(String url, String user, String password) throws NamingException {
            Properties h = new Properties();
            h.put(Context.INITIAL_CONTEXT_FACTORY,
                    "weblogic.jndi.WLInitialContextFactory");
            h.put(Context.PROVIDER_URL, url);
            h.put(Context.SECURITY_PRINCIPAL, user);
            h.put(Context.SECURITY_CREDENTIALS, password);
            return new InitialContext(h);
    Business Interface
    package com;
    public interface StatelessService {
         public String getMessage();
    Stateless Session Bean
    package com;
    import javax.annotation.PostConstruct;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    * Test Stateless Session Bean
    @Stateless(mappedName="StatelessService")
    @Remote(StatelessService.class)
    public class StatelessServiceBean implements StatelessService {
         public String getMessage(){
              return "I am invoked";

    emekaco wrote:
    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
    Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
    >
    Again, is container managed bean good for a big project?
    The question is too vague to be answered. It's a design decision that needs more details.

  • Wired mac using Express as client for Snow base?

    Hello All,
    Is it possible to plug a non-Airport Mac into the Ethernet port of the Express and essentially use it as a client for an existing older Airport network (Snow base station)?

    No. This requires a WDS and the Snow base station doesn't support WDS.

Maybe you are looking for

  • One Corporate Account for multiple departments or seperate accounts for each

    I would like to know if I can have one central account that can be shared among different departments. Or I would need to purchase seperate account for each department. Thank you for your help.

  • CS2, win, loading fonts

    I'm working primarily in Illustrator, but this question may pertain to all the CS2 programs. When I first open Illustrator in the morning, I find myself waiting for what seems like 5 minutes for all my fonts to load. Is there a way to open the progra

  • Trouble with texting on 4S IOS 7

    I downloaded emoji and now my phone is so SLOW especially when texting.  And when I hit the back button it deletes the entire text!!  Is this becuase of IOS 7?

  • Prerequisites to install NW2004s WDP for ABAP

    Hi SDN Gurus, I wanted to practice the WDP for ABAP in NW2004s in my PC. Could you please let me know how can I get the trial versions of these and the installation process. Thanks, David.

  • Changing my indecent alias?

    I would like to change my alias to housten44 (of this current account that I use with my primairy email account.) Can a admin help me? Ty