<LearnWLS> How to setup Weblogic official sample - EJB

1. Download weblogic installer from www.oracle.com



2. Install Weblogic


$ sudo xhost + # in case current user cannot access Xwindow

access control disabled, clients can connect from any host


$ java -jar fmw_12.2.1.0.0_wls.jar


# it needs full installation with samples

# then weblogic isinstalled at $ORACLE_HOME/wlserver

# and the samples isat $ORACLE_HOME/wlserver/samples

# btw, for more details please reference to index.html under

$ORACLE_HOME/wlserver/samples/server



3. Create a Weblogic domain


$ cd $ORACLE_HOME/oracle_common/common/bin

$ sh config.sh #configuration wizard


# create a domain by default at $ORACLE_HOME/user_projects/domains/base_domain



4. Start the domain


$ cd $ORACLE_HOME/user_projects/domains/base_domain

$ startWebLogic.sh &     # start domain


URL - http://localhost:8001/console/



5. Customize example properties


$ cd $ORACLE_HOME/wlserver/samples/server/examples/src

$ vi examples.properties


# for example:

<bea.home=@BEA_HOME

<wl.home=@WL_HOME

---

>bea.home=/home/weblogic/orahome # ORACLE_HOME

>wl.home=${bea.home}/wlserver

13,14c13,14

<wls.hostname=@SERVER_HOST

<wls.port=@LISTEN_PORT

---

>wls.hostname=localhost

> wls.port=8001

16,17c16,17

<wls.username=@DOMAIN_USERNAME

<wls.password=@DOMAIN_USER_PASSWORD

---

>wls.username=scott

>wls.password=tiger000

22c22

<examples.home.dir=@WL_HOME/samples/server/examples

---

>examples.home.dir=${wl.home}/samples/server/examples



6. Prepare data forDerby


$ cd $ORACLE_HOME/wlserver/samples/server

$ . ./setExamplesEnv.sh # set environment variables


$ cd examples/common/ddl

$ ant db.setup.derby    # Generating Derby Data



7. Define Data source in console


Name -examples-demoXA

JNDI Name - examples-dataSource-demoXAPool

Database Type - Derby

Database Driver - Derby's Driver (Type 4 XA) Versions: Any



8. Define Messaging


JMS Servers - examplesJMSServer

JMS Modules - examplesJMSModule


# then define resources under the module

1) Queue

Name- weblogic.examples.ejb30.ExampleQueue

JNDI Name - weblogic.examples.ejb30.ExampleQueue

2) ConnectionFactory

Name - weblogic.examples.ejb30.QueueConnectionFactory

JNDI Name - weblogic.examples.ejb30.QueueConnectionFactory


Note:

A Subdeployment is needed for Queue and Connection Factory, however, I always encounter

following issues, so I have to use a workaround: create 2 Subdeployments respectively for them.

>>>>>

weblogic.management.configuration.ServerMBeanImpl cannot be cast to weblogic.management.configuration.JMSServerMBean

<<<<<

or

>>>>>

TheSubDeploymentMBean examplesSub in deployment examplesJMSModule canonly be targeted to one JMSServerMBean because an entity that canonly be targeted to a single JMS server (for example a queue, topicor quota) has a sub-deployment-name element with value examplesSub

<<<<<



9. Prepare EJB sample


$ cd $ORACLE/wlserver/samples/server/examples/src/examples/ejb/ejb30

$ ant build

$ ant deploy



10. Run the sample


URL - http://localhost:8001/reviewService/





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值