[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Re: Problem by using Tomcat (web) to access JBoss (app)

thomas2008ch do-not-reply at jboss.com
Mon May 12 06:34:01 EDT 2008


The JSP looks as follow:


  | ...
  | <%@ page
  | 	import="javax.naming.*,java.text.*,java.util.*,com.wei.chen.ejbs.stateless.*,com.wei.chen.ejbs.entity.*"%>
  | 
  | <%!private Calculator cal = null;
  | 	private NumberFormat nf = null;
  | 
  | 	public void jspInit() {
  | 		try {
  | 			InitialContext ctx = new InitialContext();
  | 			cal = (Calculator) ctx.lookup("EntityCalculator/remote");
  | 		} catch (Exception e) {
  | 			e.printStackTrace();
  | 		}
  | 
  | 		nf = NumberFormat.getInstance();
  | 		nf.setMaximumFractionDigits(2);
  | 	}%>
  | 
  | <%
  | 	if ("AddFund".equals(request.getParameter("action"))) {
  | 		cal.addFund(request.getParameter("fundname"), Double
  | 				.parseDouble(request.getParameter("fundrate")));
  | 	}
  | %>
  | 
  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <html xmlns="http://www.w3.org/1999/xhtml">
  | <head>
  | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  | <title>Insert title here</title>
  | </head>
  | <body>
  | <p>Add a new Fund:<br />
  | <form action="addfund.jsp" method="POST">Fund Name : <input
  | 	type="text" name="fundname" value=""> Growth rate : <input
  | 	type="text" name="fundrate" value="0.05"><input type="hidden"
  | 	name="action" value="AddFund"><br />
  | <input type="submit" value="Add fund"><INPUT type="button"
  | 	value="Close Window" onClick="window.close()"></form>
  | <br />
  | 
  | <%
  | 	 Collection <Fund> funds = cal.getFunds();
  | 
  | %>
  | ...
  | 

I get more info for the exception from the CMD-Console as follow:


  | javax.naming.NameNotFoundException: Name EntityCalculator is not bound in this C
  | ontext
  |         at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  |         at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  |         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
  |         at javax.naming.InitialContext.lookup(InitialContext.java:351)
  |         at org.apache.jsp.calculator_jsp.jspInit(calculator_jsp.java:21)
  |         at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
  |         at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrap
  | per.java:159)
  |         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
  | .java:329)
  |         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
  | 20)
  |         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:290)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  | alve.java:233)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  | alve.java:175)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
  | ava:128)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
  | ava:102)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
  | ve.java:109)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
  | a:263)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
  | :844)
  |         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
  | ss(Http11Protocol.java:584)
  |         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
  | 7)
  |         at java.lang.Thread.run(Thread.java:595)
  | ...
  | 

That means the stateless session bean "EntityCalculator.java" is not bound successfully from Tomcat to JBoss.

Somebody has experience?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150086#4150086

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150086



More information about the jboss-user mailing list