Running the Example

You can run the client in the same window you used to build it by issuing the following command:

C:styejbexamplesday05>java -Djava.naming.factory.initial= weblogic.jndi
.WLInitialContextFactory -Djava.naming.provider.url= t3://localhost:7001  -classpath 
%CLASSPATH%;.uild day05.Client
					

Running the client produces the following output:

Starting Client . . .
Looking up the sign on component via JNDI.
Creating an signOn object.
Testing a successful login/password
Testing an invalid login/password
day05.InvalidLoginException: Invalid login/password
Start server side stack trace:
day05.InvalidLoginException: Invalid login/password
 at day05.SignOnEJB.validateUser(SignOnEJB.java:52)
 at day05.SignOnEJB_keukm7_EOImpl.validateUser(SignOnEJB_keukm7_EOImpl.java:37)
 at day05.SignOnEJB_keukm7_EOImpl_WLSkel.invoke(Unknown Source)
 at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
 at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke (ReplicaAwareServerRef.java:93)
 at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
 at weblogic.rmi.internal.BasicExecuteRequest.execute (BasicExecuteRequest.java:22)
 at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End  server side stack trace
Removing the signOn object.

For convenience, we provide the script runClientJBoss.bat under the c:styejbexamplesday05 directory to run the sample client.

The following steps describe how to package, deploy the SignOn component and run the sample client for the JBoss server:

1.
Package and deploy the component in a new command window using the following commands:

C:>cd styejbexamples
C:styejbexamples>setEnvJBoss.bat
C:styejbexamples>cd day05
C:styejbexamplesday05>buildJBoss.bat
							

The preceding steps package the enterprise bean files into an ejb-jar file day05_SignOn.jar. In addition, they copy this ejb-jar file into the deployment area of JBoss. They also build the sample client.

2.
Start JBoss in a new command window using the following commands:

C:>cd styejbexamples
C:styejbexamples>setEnvJBoss.bat
C:styejbexamples>startJBoss.bat
							

Note

You can verify the bean deployment by using the JBoss management console (http://localhost:8080/jmx-console). Look for day05_SignOn.jar in the console. If the day05_SignOn.jar is properly deployed, you should see it under the jboss.j2ee section as shown in Figure 5.4.

Figure 5.4. Enterprise bean deployment verification in JBoss.


3.
You can run the sample client in the same window you used to package the bean and build the client by using the following command:

C:styejbexamplesday05>runClientJBoss.bat
							

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.255