[Beginners Corner] - why ? - exception: error during JRMP connection establishmen
by reckless_jack
hi can nyone tell me why problem mentioned in subject line is occuring
below here my code;
package example;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Properties;
public class HelloClient {
public static void main(String[ ] args) throws Exception {
System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
System.setProperty("java.naming.provider.url","jnp://localhost:1099");
System.setProperty("java.naming.factory.url.pkgs","org.jboss.namimg:org.jboss.jnp.interfaces");
System.setProperty("jnp.socketFactory","org.jnp.interfaces.TimedSocketFactory");
System.setProperty("jnp.timeout","10000");
Properties prop=System.getProperties( );
Context ctx=new InitialContext( prop );
Object obj=ctx.lookup("Hello");
HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow( obj, HelloHome.class);
Hello hello=home.create( );
System.out.println( hello.hello() );
hello.remove( );
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089953#4089953
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089953
18 years
[JBoss Seam] - Using multiple Databases in Embeddable EJB 3.0 Container
by bravefencer
Hello,
My Question is, how i can install more then one database in the Embeddable EJB Container and then switch between them via Seam?
All the databases have the same database schema, and therefore the same entity bean Mapping classes per Table in the source code(Mabye one single database has a subset of it, but thats not a must).
So for one database theres no problem in configure the jboss-beans.xml like this:
...
org.hsqldb.jdbcDriver
jdbc:hsqldb:.
sa
java:/DefaultDS
0
10
1000
50000
...
and int the persistence.xml i configure an persistence-unit like this:
<persistence-unit name="manager1">
<jta-data-source>java:/DefaultDS</jta-data-source>
</persistence-unit>
if i deploy my application, then the Tomcat 6.0 Server binds the Name for the Database automatically and maps the Tables to the corresponding entity Classes also automatically.
So now i have tried to configure a second database. I have extended the jboss-beans.xml , and persistence.xml to configure a second bean and second persistence unit, for the second database. And in my Session Beans i refer to the second persistence unit, like that:
@Persistencecontext(unit-name="nameOfSecondPersistenceUnit")
Entitymanager em;
But this doesn't work. if i looked at the logs from the Tomcat server, then i saw that the Entity Bean Mappings only made for the first Database, but not for the second.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089950#4089950
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089950
18 years