读了java persistence in hibernate的第二章,当然要调试一下ejb3的helloword的例子,怎么着也要看看ejb3中是怎么搞ejb 3 entity bean +jpa通过hibernate 的entity manager和hibernate结合在一起。
废话说了一堆,下面是怎么干:
先去http://www.hibernate.org/400.html去下helloword,
然后展开,进目录
开个窗口敲ant startdb ,打开了HSQL
在开个窗口敲 ant run ,按说应该出hello word了,
可惜出错了,一个错误信息 [java] Exception in thread "main" javax.naming.NameNotFoundException: Messa
geHandlerBean not bound
运行出错,jndi问题,看hello word的代码 发现这么一句 EJB3StandaloneBootstrap.scanClasspath(“helloword-ejb3\build")
估计是这句的问题, 将其改成EJB3StandaloneBootstrap.scanClasspath()
在ant run 一遍 通过 hello world出来了。
就是没想明白按说设helloword-ejb3\build 也应该对,但就是不认,那位有什么见解可以讲讲
废话说了一堆,下面是怎么干:
先去http://www.hibernate.org/400.html去下helloword,
然后展开,进目录
开个窗口敲ant startdb ,打开了HSQL
在开个窗口敲 ant run ,按说应该出hello word了,
可惜出错了,一个错误信息 [java] Exception in thread "main" javax.naming.NameNotFoundException: Messa
geHandlerBean not bound
运行出错,jndi问题,看hello word的代码 发现这么一句 EJB3StandaloneBootstrap.scanClasspath(“helloword-ejb3\build")
估计是这句的问题, 将其改成EJB3StandaloneBootstrap.scanClasspath()
在ant run 一遍 通过 hello world出来了。
就是没想明白按说设helloword-ejb3\build 也应该对,但就是不认,那位有什么见解可以讲讲