运行news例子说ejb没有绑定错误

07-04-18 springwinder
我用的是jboss4.0,myeclipse;

而且在myeclipse中jdonframework.xml中的:

<ejbService name="newsManager">

<jndi name="NewsManager" />

<ejbLocalObject class="news.ejb.NewsManagerLocal"/>

</ejbService>

<ejbService name="opinionManager">

<jndi name="OpinionManager" />

<ejbLocalObject class="news.ejb.OpinionManagerLocal"/>

</ejbService>

ejbService显示为红色;说需要用...匹配它;

是这里的错误吗?

11:00:22,828 INFO [STDOUT] 11:00:22,828 ERROR [EJBObjectFactory] [JdonFramework]locator error: javax.naming.NameNotFoundException: NewsManager not bound

banq
2007-04-18 15:12
如果是EJB2: 确定NewsManager的jboss.xml中JNDI名称是否是"NewsManager"

如果是EJB3, 需要将Web和EJB分别打包。比较麻烦些。

springwinder
2007-04-21 18:52
在myeclipse使用这个应用好像要建一个enterprise application project工程,里面会包括一个web工程和一个ejb的工程,好像源文件src下的文件

要分别放到web\src和ejb\src这两个工程的src下面,而且要分开方,是不是news\ejb,和news\model下的文件,还有news\Constants.java和news\jdonframework.xml要放到ejb工程的源文件下面;

而其余的文件放到web工程的源文件下面呢?

另外现在部署完后启动jboss4.0会出现下面的错误:

18:28:28,109 WARN [verifier] EJB spec violation:

Bean : TNews

Method : public String ejbCreate(String) throws CreateException

Section: 10.6.4

Warning: The return type of an ejbCreate(...) method must be the entity bean's p

rimary key type.

18:28:28,328 ERROR [MainDeployer] Could not create deployment: file:/D:/jboss-4.

0.4.GA/server/default/deploy/news.ear/newsEJB.jar/

org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile

d, see above for error messages.

at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:610)

希望能回复一下!

多谢!

banq
2007-04-23 12:40
>Method : public String ejbCreate(String) throws CreateException

Section: 10.6.4

Warning: The return type of an ejbCreate(...) method must be the entity bean's p

rimary key type.

这个错误是你的EJB代码不符合规范,使用IDE工具生成的吧,这个工具有BUG.

开发工具不要使用MyEclipse,Eclipse+JBossIDE就对付一切。

springwinder
2007-04-24 09:59
恩。banq说得没错;我现在改用jbuilder了;

现在报错如下:

09:46:48,546 ERROR [MethodInvokerUtil] [JdonFramework] method invoke IllegalArgu

mentException: java.lang.IllegalArgumentException: object is not an instance of

declaring class method argument type :[[Ljava.lang.Class;@e2f8c1], but method ar

guments value p_args type:[Ljava.lang.Object;

09:46:48,546 ERROR [Debug] news.web.NewsTypeListAction

这个错误好像有人也遇到过;但是我看那个帖子时banq说研究一下;结果就没有下文了;好像是06年的帖子了,

帖子名叫:关于部署JdonNews时的问题;

希望banq能回答一下呀!

banq
2007-04-24 16:57
可能有两个jdonframework.jar包,而且版本不一样.

springwinder
2007-04-25 09:25
09:12:23,000 INFO [ContainerDirector] <======== Jdon Framework started succes

sfully! =========>

09:12:23,015 INFO [STDOUT] start=0;count=50

09:12:23,312 ERROR [MethodInvokerUtil] Errors happened in your method:[$Proxy76.getNewsTypePage]

09:12:23,312 ERROR [MethodInvokerUtil] [JdonFramework] method invoke IllegalArgumentException: java.lang.IllegalArgumentException: object is not an instance of

declaring class method argument type :[[Ljava.lang.Class;@181d405], but method arguments value p_args type:[Ljava.lang.Object;

09:12:23,328 ERROR [STDERR]java.lang.reflect.UndeclaredThrowableException

09:12:23,328 ERROR [STDERR] at $Proxy81.getNewsTypePage(Unknown Source)

09:12:23,328 ERROR [STDERR] at news.web.NewsTypeListAction.getPageIterator(N

ewsTypeListAction.java:23)

09:12:23,328 ERROR [STDERR] at com.jdon.strutsutil.ModelListAction.execute(M

odelListAction.java:69)

09:12:23,328 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.pro

cessActionPerform(RequestProcessor.java:421)

09:12:23,328 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.pro

cess(RequestProcessor.java:226)

09:12:23,328 ERROR [STDERR] at org.apache.struts.action.ActionServlet.proces

s(ActionServlet.java:1164)

09:12:23,328 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(

ActionServlet.java:397)

09:12:23,328 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe

rvlet.java:690)

09:12:23,328 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe

rvlet.java:803)

09:12:23,328 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha

in.internalDoFilter(ApplicationFilterChain.java:290)

09:12:23,328 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha

in.doFilter(ApplicationFilterChain.java:206)

09:12:23,328 ERROR [STDERR] at com.jdon.util.SetCharacterEncodingFilter.doFi

lter(SetCharacterEncodingFilter.java:92)

09:12:23,328 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha

in.internalDoFilter(ApplicationFilterChain.java:235)

09:12:23,328 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha

in.doFilter(ApplicationFilterChain.java:206)

09:12:23,328 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilte

r.doFilter(ReplyHeaderFilter.java:96)

我又核实了一下里面就一个jdonFramework.jar包;

上面的错误是我用ex.printStackTrack()打印出来的。

banq
2007-04-26 10:26
这是JBoss4和JBoss3两个产品对EJB打包要求不同导致,现在已经更新news项目,重新下载samples包

springwinder
2007-04-26 15:05
应该是版本不同导致的;

现在打包过去后,web模块下还包含news\ejb\*,和news\model\*;

但是根据我查的一些资料看这些是不应该包含在web模块下面的;

如果ejb模块和web模块都包好的话就会出问题;

我今天把部署过去web模块下的news\ejb\*,和news\model\*手动删掉后,

错误少了一些;

感谢banq! 我重新下载一个试试!

猜你喜欢