Z
z1w2x3
Unregistered / Unconfirmed
GUEST, unregistred user!
to:all
我的SERVLET中调用实体BEAN的代码如下:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context ctx = new InitialContext(env);
customerHome = (CustomerHome) ctx.lookup("CustomerHome");
*****************************************************************************
所有BEAN类都放在包xxx.yyy中
但在执行时出现错误:找不到我的实体BEAN,我的实体BEAN在安装时一切正常。错误代码如下:
<2002-7-7 上午11时23分29秒> <Error> <HTTP> <[WebAppServletContext(5303554,Defaul
tWebApp,/DefaultWebApp)]
javax.naming.NameNotFoundException: Unable to resolve CustomerHome. Resolved: ''
Unresolved:'CustomerHome' ;
remaining name ''
<<no stack trace available>>
>
<2002-7-7 上午11时23分29秒> <Error> <HTTP> <[WebAppServletContext(5303554,Defaul
tWebApp,/DefaultWebApp)] Servlet failed with ServletException
javax.servlet.ServletException: javax.naming.NameNotFoundException: Unable to re
solve CustomerHome. Resolved: '' Unresolved:'CustomerHome' ;
remaining name ''
at LoginServlet.init(loginservlet.java:19)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:698)
究竟是哪"方面"原因。
谢谢
我的SERVLET中调用实体BEAN的代码如下:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context ctx = new InitialContext(env);
customerHome = (CustomerHome) ctx.lookup("CustomerHome");
*****************************************************************************
所有BEAN类都放在包xxx.yyy中
但在执行时出现错误:找不到我的实体BEAN,我的实体BEAN在安装时一切正常。错误代码如下:
<2002-7-7 上午11时23分29秒> <Error> <HTTP> <[WebAppServletContext(5303554,Defaul
tWebApp,/DefaultWebApp)]
javax.naming.NameNotFoundException: Unable to resolve CustomerHome. Resolved: ''
Unresolved:'CustomerHome' ;
remaining name ''
<<no stack trace available>>
>
<2002-7-7 上午11时23分29秒> <Error> <HTTP> <[WebAppServletContext(5303554,Defaul
tWebApp,/DefaultWebApp)] Servlet failed with ServletException
javax.servlet.ServletException: javax.naming.NameNotFoundException: Unable to re
solve CustomerHome. Resolved: '' Unresolved:'CustomerHome' ;
remaining name ''
at LoginServlet.init(loginservlet.java:19)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:698)
究竟是哪"方面"原因。
谢谢