User: starksm
Date: 01/06/25 00:18:06
Modified: src/examples/org/jboss/docs/interest InterestClient.java
build.xml
Log:
Update the jndi.properties to use the full specification of the
provider url and object factory packages.
Revision Changes Path
1.2 +3 -16 manual/src/examples/org/jboss/docs/interest/InterestClient.java
Index: InterestClient.java
===================================================================
RCS file:
/cvsroot/jboss/manual/src/examples/org/jboss/docs/interest/InterestClient.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InterestClient.java 2001/06/20 20:59:56 1.1
+++ InterestClient.java 2001/06/25 07:18:05 1.2
@@ -1,6 +1,5 @@
package org.jboss.docs.interest;
-import java.util.Properties;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
@@ -8,13 +7,8 @@
import org.jboss.docs.interest.InterestHome;
/** This simple application tests the 'Interest' Enterprise JavaBean which is
- implemented in the package 'com.web_tomorrow.interest'. For this to work, the
+ implemented in the package 'org.jboss.docs.interest'. For this to work, the
Bean must be deployed on an EJB server.
-
- IMPORTANT: If you want to test this in a real client-server
- configuration, this class goes on the client; the URL of the naming provider
- specifed in the class must be changed from 'localhost:1099' to the URL of the
- naming service on the server
*/
class InterestClient
{
@@ -23,21 +17,14 @@
the result of the calculation.
*/
public static void main(String[] args)
- {
- // Set up the naming provider; this may not always be necessary, depending
- // on how your Java system is configured.
- Properties env = new Properties();
- env.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
- env.setProperty("java.naming.provider.url", "localhost:1099");
- env.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming,org.jnp.interfaces");
-
+ {
// Enclosing the whole process in a single `try' block is not an ideal way
// to do exception handling, but I don't want to clutter the program up
// with catch blocks
try
{
// Get a naming context
- InitialContext jndiContext = new InitialContext(env);
+ InitialContext jndiContext = new InitialContext();
System.out.println("Got context");
// Get a reference to the Interest Bean
1.3 +3 -1 manual/src/examples/org/jboss/docs/interest/build.xml
Index: build.xml
===================================================================
RCS file: /cvsroot/jboss/manual/src/examples/org/jboss/docs/interest/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.xml 2001/06/25 01:42:42 1.2
+++ build.xml 2001/06/25 07:18:05 1.3
@@ -17,6 +17,7 @@
>
<classpath path="${classpath}" />
<include name="org/jboss/docs/interest/*.java" />
+ <exclude name="org/jboss/docs/interest/InterestServlet.java" />
</javac>
</target>
@@ -75,8 +76,9 @@
<target name="interest-client" depends="compile">
<java classname="org.jboss.docs.interest.InterestClient" fork="yes">
<classpath>
- <pathelement path="${classpath}"/>
+ <pathelement path="${classpath}"/>
<pathelement location="${build.classes.dir}"/>
+ <pathelement location="${src.resources}"/>
</classpath>
</java>
</target>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development