[JNDI/Naming/Network] - looking up from JBoss to a remote application over IIOP
by tof@svim
I have some trouble on porting my applications from Sun One to Jboss .
My EJB application plays as a client , another application running on a JVM outside of EJB container plays as a server.
Classes implementing the server application compile with their remote interfaces, building stubs for remote calling over IIOP .
These classes bind on JNDI.
JNDI service runs outside the application server, using ?orbd? as supported by JDK.
Using Sun One , I create initial context with Sun cosnaming properties on both server side (to bind classes) and client side (in EJB to look up remote classes). And it runs.
Here are code samples
Server:
anonymous wrote : String urlOrbd = "iiop://servername:3800"
| Properties env = new Properties();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
| env.put(Context.PROVIDER_URL, urlOrbd);
| Context initialNamingContext = new InitialContext(env);
| String bindServerClass = ("myService");
| Class myClass = Class.forName("MyServerClass");
| Object obj = myClass.newInstance();
| initialNamingContext.rebind(bindServerClass, obj);
Client (EJB running in application server container):
anonymous wrote : Context ic;
| Object objref;
|
| Properties env = new Properties();
| String serverUrl = "iiop://servername:3800"
| Properties env = new Properties();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
| env.put(Context.PROVIDER_URL, serverUrl);
|
| MyServerClassRemInt remote;
| String service = " myService ";
| ic = new InitialContext(env);
| objref = ic.lookup(servizio);
|
| remote =( MyServerClassRemInt) PortableRemoteObject.narrow(objref, MyServerClassRemInt.class );
| remote.myMethod();
|
|
Now I have to deploy my EJB application on JBoss 4.0.4 GA. Is there someone who can tell me how I have to bind my server classes and lookup for them from my EJB client ?
I tried using ?com.sun.jndi.cosnaming.CNCtxFactory? initial context property for both binding and lookup and I get a ?NameNotFoundException? on looking up the initial context.
I tried using ?com.sun.jndi.cosnaming.CNCtxFactory? initial context property for binding and ?org.jnp.interfaces.NamingContextFactory? initial context property for lookup and I get a ?InvalidClassException?, the class I look up for is invalid for deserialization.
I tried using ?org.jnp.interfaces.NamingContextFactory? initial context property for both binding and lookup and I get a ?InvalidClassException?, the class I look up for is invalid for deserialization.
I tried using ?org.jnp.interfaces.NamingContextFactory? initial context property for binding and ?com.sun.jndi.cosnaming.CNCtxFactory? initial context property for lookup and I get a ?NameNotFoundException? on looking up the initial context.
I tried any option about syntax about defining name or looking up for them. It never runs.
I?ll be glad for any suggestion or reference.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971557#3971557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971557
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - EJB 3 Application Deployment Error - JBoss 4.0.4
by souzatg
Good Morning everyone!
I am experiencing an issue here while deploying an EJB3 + Seam + JSF application. During deployment i receive a NullPointerException on the org.jboss.ejb3.Ejb3Deployment.getPersistenceUnitDeployment method. I am using Jboss AS 4.0.4 GA Patch 1. A snippet from the stack trace follows. Does anyone know how can i solve this?
Thanks a lot!
Thiago Souza
| 10:16:54,673 INFO [Environment] Hibernate 3.2 cr2
| 10:16:54,688 INFO [Environment] hibernate.properties not found
| 10:16:54,688 INFO [Environment] Bytecode provider name : javassist
| 10:16:54,720 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
| 10:16:55,047 INFO [Ejb3Configuration] found EJB3 Entity bean: br.com.marquise.balanca.model.beans.Usuario
| 10:16:55,047 INFO [Ejb3Configuration] found EJB3 Entity bean: br.com.marquise.balanca.model.beans.Permissao
| 10:16:55,063 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
| 10:16:55,235 INFO [Configuration] Reading mappings from resource: META-INF/orm.xml
| 10:16:55,235 INFO [Ejb3Configuration] [PersistenceUnit: entityManager] no META-INF/orm.xml found
| 10:16:55,391 INFO [AnnotationBinder] Binding entity from annotated class: br.com.marquise.balanca.model.beans.Usuario
| 10:16:56,078 INFO [EntityBinder] Bind entity br.com.marquise.balanca.model.beans.Usuario on table USUARIOS
| 10:16:56,093 WARN [AnnotationBinder] Hibernate does not support SequenceGenerator.initialValue()
| 10:16:56,328 INFO [AnnotationBinder] Binding entity from annotated class: br.com.marquise.balanca.model.beans.Permissao
| 10:16:56,328 INFO [EntityBinder] Bind entity br.com.marquise.balanca.model.beans.Permissao on table PERMISSOES
| 10:16:56,515 INFO [CollectionBinder] Mapping collection: br.com.marquise.balanca.model.beans.Usuario.permissoes -> PERMISSOES
| 10:16:56,655 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
| 10:16:56,671 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
| 10:16:57,436 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
| With the Partitioning, OLAP and Data Mining options
| 10:16:57,436 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.1.0.5.0
| 10:16:57,530 INFO [Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
| 10:16:57,592 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
| 10:16:57,592 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
| 10:16:57,608 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
| 10:16:57,608 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
| 10:16:57,608 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
| 10:16:57,608 INFO [SettingsFactory] JDBC batch size: 15
| 10:16:57,608 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
| 10:16:57,608 INFO [SettingsFactory] Scrollable result sets: enabled
| 10:16:57,608 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
| 10:16:57,608 INFO [SettingsFactory] Connection release mode: auto
| 10:16:57,608 INFO [SettingsFactory] Default batch fetch size: 1
| 10:16:57,608 INFO [SettingsFactory] Generate SQL with comments: disabled
| 10:16:57,608 INFO [SettingsFactory] Order SQL updates by primary key: disabled
| 10:16:57,608 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
| 10:16:57,623 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
| 10:16:57,623 INFO [SettingsFactory] Query language substitutions: {}
| 10:16:57,623 INFO [SettingsFactory] Second-level cache: enabled
| 10:16:57,623 INFO [SettingsFactory] Query cache: disabled
| 10:16:57,623 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
| 10:16:57,623 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
| 10:16:57,623 INFO [SettingsFactory] Structured second-level cache entries: disabled
| 10:16:57,639 INFO [SettingsFactory] Echoing all SQL to stdout
| 10:16:57,639 INFO [SettingsFactory] Statistics: disabled
| 10:16:57,639 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
| 10:16:57,639 INFO [SettingsFactory] Default entity-mode: pojo
| 10:16:57,748 INFO [SessionFactoryImpl] building session factory
| 10:16:58,654 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
| 10:16:58,654 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 10:16:58,763 WARN [ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:ear=MarquiseWebBalApp.ear,jar=MarquiseEJBModel.jar,name=UserActionBean,service=EJB3
| 10:16:58,763 WARN [ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:ear=MarquiseWebBalApp.ear,jar=MarquiseEJBModel.jar,name=UserActionBean,service=EJB3
| 10:16:58,763 WARN [ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:ear=MarquiseWebBalApp.ear,jar=MarquiseEJBModel.jar,name=UserManagerBean,service=EJB3
| 10:16:58,763 WARN [ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:ear=MarquiseWebBalApp.ear,jar=MarquiseEJBModel.jar,name=UserManagerBean,service=EJB3
| 10:16:58,763 INFO [SessionFactoryImpl] closing
| 10:16:58,779 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=MarquiseEJBModel.jar
| java.lang.NullPointerException
| at org.jboss.ejb3.Ejb3Deployment.getPersistenceUnitDeployment(Ejb3Deployment.java:253)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971550#3971550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971550
19 years, 7 months