Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ERROR DURING DEPLOYMENT OF SESSION BEANS!!HELP

 
suchi verma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I have succesfully deployed my enterprise application on jboss-3.2.2.
It consists of an session bean which is accessed using a Servlet.
The servlet is in a seperate .war file and the ejb's in a .jar file.
However when I call the servlet which inturn calls the session bean.
I get the following error--
------------------------------------------------------
HTTP Status 405 - HTTP method GET is not supported by this URL
--------------------------------------------------------
the corrresponding servlet code is as follows
package beans;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.rmi.*;
import javax.rmi.*;
import java.util.*;
import javax.naming.*;
import javax.ejb.*;

public class ClientServlet1 extends HttpServlet
{
public void doPost(HttpServletResponse res,HttpServletRequest req)
throws ServletException,IOException
{
doGet(res,req);
}
public void doGet(HttpServletResponse res,HttpServletRequest req)
throws ServletException,IOException{
try {
res.setContentType("text/html");
PrintWriter out=res.getWriter();
Context ctx = new InitialContext();
Object obj=ctx.lookup("java:comp/env/ejb/beans/SimpleBean");
SimpleHome home =
(SimpleHome)PortableRemoteObject.narrow(obj,SimpleHome.class);

Simple test = home.create();
if (test != null)
out.println("<br>Completed creation of remote EJBObject");
else
out.println("Create returned null");
String s = test.getMessage();
out.println(" EJB Message: " + s);
out.close();
}catch(Exception e){System.out.println("exception is"+e);}
}

}
-----------------------------------------------------------------------
I m not able to figure put where the error lies n what it is supposed to mean???
Any help will be greatly appreciated.
thnx
 
Don Griffing
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What information is getting logged to the console and/or server.log?
 
suchi verma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi don
i solved the problem....
thnx neways
 
leslie smith
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you solve the problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic