-
1. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
joelvogt Aug 21, 2002 11:36 PM (in response to tonik)A client will need the jar files from jboss/client and will also need a jndi.properties or you will have to set up the initial context given a hashset of your own properties
-
2. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
tonik Aug 22, 2002 11:34 AM (in response to tonik)ok thaks but
how do i load the jndi.properties is it just included in the classpath i tried something like:
java -classpath CMPtest.jar:concurrent.jar:jaas.jar:jboss-j2ee.jar:jboss-jmx.jar:jbossmq-client.jar:jbosssx-client.jar:jnp-client.jar:jndi.properties:/home/tonik/jboss-client/ test
but now I get this
java.io.FileNotFoundException: /home/tonik/config/security.properties (No such file or directory)
I dont understand why it is trying to locate a security.properties file in that directory. And is that a standard java security file or what. -
3. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
juha Aug 22, 2002 12:54 PM (in response to tonik)you need a remote interface on the client -- local interfaces work only within the server VM.
-
4. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
tonik Aug 23, 2002 8:38 AM (in response to tonik)I am actually running the test client on the same server.
Hmm I wonder what this is , as this is not my own server ip number
java.security.AccessControlException: access denied (java.net.SocketPermission 230.0.0.4 connect,accept,resolve)
and how do i add the jndi.properties into the test client
this is what the default jndi.properties looks like in /jboss/server/default/conf
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
# Do NOT uncomment this line as it causes in VM calls to go over
# RMI!
# java.naming.provider.url=localhost
heeeeeeeeeeeeeeeeeelp
thanks,kiitos -
5. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
tonik Aug 23, 2002 8:45 AM (in response to tonik)/*
* test.java
*
* Created on 18 August 2002, 22:43
*/
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import net.tonik.*;
import java.rmi.RMISecurityManager;
/**
*
* @author tonik
*/
public class test {
/** Creates a new instance of test */
public test() { }
/** This simple application tests the 'Interest' Enterprise JavaBean whi
ch is
implemented in the package 'org.jboss.docs.interest'. For this to work, the
Bean must be deployed on an EJB server.
*/
/** This method does all the work. It creates an instance of the Interest EJB
on
the EJB server, and calls its `calculateCompoundInterest()' method, then pri
nts
the result of the calculation.
*/
public static void main(String[] args)
{
// 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
// System.setProperty("java.naming.factory.initial",
// "org.jnp.interfaces.NamingContextFactory");
// System.setProperty("java.naming.provider.url",
// "localhost:1099");
// if(System.getSecurityManager() == null) {
// System.setSecurityManager(new RMISecurityManager());
// }
try
{
// Get a naming context
InitialContext jndiContext = new InitialContext();
System.out.println("Got context");
// Get a reference to the Interest Bean
System.out.println("Going for the reference");
Object ref = jndiContext.lookup("/test/CMPEntity");
System.out.println("Got reference");
// Get a reference from this to the Bean's Home interface
CMPEntityHome home = (CMPEntityHome)
PortableRemoteObject.narrow(ref, CMPEntityHome.class);
// Create an Interest object from the Home interface
CMPEntity cmpentityhome = home.create("1","tonik","tonik","tonik");
// call the calculateCompoundInterest() method to do the calculation
System.out.println("helloooooooooo");
}
catch(Exception e)
{
System.out.println(e.toString());
}
} -
6. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
tonik Aug 23, 2002 9:04 AM (in response to tonik)that was what my client looks like (previous message)
it never gets past this:
Object ref = jndiContext.lookup("/test/CMPEntity");
why -
7. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
adrian.brock Aug 23, 2002 1:49 PM (in response to tonik)As Juha said above, you can only access an EJBLocalHome
from inside the same java virtual machine (JVM).
If you do something like "java TestClient" you are
starting a new JVM.
To access the entity from a different JVM you need
a remote interface.
Regards,
Adrian -
8. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
tonik Aug 23, 2002 1:55 PM (in response to tonik)ok thanks will try that then I assumed it was one virtual machine per java installation