📄 如何搭建j2ee开发环境(3).htm
字号:
<TD bgColor=#cccc98 height=22>
<DIV align=center><IMG border=0 height=18 name=Image165
src="如何搭建J2EE开发环境(3).files/button2_bottom.gif" width=66></DIV></TD>
<TD bgColor=#cccc98 height=22><IMG height=13
src="如何搭建J2EE开发环境(3).files/line.gif" width=1></TD>
<TD bgColor=#cccc98 height=22>
<DIV align=center><A
href="http://developer.ccidnet.com/pub/disp/Column?columnID=296"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image174','','../images/developers/button4_bottom.gif',1)"
target=_blank><IMG border=0 height=18 name=Image174
src="如何搭建J2EE开发环境(3).files/button4_top.gif" width=66></A></DIV></TD>
<TD bgColor=#cccc98 height=22><IMG height=13
src="如何搭建J2EE开发环境(3).files/line.gif" width=1></TD>
<TD bgColor=#cccc98 height=22>
<DIV align=center><A href="http://linux.ccidnet.com/"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image175','','../images/developers/button5_bottom.gif',1)"
target=_blank><IMG border=0 height=18 name=Image175
src="如何搭建J2EE开发环境(3).files/button5_top.gif" width=50></A></DIV></TD>
<TD bgColor=#cccc98 height=22><IMG height=13
src="如何搭建J2EE开发环境(3).files/line.gif" width=1></TD>
<TD bgColor=#cccc98 height=22>
<DIV align=center><A
href="http://developer.ccidnet.com/pub/disp/Column?columnID=315"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image176','','../images/developers/button6_bottom.gif',1)"
target=_blank><IMG border=0 height=18 name=Image176
src="如何搭建J2EE开发环境(3).files/button6_top.gif" width=50></A></DIV></TD>
<TD bgColor=#cccc98 height=22><IMG height=13
src="如何搭建J2EE开发环境(3).files/line.gif" width=1></TD>
<TD bgColor=#cccc98 height=22>
<DIV align=center><A
href="http://bbs.ccidnet.com/forumdisplay.php?forumid=5"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image177','','../images/developers/button7_bottom.gif',1)"
target=_blank><IMG border=0 height=18 name=Image177
src="如何搭建J2EE开发环境(3).files/button7_top.gif" width=80></A></DIV></TD>
<TD bgColor=#ffffff height=22 width=17><IMG height=24
src="如何搭建J2EE开发环境(3).files/right_yuan.gif"
width=18></TD></TR></TBODY></TABLE><!-- 包含菜单结束-->
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=580>
<TBODY>
<TR>
<TD class=content colSpan=2 height=20 vAlign=top><IMG height=5
src="" width=5><BR><!-- 包含导航开始--><!-- 模版文件头 结束 -->
<TABLE border=0 cellSpacing=1 class=content01 width=414>
<TBODY>
<TR>
<TD width="100%"><IMG height=10
src="如何搭建J2EE开发环境(3).files/triangle.gif" width=11> 当前页面位置:<A
class=link href="http://www.ccidnet.com/">主页</A> :<A
class=link
href="http://developer.ccidnet.com/pub/disp/Column?columnID=287&pageNO=1">开发者</A>:<A
class=link
href="http://developer.ccidnet.com/pub/disp/Column?columnID=293&pageNO=1">技术开发_文档中心</A>:<A
class=link
href="http://developer.ccidnet.com/pub/disp/Column?columnID=295&pageNO=1"><B>技术开发</B></A><B>:文章</B>
</TD></TR></TBODY></TABLE><!-- 包含导航结束--></TD>
<TR>
<TD colSpan=2 height=10></TD></TR>
<TR bgColor=#7e99a4>
<TD colSpan=2 height=2></TD></TR>
<TR>
<TD class=content colSpan=2 height=15 vAlign=top>
<DIV align=right><!-- 包含发送email开始-->
<FORM action=http://club.ccidnet.com/send_to_friend.php3 method=post
name=sendmail target=_blank><INPUT name=title type=hidden
value=如何搭建J2EE开发环境> <INPUT name=author type=hidden value=翁驰原> <INPUT
name=publish_time type=hidden value="2002.10.16 10:48:43"> <INPUT
name=link type=hidden
value=Article?columnID=295&articleID=27801&pageNO=1>
</FORM><IMG height=5 src="" width=5><BR><A class=content01
href="javascript:self.print()"><IMG border=0 height=18
src="如何搭建J2EE开发环境(3).files/printer.gif" title=打印 width=24>打印</A> <A
class=content01 href="javascript:document.sendmail.submit()"><IMG
border=0 height=18 src="如何搭建J2EE开发环境(3).files/comment.gif"
title=发给朋友 width=24>发给朋友</A> <A class=content01
href="http://club.ccidnet.com/remark.php3?channel=295&title=如何搭建J2EE开发环境"><IMG
border=0 height=18 src="如何搭建J2EE开发环境(3).files/send.gif" title=发表评论
width=24>发表评论</A> <!-- 包含发送email结束--></DIV></TD></TR><!-- 包含文章开始--><!-- 文章显示 -->
<TR>
<TD class=content vAlign=top width=19></TD>
<TD class=content vAlign=top width=561><IMG height=5 src=""
width=5><BR><SPAN class=p16><B>如何搭建J2EE开发环境(3)</B></SPAN><BR>作者:翁驰原
本文选自:《开放系统世界》——赛迪网 2002年10月16日 </TD></TR>
<TR>
<TD class=content vAlign=top width=19></TD>
<TD class=content height=144 vAlign=top width=561><BR><SPAN
class=p11b><IFRAME align=right frameBorder=0 height=300
marginHeight=0 marginWidth=0 noResize scrolling=no
src="F:\study\Java\用Jbuilder 7开发Session Bean\如何搭建J2EE开发环境(3).files\ad(3).htm"
width=360></IFRAME>10.运行客户端测试程序。测试如下:先为它加一个运行期设置。在Run—>Configuration里选择New,在弹出的窗口里选择Run下的Application,同时在Configuration
name里输入Client,然后在Main里选旁边的按钮,在弹出的窗口里选择Browse标签下的testses下的TestSesTestClient,一路OK完成。右击TestSesTestClient.java,单击Run
Using Client后,运行Client程序。运行成功后见图10所示,Client得到了调用了Session
Bean的方法,返回了Testing Successful。 <BR><BR>
<CENTER><IMG src="如何搭建J2EE开发环境(3).files/37161.gif"></CENTER><BR><BR>
<CENTER>图10 运行客户端测试程序界面</CENTER><BR><BR>
<CENTER><FONT
color=#000099><STRONG>常见错误解答</STRONG></FONT></CENTER><BR><BR><B>1.WebLogic
Server cannot start: config.xml not found。</B> <BR><BR>(1)错误代码描述:
<BR><BR><CCID_NOBR>
<TABLE align=center border=1 borderColorDark=#ffffff
borderColorLight=black cellPadding=2 cellSpacing=0 width=550>
<TBODY>
<TR>
<TD bgColor=#e6e6e6 class=code><PRE><CCID_CODE><Info> <Management> <140013> <C:\bea\user_projects\.\config.xml not found>
C:\bea\user_projects\.\config.xml not found
Since no config.xml was found, the fileRealm.properties file will not be used.
Would you like the server to create a default configuration and boot? (y/n):</CCID_CODE></PRE></TD></TR></TBODY></TABLE></CCID_NOBR><BR><BR>(2)问题发生时机:
<BR><BR>在JBuilder上运行Weblogic Server时,在Weblogic 6.x+ http:7001页上。
<BR><BR>(3)产生原因: <BR><BR>Weblogic域目录没有正确设置。 <BR><BR>(4)解决方法:
<BR><BR>选择Tools——>Configure Servers,左边选择Weblogic Server
6.x+,右边选择Custom标签,同时检查域目录是否正确。如:h:\bea\user_projects\mydomain。
<BR><BR><B><CCID_CODE>2.Authentication for user
<username></CCID_CODE> denied。</B> <BR><BR>(1)错误代码描述:
<BR><BR><CCID_NOBR>
<TABLE align=center border=1 borderColorDark=#ffffff
borderColorLight=black cellPadding=2 cellSpacing=0 width=550>
<TBODY>
<TR>
<TD bgColor=#e6e6e6 class=code><PRE><CCID_CODE><Critical> <WebLogicServer> <000364> <Server failed during initialization.
Exception:java.lang.SecurityException: Authentication for user username denied
java.lang.SecurityException: Authentication for user username denied.</CCID_CODE></PRE></TD></TR></TBODY></TABLE></CCID_NOBR><BR><BR>(2)问题发生时机:
<BR><BR>在JBuilder上运行Weblogic Server时,在Weblogic 6.x+ http:7001页上。
<BR><BR>(3)产生原因: <BR><BR>在JBuilder里用户名、密码填写错误。 <BR><BR>(4)解决方法:
<BR><BR>选择Tools→Configure Servers,左边选择Weblogic Server
6.x+,右边选择Custom标签,检查用户名和密码是否正确。 <BR><BR><B>3.Deployment of Web
application failed;</B> <BR><BR>(1)错误代码描述: <BR><BR><CCID_NOBR>
<TABLE align=center border=1 borderColorDark=#ffffff
borderColorLight=black cellPadding=2 cellSpacing=0 width=550>
<TBODY>
<TR>
<TD bgColor=#e6e6e6 class=code><PRE><CCID_CODE>Exception:weblogic.management. ApplicationException: Prepare failed. Task Id = 0
Module: TestWebApp Error: weblogic.j2ee.DeploymentException: Cannot deploy
ServletContext(id=2545674,name=TestWebApp,context-path=/TestWebApp) from
C:\bea\user_projects\mydomain\ myserver\upload\TestWebApp\
TestWebApp.war on myserver
because there is already a webapp named
ServletContext(id=5684736,name=TestWeb App,contextpath=/
TestWebApp) loaded from C:\Documents and
Settings\spati\jbproject\ TestWebApp\TestWebApp, which is using the context path
/TestWebApp.</CCID_CODE></PRE></TD></TR></TBODY></TABLE></CCID_NOBR><BR><BR>(2)问题发生时机:
<BR><BR>部署WAR文件的时候。 <BR><BR>(3)产生原因:
<BR><BR>可能是已经在Weblogic上部署了一个相同名称的应用了。 <BR><BR>(4)解决方法:
<BR><BR>选择Project——>Project
Properties,选择Server标签,在Services列表里先选上jsp/servlet,把右边的Map project
webapps at
runtime的勾去掉,就可以安全的部署了。如果问题还存在的话,就只有重新建一个Web应用程序,然后把程序都拷贝到新的应用上再部署了。
<BR><BR><B>4. NameNotFound Exception from test client。</B>
<BR><BR>(1)错误代码描述如下: <BR><BR><CCID_NOBR>
<TABLE align=center border=1 borderColorDark=#ffffff
borderColorLight=black cellPadding=2 cellSpacing=0 width=550>
<TBODY>
<TR>
<TD bgColor=#e6e6e6 class=code><PRE><CCID_CODE>javax.naming.NameNot FoundException: Unable to resolve 'TestSes' Resolved:
''Unresolved:'TestSes'; remaining name 'TestSes'</CCID_CODE></PRE></TD></TR></TBODY></TABLE></CCID_NOBR><BR><BR>(2)问题发生时机如下:
<BR><BR>部署完EJB JAR文件后,运行TestClient的时候。 <BR><BR>(3)产生原因如下:
<BR><BR>TestClient不能找到EJB的JNDI名。 <BR><BR>(4)解决方法如下:
<BR><BR>打开Weblogic Server
Console检查部署是否有错,在Deployments——>EJB里找到EJB的模块名。检查名称后点击右边窗口的Deploy,如果JAR部署正确,右边窗口的Deployment状态是True。
<BR><BR><B>5.test client run failed。</B> <BR><BR>(1)错误代码描述如下:
<BR><BR><CCID_NOBR>
<TABLE align=center border=1 borderColorDark=#ffffff
borderColorLight=black cellPadding=2 cellSpacing=0 width=550>
<TBODY>
<TR>
<TD bgColor=#e6e6e6 class=code><PRE><CCID_CODE>javax.naming.Communication Exception. Root exception is
java.net.ConnectException:
t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect;
No available router to destination</CCID_CODE></PRE></TD></TR></TBODY></TABLE></CCID_NOBR><BR><BR>(2)问题发生时机如下:
<BR><BR>部署完EJB JAR文件后,运行TestClient的时候。 <BR><BR>(3)产生原因如下:
<BR><BR>TestClient和Weblogic通信出现问题。 <BR><BR>(4)解决方法如下:
<BR><BR>如果你的Weblogic是在别的主机上或者端口号改变了,请在TestSesTestClient.java里修改原来的有关主机名或端口的代码。
<BR><BR>到现在为止,你已经可以搭建一个J2EE环境,并且基本上了解EJB在JBuilder上的实现了。那么就赶快上机试试吧!
<BR><BR>(责任编辑 <CCID_NOBR><A
href="mailto:huangxf@staff.ccidnet.com">Sunny</A></CCID_NOBR>)
</SPAN>
<P align=center> <BR><SPAN class=content01><A class=content01
href="http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27801&pageNO=2"><<上一页</A></SPAN>
<A class=content01
href="http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27801&pageNO=1">1</A>
<A class=content01
href="http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27801&pageNO=2">2</A>
<FONT color=#ff0000>3</FONT> </P></TD></TR><!-- 包含文章结束--></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=580>
<TBODY>
<TR>
<TD><A class=content
href="http://market.ccidnet.com/pub/disp/Column?columnID=380"><FONT
color=#0000ff>“中国IT市场情报中心”会员注册优惠月</FONT></A></TD></TR></TBODY></TABLE><!-- 包含相关文章开始-->
<TABLE align=center border=0 cellPadding=0 cellSpacing=0
style="BORDER-BOTTOM: #e2e3e4 1px solid; BORDER-LEFT: #e2e3e4 1px solid; BORDER-RIGHT: #e2e3e4 1px solid; BORDER-TOP: #e2e3e4 1px solid"
width=580>
<TBODY>
<TR>
<TD bgColor=#e2e3e4 class=content height=21>相关文章</TD></TR>
<TR>
<TD bgColor=#ffffff>
<TABLE border=0 cellPadding=2 cellSpacing=2 class=Name02
width="100%">
<TBODY>
<TR>
<TD height=23><IMG height=7
src="如何搭建J2EE开发环境(3).files/a_nav.gif" width=7><A class=Name02
href="http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27718&pageNO=1">
我的Java开发之路</A> <SPAN class=content01>(2002.10.15)</SPAN></TD></TR>
<TR>
<TD height=23><IMG height=7
src="如何搭建J2EE开发环境(3).files/a_nav.gif" width=7><A class=Name02
href="http://developer.ccidnet.com/pub/disp/Article?columnID=316&articleID=27624&pageNO=1">
项目经验:J2EE OA项目开发日记</A> <SPAN
class=content01>(2002.10.14)</SPAN></TD></TR>
<TR>
<TD height=23><IMG height=7
src="如何搭建J2EE开发环境(3).files/a_nav.gif" width=7><A class=Name02
href="http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27619&pageNO=1">
用ANT构造Application</A> <SPAN
class=content01>(2002.10.14)</SPAN></TD></TR>
<TR>
<TD height=23><IMG height=7
src="如何搭建J2EE开发环境(3).files/a_nav.gif" width=7><A class=Name02
href="http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27618&pageNO=1">
提高EJB性能的十大技巧</A> <SPAN
class=content01>(2002.10.14)</SPAN></TD></TR>
<TR>
<TD height=23><IMG height=7
src="如何搭建J2EE开发环境(3).files/a_nav.gif" width=7><A class=Name02
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -