|
|
11:35:30,815 INFO [EjbModule] Creating
11:35:30,825 INFO [EjbModule] Deploying Hello
11:35:30,835 INFO [StatelessSessionContainer] Creating
11:35:30,835 INFO [StatelessSessionInstancePool] Creating
11:35:30,835 INFO [StatelessSessionInstancePool] Created
11:35:30,845 INFO [StatelessSessionContainer] Created
11:35:30,845 INFO [EjbModule] Created
11:35:30,845 INFO [EjbModule] Starting
11:35:30,845 INFO [StatelessSessionContainer] Starting
11:35:30,905 INFO [StatelessSessionInstancePool] Starting
11:35:30,905 INFO [StatelessSessionInstancePool] Started
11:35:30,905 INFO [StatelessSessionContainer] Started
11:35:30,905 INFO [EjbModule] Started
11:35:30,905 INFO [EJBDeployer] Deployed: file:/D:/jboss-3.2.1/server/default/d
eploy/helloejb.jar
11:35:30,925 INFO [MainDeployer] Deployed package: file:/D:/jboss-3.2.1/server/
default/deploy/helloejb.jar
表明配置没有错误信息
测试的客户端代码
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.ejb.CreateException;
import java.rmi.RemoteException;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class HelloWorldClient extends JFrame implements ActionListener {
public HelloWorldClient() {
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
setTitle("EJBClient");
setSize(300,200);
Container contentPane = getContentPane();
area = new JTextArea(6,20);
subButton = new JButton("Say hello to EJB");
subButton.setActionCommand("sya");
subButton.addActionListener(this);
contentPane.add(area,"Center");
contentPane.add(subButton,"South");
}
public void actionPerformed(ActionEvent e) {
if ( e.getActionCommand().equals("sya") ) {
ejbSays = getEJBInfo();
area.append(ejbSays + "
");
}
}
public String getEJBInfo() {
try {
Context jndiContext = getInitialContext();
Object ref = jndiContext.lookup("HelloEJB");
HelloHome home = (HelloHome)PortableRemoteObject.narrow(ref,HelloHome.class);
Hello hw= home.create();
ejbSays = hw.hello();
&
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页
网友评论:(评论内容只代表网友观点,与本站立场无关!) |
阅读排行
|