设为首页 收藏本站
查看: 1068|回复: 0

[经验分享] Weblogic 10 Ejb3 Message Bean 配置 Weblogic JMS 配置 Weblogic 10 EJB3 例子安装

[复制链接]

尚未签到

发表于 2017-2-14 10:58:32 | 显示全部楼层 |阅读模式
  Weblogic 10 Ejb3 Message Bean 配置  Weblogic JMS 配置 Weblogic 10 EJB3 例子安装
  今天研究EJB3,在JBOSS环境上玩了一把,但是WAS 6.1不支持EJB3,不爽啊,就到Weblogic下面再玩玩吧。一看Weblogic 10 的安装目录里面有个EJB3的很强大的例子,嗯,心想,这个不错,省事啊,直接安装得了。
  但是令人不爽的问题是很多的,Weblogic 10 的JMS配置跟Weblogic 8 的不一样,配置了N下,也还是不能用,后台报错。
  不管了,现在我们安装把,出问题了,然后就改呗,也是一个让大家学习的过程。
  1,笨蛋式安装开始。
DSC0000.jpg

  然后点击NEXT,缺省选择
  然后点击NEXT,缺省选择
  然后点击NEXT,缺省选择
  然后点击完成。
  靠,这下问题来了。
  系统报错,报pointbase 什么manager找不到,什么问题呢,我把这个安装包给解压了开来,打开
  domain.jar/META-INF/persistence.xml的内容有如下片段。
  <properties>
      <property name="kodo.ConnectionURL" value="jdbc:pointbase:server://localhost:9092/demo"/>
      <property name="kodo.ConnectionDriverName" value="com.pointbase.jdbc.jdbcUniversalDriver"/>
      <property name="kodo.ConnectionUserName" value="examples"/>
      <property name="kodo.ConnectionPassword" value="examples"/>
      <property name="kodo.jdbc.SynchronizeMappings" value="refresh"/>
    </properties>
  一看,我明白了,原来这个默认的玩意配置的数据库是这个玩意啊,我机器上有现成的mysql,我改成mysql试试吧。把以上内容改成
  <property name="kodo.ConnectionURL" value="jdbc:mysql://localhost:3306/web"/>
      <property name="kodo.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
      <property name="kodo.ConnectionUserName" value="root"/>
      <property name="kodo.ConnectionPassword" value="admin"/>
      <property name="kodo.jdbc.SynchronizeMappings" value="refresh"/>
  重新打包回去,然后继续发布。嗯,这下好了,没这个错误了。
  我们看看mysql数据库里面发生了什么??
DSC0001.jpg

  应用给表创建了以上我选择的表了,说明利用mysql还是可以的。
  但是后台有以下输出。
  <2009-7-19 上午12时15分10秒 CST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: WatchProcessMDB is unable to conn
ect to the JMS destination: weblogic.examples.ejb30.ExampleQueue. The Error was:
weblogic.jms.common.JMSException: javax.naming.NameNotFoundException: Unable to resolve 'weblogic.jms.backend.JMSServer-
0'. Resolved 'weblogic.jms.backend'; remaining name 'JMSServer-0'
Nested exception: weblogic.jms.common.JMSException: javax.naming.NameNotFoundException: Unable to resolve 'weblogic.jms.
backend.JMSServer-0'. Resolved 'weblogic.jms.backend'; remaining name 'JMSServer-0'
Nested exception: weblogic.jms.common.JMSException: javax.naming.NameNotFoundException: Unable to resolve 'weblogic.jms.
backend.JMSServer-0'. Resolved 'weblogic.jms.backend'; remaining name 'JMSServer-0'
Nested exception: javax.naming.NameNotFoundException: Unable to resolve 'weblogic.jms.backend.JMSServer-0'. Resolved 'we
blogic.jms.backend'; remaining name 'JMSServer-0'>
119047  reviewService  INFO   [[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.
jdbc.JDBC - Shutting down connection pool.
<2009-7-19 上午12时15分33秒 CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redir
ect url is /console/console.portal?_nfpb=true&_pageLabel=AppDeploymentsControlPage.>
<2009-7-19 上午12时15分47秒 CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redir
ect url is /console/console.portal?_nfpb=true&_pageLabel=AppDeploymentsControlPage.>
<2009-7-19 上午12时26分30秒 CST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: WatchProcessMDB is unable to conn
ect to the JMS destination: weblogic.examples.ejb30.ExampleQueue. The Error was:
Can not get distribute destination information. The destination JNDI name is weblogic.examples.ejb30.ExampleQueue, the p
rovider URL is null>
0  reviewService  INFO   [[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.Runti
me - Starting BEA Kodo 4.2.0load03
0  reviewService  INFO   [[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.
JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary".
<2009-7-19 上午12时26分31秒 CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redir
ect url is /console/console.portal?_nfpb=true&_pageLabel=AppApplicationOverviewPage&AppApplicationOverviewPortlethandle=
com.bea.console.handles.AppDeploymentHandle%28%22com.bea%3AName%3DreviewService%2CType%3DAppDeployment%22%29.>
<2009-7-19 上午12时27分30秒 CST> <Warning> <JMSPool> <BEA-169808> <There was an error while making the initial connectio
n to the JMS resource named weblogic.examples.ejb30.QueueConnectionFactory from the EJB "ReviewListenerBean" inside appl
ication "reviewService". The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSP
ool:169803]JNDI lookup of the JMS connection factory weblogic.examples.ejb30.QueueConnectionFactory failed: javax.naming
.NameNotFoundException: Unable to resolve 'weblogic.examples.ejb30.QueueConnectionFactory'. Resolved 'weblogic.examples.
ejb30'; remaining name 'QueueConnectionFactory'>
  一看就明白了。JMS没有配置。那我们去给Weblogic 配置JMS吧,我打开
  public class ReviewListenerBean implements ReviewListener {
  //The JNDI name of the Queue Connection Factory referenced here is specified by the mappedName attribute of @Resource,
  //which can be overwritten in weblogic-ejb-jar.xml.
  @Resource(name = "jms/mdbQCF", mappedName = "weblogic.examples.ejb30.QueueConnectionFactory")
  private QueueConnectionFactory mdbQCF;
  //The JNDI name of the Queue  referenced here is specified by the mappedName attribute of @Resource,
  //which can be overwritten in weblogic-ejb-jar.xml.
  @Resource(name = "jms/mdbQueue", mappedName = "weblogic.examples.ejb30.ExampleQueue")
  知道了需要配置的QueueFactory是 weblogic.examples.ejb30.QueueConnectionFactory
  Queue是 weblogic.examples.ejb30.ExampleQueue
  2,配置JMS。
  第一步,创建一个JMS Server
DSC0002.jpg

  点击New
  新增一个JMS Server,
  点击NEXT ,默认选项
  点击NEXT,选择TARGET为当前的Server,如果是默认的Domain的话,应该是AdminServer
  然后点击FINISH。成功创建JMS Server.
  第二步,创建 JMS Modules。
  点击Domain Structure -- Services -- Messaging--JMS Modules
  然后点击NEW 按钮。
  NEXT ,默认选项,
  NEXT, Targets  选择 AdminServer.
  然后NEXT, FINISH.
  点击新建的 SystemModule-0,路径如下所示。
Home >Summary of JMS Servers >Summary of Store-and-Forward Agents >JMS Modules >Summary of JMS Bridge Destinations >Summary of Servers >Summary of Security Realms >Summary of Deployments >Summary of JMS Servers >JMS Modules >SystemModule-0
 
然后点击New
DSC0003.jpg
 
点击NEXT
DSC0004.jpg

  全部填写 weblogic.examples.ejb30.QueueConnectionFactory
  点击NEXT
DSC0005.jpg

  点击 “Advanced Targeting”
DSC0006.jpg

  点击“Create a New Subdeployment”
  然后点击 OK,下面有 Targets : 全不选。切记,别选。
  然后点击 Finish。
DSC0007.jpg

  点击 weblogic.examples.ejb30.QueueConnectionFactory 到Transactions Tab页,勾选 XA Connection ......选项,SAVE
  然后同样的方式新建队列。
   DSC0008.jpg
  点击NEXT,名称全部写 weblogic.examples.ejb30.ExampleQueue
  点击NEXT,然后 Subdeployments 选择刚才新建的那个。
   DSC0009.jpg
  然后点击Finish完成。
  然后重启动server吧。
  然后在IE 里面输入
  http://localhost:7001/reviewService
  欣赏WEBLOGIC自带的sample吧,
  如果这里页面是404错误,那应该是应用没有启动,需要到控制台把应用启动下就OK了。
  本文的 主要讲解的JMS的配置问题。
  作者 keyboardsun

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-342004-1-1.html 上篇帖子: weblogic控制台打到日志文件 下篇帖子: 部署webLogic之使用WebService
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表