Javax.naming.NameAlreadyBoundException: localhome is already
Hi,
I'm trying to install a clustered environment. I was able to startup the ff:
1. NodeManager = port 24101
2. Admin Server = 24102
However, when i want to startup the managed servers, i'm getting an error....
The WebLogic Server did not start up properly.
Exception raised:
'weblogic.management.configuration.ConfigurationException: -
with nested exception:
[javax.naming.NameAlreadyBoundException: localhome is already bound]'
Reason: weblogic.server.ServerLifecycleException:
weblogic.management.configuration.ConfigurationException: -
with nested exception:
[javax.naming.NameAlreadyBoundException: localhome is already bound]
Where do you think is the problem?. is there something to do with my configuration of the weblogic? SOS please.
You're adding the entry "ou=people,dc=company,dc=co,dc=in" and not an entry under "ou=people,dc=company,dc=co,dc=in".
The dn of the new entry should be something like "cn=Sai Krishna,ou=people,dc=company,dc=co,dc=in" when you call ctx.bind(dn,...)
Similar Messages
-
Jndi-name javax.naming.NameAlreadyBoundException:
Hi,
I am getting the following error while deploying a CMP Bean. Initially
this started to deploy, but later when I recompiled the source files
and tried to deploy again, I get the following errors.
In fact I am tired of trying to see what's actually happening.
Your immediate response is highly appreciated.
thanks and regards,
F S Joseph
Unable to deploy EJB: country from Country.jar:
weblogic.ejb20.WLDeploymentException: Unable to bind EJB Home
Interface to the JNDI name: ejb.CountryHome. The error was:
javax.naming.NameAlreadyBoundException: Failed to bind remote object
(ClusterableRemoteRef(127.0.0.1
null)/292 [cashnet.ejb.CountryHome+javax.ejb.EJBHome+weblogic.ejb.QueryHome+weblogic.ejb20.interfaces.QueryHandler+weblogic.ejb20.interfaces.RemoteHome])
to replica aware stub at CountryHome(ClusterableRemoteRef(127.0.0.1
[127.0.0.1/291])/291 [cashnet.ejb.CountryHome+javax.ejb.EJBHome+weblogic.ejb.QueryHome+weblogic.ejb20.interfaces.QueryHandler+weblogic.ejb20.interfaces.RemoteHome]);
remaining name 'ejb'
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
at weblogic.jndi.internal.ServerNamingNode_WLStub.bind(Unknown
Source)
at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:359)
at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:353)
at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:951)
at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1302)
at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:342)
at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:1509)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:970)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:957)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1074)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:956)
at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1302)
at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:342)
at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:1509)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:970)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:957)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1074)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:700)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
failed application Country on cashnetserverthere is already an ejb with this name!
this is set in weblogic-ejb-jar.xml
Ronak Parekh wrote:
Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
Unable to bind EJB Home Interface to the JNDI name: Organization. The error
was:
javax.naming.NameAlreadyBoundException: Organization is already bound;
remaining
name 'com.sempire.builder.business_component'
<<no stack trace available>> -
Javax.naming.NameAlreadyBoundException:
Hi
I am getting following error while
starting managed server (admin server is already running)
in a clustered environment.
"javax.naming.NameAlreadyBoundException:
AuditTopic is already bound; remaining name 'com.bea.wlpi' "
even though there is only one entry for "AuditTopic" in config.xml
I have attached config.xml with this post.
here is some portion of the server console
=================================================================
<Oct 1, 2003 7:41:26 PM IST> <Notice> <AI> <000000> <Started WebLogic Integration
- AI Ser
ver version 7.0.2.0>
javax.naming.NameAlreadyBoundException: AuditTopic is already bound; remaining
name 'com.b
ea.wlpi'
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:26
3)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:23
0)
at weblogic.jndi.internal.ServerNamingNode_WLStub.bind(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:358)
at javax.naming.InitialContext.bind(InitialContext.java:353)
at com.bea.wlpi.server.init.BPMInitBean.ejbCreate(Unknown Source)
at com.bea.wlpi.server.init.BPMInitBean_ddwui7_Impl.ejbCreate(BPMInitBean_ddwui7_I
mpl.java:122)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:1
51)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:188)
at weblogic.ejb20.manager.StatelessManager.initializePool(StatelessManager.java:37
5)
at weblogic.ejb20.deployer.EJBDeployer.initializePools(EJBDeployer.java:1507)
at weblogic.ejb20.deployer.EJBDeployer.start(EJBDeployer.java:1392)
at weblogic.ejb20.deployer.EJBModule.start(EJBModule.java:391)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:1039
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1
025)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplicat
ions(SlaveDeployer.java:617)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:376)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(Deployme
ntManagerServerLifeCycleImpl.java:235)
at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:65)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:832)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:300)
at weblogic.Server.main(Server.java:32)
weblogic.ejb20.WLDeploymentException: AuditTopic is already boundjavax.ejb.CreateException
: AuditTopic is already bound
at com.bea.wlpi.server.init.BPMInitBean.ejbCreate(Unknown Source)
at com.bea.wlpi.server.init.BPMInitBean_ddwui7_Impl.ejbCreate(BPMInitBean_ddwui7_I
mpl.java:122)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:1
51)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:188)
at weblogic.ejb20.manager.StatelessManager.initializePool(StatelessManager.java:37
5)
at weblogic.ejb20.deployer.EJBDeployer.initializePools(EJBDeployer.java:1507)
at weblogic.ejb20.deployer.EJBDeployer.start(EJBDeployer.java:1392)
at weblogic.ejb20.deployer.EJBModule.start(EJBModule.java:391)
=================================================================
Thanks in advance.
Vijay
[config.xml]In config.xml remove the <Application></Application> tag for Ejb.
Application Deployed="" Name=""
Path="">
<EJBComponent Name="" Targets="" URI=""/> </Application>
gary <[email protected]> wrote:
Hi guys, hope you can help:
I had to change the packages of some ejbs and now when I try to deploy
the new .jar file I get the error below. I have tried deleting the ejb's
off the server, rebooted the server and nothing seems to work. Any help
would be appreciated. (Weblogic version 6.1)
Thanks in advance,
Gary
Unable to deploy EJB: quizinterface from etvquiz-ejb.jar:
Unable to bind a cluster-aware stateless session EJBObject to the name:
channel4.quizinterface_EO. Please ensure that the jndi-name in the weblogic-ejb-jar.xml
is correct. The error was:
javax.naming.NameAlreadyBoundException: Can't rebind anything but a replica-aware
stub to a name that is currently bound to a replica-aware stub; remaining
name ''
<<no stack trace available>>
>
<Nov 1, 2002 1:57:46 PM GMT> <Error> <Management> <Error deploying application
.\config\mydomain\app
lications\etvquiz: java.lang.reflect.UndeclaredThrowableException> -
Javax.naming.NameAlreadyBoundException [LDAP: error code 68
I am getting the below Error when I am trying to add the entry into the LPAD Server.
javax.naming.NameAlreadyBoundException: [LDAP: error code 68 - Entry Already Exists]; remaining name 'ou=People,dc=company,dc=co,dc=in'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_bind(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
at javax.naming.InitialContext.bind(Unknown Source)
at com.test.CreateUser.main(CreateUser.java:54)
I am using the following sample program to test this.
public class CreateUser {
public static void main(String[] args) {
java.util.Hashtable env = new java.util.Hashtable();
env.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
env.put( javax.naming.Context.PROVIDER_URL, "ldap://c-4966:62260");
env.put( javax.naming.Context.SECURITY_AUTHENTICATION, "simple");
env.put( javax.naming.Context.SECURITY_PRINCIPAL, "cn=Directory Manager");
env.put( javax.naming.Context.SECURITY_CREDENTIALS, "test");
String dn = "ou=People,dc=company,dc=co,dc=in";
try {
// create DirContext
DirContext ctx = new InitialDirContext(env);
// Attributes for new entry
Attributes attrs = new BasicAttributes();
Attribute attr = new BasicAttribute("objectclass");
attr.add( 0, "top" );
attr.add( 1, "person" );
attr.add( 2, "organizationalPerson" );
attr.add( 3, "inetorgperson" );
attrs.put(attr);
System.out.println("1...........");
attrs.put("cn", "Sai Krishna");
attrs.put("sn", "Potluri");
attrs.put("givenName","Sia Potluri");
attrs.put("uid","saipotluri");
attrs.put("userPassword", "balaji");
/*attr = new javax.naming.directory.BasicAttribute("mail");
attr.add( 0, "[email protected]" );
attr.add( 1, "[email protected]" );
attrs.put( attr );
attrs.put( "telephonenumber", "111-1111-3333" );*/
System.out.println("2...........");
ctx.bind(dn, attrs);
} catch ( javax.naming.NamingException ex ) {
System.err.println("Fail to Add Entry\n");
ex.printStackTrace();
Any help is highly appreciated.
Thanks in Advance
DARMAYou're adding the entry "ou=people,dc=company,dc=co,dc=in" and not an entry under "ou=people,dc=company,dc=co,dc=in".
The dn of the new entry should be something like "cn=Sai Krishna,ou=people,dc=company,dc=co,dc=in" when you call ctx.bind(dn,...) -
Javax.naming.NameAlreadyBoundException: Failed to bind remote object
I am getting an error while deploying wli-ejbs.ear file. This ear uses oracle thin drivers to connect to database. But while deploying i am receiving an error as below. Can anyone please help me to solve this problem?
Deployer:149033]preparing application wli-ejbs on managed2_cvf01
[Deployer:149033]preparing application wli-ejbs on managed1_cvf01
[Deployer:149033]prepared application wli-ejbs on managed1_cvf01
[Deployer:149033]prepared application wli-ejbs on managed2_cvf01
[Deployer:149033]activating application wli-ejbs on managed1_cvf01
[Deployer:149033]activating application wli-ejbs on managed2_cvf01
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application wli-ejbs on cvf01_cluster.: weblogic.management.DeploymentException:
Exception:weblogic.management.ApplicationException: activate failed for calendar/oracle
Module: calendar/oracle Error: Exception activating module: EJBModule(calendar/oracle,status=PREPARED)
Unable to deploy EJB: RemoteCalendarBean from calendar/oracle:
[EJB:011008]Unable to bind EJB Home Interface to the JNDI name: RemoteCalendarBean.
javax.naming.NameAlreadyBoundException: Failed to bind remote object (ClusterableRemoteRef(704752282736664516S:172.24.206.163:[7003,7003,7004,7004,7003,7004,-1,0,0]:172.24.206.163:7003,172.24.206.163:7003:cvf01:managed1_cvf01 null)/948 [com.bea.wli.calendar.api.BusinessCalendarHome+javax.ejb.EJBHome+weblogic.ejb20.interfaces.RemoteHome]) to replica aware stub at RemoteCalendarBean(ClusterableRemoteRef(704752282736664516S:172.24.206.163:[7003,7003,7004,7004,7003,7004,-1,0,0]:172.24.206.163:7003,172.24.206.163:7003:cvf01:managed1_cvf01 [704752282736664516S:172.24.206.163:[7003,7003,7004,7004,7003,7004,-1,0,0]:172.24.206.163:7003,172.24.206.163:7003:cvf01:managed1_cvf01/944, -8505871579836432025S:172.24.206.163:[7005,7005,7006,7006,7005,7006,-1,0,0]:172.24.206.163:7003,172.24.206.163:7003:cvf01:managed2_cvf01/1008])/944 [com.bea.wli.calendar.api.BusinessCalendarHome+javax.ejb.EJBHome+weblogic.ejb20.interfaces.RemoteHome]); remaining name ''
at weblogic.rmi.cluster.ClusterableRemoteObject.onBind(ClusterableRemoteObject.java:177)
at weblogic.jndi.internal.BasicNamingNode.bindHere(BasicNamingNode.java:347)
at weblogic.jndi.internal.ServerNamingNode.bindHere(ServerNamingNode.java:124)
at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:291)
at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.java:279)
at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:386)
at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1141)
at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1385)
at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:631)
at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3315)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2194)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2167)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2503)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2421)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2138)
at weblogic.management.deploy.slave.SlaveDeployer.commitUpdate(SlaveDeployer.java:676)
at weblogic.drs.internal.SlaveCallbackHandler$2.execute(SlaveCallbackHandler.java:35)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)run the sync.bat file as mentioned in the instructions...
or through EBCC(select sampleportal-project dir, app name "sampleportal")...
good luck
Vijay
"ellen" <[email protected]> wrote:
>
I installed sampleportal and did all the changes according to the documents,
when
the server started, there is this error:
Unable to deploy EJB: CatalogWebService from catalogwe.jar:
Unable to bind EJB Home Interface to the JNDI name: sampleportal.BEA_commerce.CatalogWebService.
The error was: javax.naming.nameAlreadyBoundException: Failed to bind remote
object...to
replica aware stub at CatalogWebService; remaining name'sampleportal.BEA_commerce'
After the server started with the above error, I tried to run the app, here
is what
occured:
PortalPersistenceManager: portal'sampleportal/sampleportal' not found.
Has anybody seen this before?
Ellen -
JMS cluster and happen JMS Queue Exception javax.naming.NameAlreadyBoundExc
Hi,
Sorry I not sure how to setup JMS cluster in WLS 10.3.2. We have two manager server in two machine. And will join into one cluster. After configure the JMS module & JMS server. We found it only can work in one server. And will faill in another server. And reply the error message as below :
Any one can help to tell me why one server success. And other is fail !
javax.naming.NameAlreadyBoundException: JMS_Queue_misdel_a is already bound; rem
aining name ''
at weblogic.jndi.internal.BasicNamingNode.bindHere(BasicNamingNode.java:357)
at weblogic.jndi.internal.ServerNamingNode.bindHere(ServerNamingNode.java:140)
at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:317)
at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.jav
==> config for JMS
<jms-server>
<name>JMS_Server_cim_a</name>
<target>ebowls05</target>
<persistent-store xsi:nil="true"></persistent-store>
<hosting-temporary-destinations>true</hosting-temporary-destinations>
<temporary-template-resource xsi:nil="true"></temporary-template-resource>
<temporary-template-name xsi:nil="true"></temporary-template-name>
<message-buffer-size>-1</message-buffer-size>
<expiration-scan-interval>30</expiration-scan-interval>
</jms-server>
<jms-server>
<name>JMS_Server_cim_b</name>
<target>ebowls06</target>
<persistent-store xsi:nil="true"></persistent-store>
<hosting-temporary-destinations>true</hosting-temporary-destinations>
<temporary-template-resource xsi:nil="true"></temporary-template-resource>
<temporary-template-name xsi:nil="true"></temporary-template-name>
<message-buffer-size>-1</message-buffer-size>
<expiration-scan-interval>30</expiration-scan-interval>
</jms-server>
<migratable-target>
<name>ebowls06 (migratable)</name>
<notes>This is a system generated default migratable target for a server. Do
not delete manually.</notes>
<user-preferred-server>ebowls06</user-preferred-server>
<cluster>ebouatCluster</cluster>
</migratable-target>
<migratable-target>
<name>ebowls05 (migratable)</name>
<notes>This is a system generated default migratable target for a server. Do
not delete manually.</notes>
<user-preferred-server>ebowls05</user-preferred-server>
<cluster>ebouatCluster</cluster>
</migratable-target>
<jms-system-resource>
<name>JMS_ConnFactory_cim</name>
<target>ebouatCluster</target>
<descriptor-file-name>jms/JMS_ConnFactory_cim/JMS_ConnFactory_cim-jms.xml</d
escriptor-file-name>
</jms-system-resource>
<jms-system-resource>
<name>JMS_Queue_promis</name>
<target>ebouatCluster</target>
<sub-deployment>
<name>JMS_Queue_promis@JMS_Server_cim_a</name>
<target>JMS_Server_cim_a</target>
</sub-deployment>
<sub-deployment>
<name>JMS_Queue_promis@JMS_Server_cim_b</name>
<target>JMS_Server_cim_b</target>
</sub-deployment>
<descriptor-file-name>jms/JMS_Queue_promis/JMS_Queue_promis-jms.xml</descrip
tor-file-name>
</jms-system-resource>
<jms-system-resource>
<name>JMS_Template_cim</name>
<target>ebouatCluster</target>
<descriptor-file-name>jms/JMS_Template_cim/JMS_Template_cim-jms.xml</descrip
tor-file-name>
</jms-system-resource>
<jms-system-resource>
<name>JMS_Queue_misdel_a</name>
<target>ebouatCluster</target>
<sub-deployment>
<name>JMS_Queue_misdel_a@JMS_Server_cim_a</name>
<target>JMS_Server_cim_a</target>
</sub-deployment>
<sub-deployment>
<name>JMS_Queue_misdel_a@JMS_Server_cim_b</name>
<target>JMS_Server_cim_b</target>
</sub-deployment>
<descriptor-file-name>jms/JMS_Queue_misdel_a/JMS_Queue_misdel_a-jms.xml</des
criptor-file-name>
</jms-system-resource>
<jms-system-resource>
<name>JMS_Queue_misdel_b</name>
<target>ebouatCluster</target>
<sub-deployment>
<name>JMS_Queue_misdel_b@JMS_Server_cim_a</name>
<target>JMS_Server_cim_a</target>
</sub-deployment>
<sub-deployment>
<name>JMS_Queue_misdel_b@JMS_Server_cim_b</name>
<target>JMS_Server_cim_b</target>
</sub-deployment>
<descriptor-file-name>jms/JMS_Queue_misdel_b/JMS_Queue_misdel_b-jms.xml</des
criptor-file-name>
</jms-system-resource>1 - JMS clustering is an advanced concept, and, in most cases, uses "distributed queues". In case you haven't already, I highly recommend reading the JMS chapter of the new book "Professional Oracle WebLogic" as well as the related chapters in the JMS Programmer's Guide in the edocs.
2 - The basic problem below is that you have two different queues that have matching JNDI names, but are in the same cluster.
3 - The config snippet supplied below does not include the queue configuration. Queue configuration is embedded within the referenced module files.
4 - Please ensure that you follow configuration best practices, as per: http://download.oracle.com/docs/cd/E15523_01/web.1111/e13738/best_practice.htm#CACJCGHG -
I have collected the following code from "http://www.concentric.net/~adhawan/tutorial/"
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.NameAlreadyBoundException;
import javax.naming.directory.*;
import java.util.*;
public class MakeRoot {
final static String ldapServerName = "localhost";
final static String rootdn = "cn=Manager, o=jndiTest";
final static String rootpass = "secret";
final static String rootContext = "o=jndiTest";
public static void main( String[] args ) {
// set up environment to access the server
Properties env = new Properties();
env.put( Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory" );
env.put( Context.PROVIDER_URL, "ldap://" + ldapServerName + "/" );
env.put( Context.SECURITY_PRINCIPAL, rootdn );
env.put( Context.SECURITY_CREDENTIALS, rootpass );
try {
// obtain initial directory context using the environment
DirContext ctx = new InitialDirContext( env );
// now, create the root context, which is just a subcontext
// of this initial directory context.
ctx.createSubcontext( rootContext );
} catch ( NameAlreadyBoundException nabe ) {
System.err.println( rootContext + " has already been bound!" );
} catch ( Exception e ) {
System.err.println( e );
}I am using the ldap server at here:
http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe
My slap.conf is:database bdb
suffix "dc=jndiTest"
rootdn "cn=Manager,dc=jndiTest"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory ./data
# Indices to maintain
index objectClass eqWhile running this code:
ldap://localhost:389/
javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - ob
jectClass: value #0 invalid per syntax]; remaining name 'dc=jndiTest'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_createSubcontext(Unknown
Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.createSubcontext(Unk
nown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.createSubcontext(Unk
nown Source)
at javax.naming.InitialContext.createSubcontext(Unknown Source)
at MakeRoot.main(MakeRoot.java:35)It's obviously connecting with the given credentials and provider url. But then why is it not working?
Any help would highly appreciated. Thanks in advance.That is right I agree. And I guess that happened because I was trying to doing different permutation-combination with the naming scheme and I forgot to update slapd.conf. And even after made that change it was showing the same error. The poster forgot to mention to include java.schema. That change made it work finally.
Thanks for your reply. -
Help needed - javax.naming.NameNotFoundException:
Hi,
I am writing a stateless local session bean that is invoked within an EJB,
it deploys fine,
console
16:52:58,719 INFO [EjbModule] Deploying LocalRuleEngine
but when I run it I get NameNotFoundException,
javax.naming.NameNotFoundException: LocalRuleEngine not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
this is mapping files,
jboss.xml,
<?xml version="1.0"?>
<jboss>
<enterprise-beans>
<message-driven>
<ejb-name>DistributionManager</ejb-name>
<destination-jndi-name>queue/dr</destination-jndi-name>
<resource-ref>
<res-ref-name>jms/QCF</res-ref-name>
<jndi-name>ConnectionFactory</jndi-name>
</resource-ref>
</message-driven>
<session>
<ejb-name>LocalRuleEngine</ejb-name>
<jndi-name>ejb/LocalRuleEngine</jndi-name>
</session>
</enterprise-beans>
</jboss>ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>DistributionManager</ejb-name>
<ejb-class>com.test.DataDistributionManager</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
<ejb-local-ref>
<ejb-ref-name>ejb/LocalRuleEngine</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.test.LocalRuleEngineHome</local-home>
<local>com.test.LocalRuleEngine</local>
<ejb-link>LocalRuleEngine</ejb-link>
</ejb-local-ref>
<resource-ref>
<res-ref-name>jms/QCF</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
<session>
<ejb-name>LocalRuleEngine</ejb-name>
<local-home>com.test.LocalRuleEngineHome</local-home>
<local>com.test.LocalRuleEngine</local>
<ejb-class>com.test.RuleEngineBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>this is my local home interface
package com.test;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface LocalRuleEngineHome extends EJBLocalHome{
public LocalRuleEngine create() throws CreateException;
}this is my local interface
package com.test;
import java.util.List;
import javax.ejb.EJBLocalObject;
import com.raytheon.jetts.domain.DomainClass;
import com.raytheon.jetts.domain.DomainKey;
public interface LocalRuleEngine extends EJBLocalObject {
public List findMatchingRules(DomainClass itemToDistribute);
public List createRules(DomainKey domainKey, List<Address> addresses);
public ImAdapter getImAdapter();
public void setImAdapter(ImAdapter imAdapter);
public List getAddressesFromRules(List<DistributionRule> distributionRules);
public void addRule(DistributionRule distributionRule);
public void removeRule(DomainKey domainKey);
public String testReturn();
}this is my bean,
package com.test;
import java.rmi.RemoteException;
import java.util.List;
import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EJBLocalHome;
import javax.ejb.EJBLocalObject;
import javax.ejb.RemoveException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.jetts.domain.DomainClass;
import com.raytheon.jetts.domain.DomainKey;
public class RuleEngineBean implements SessionBean, LocalRuleEngine{
private static Log log = LogFactory.getLog(DataDistributionManager.class);
private LocalRuleEngine engine;
private LocalRuleEngineHome localHome;
public RuleEngineBean(){}
public List findMatchingRules(DomainClass itemToDistribute){
List list = null;
return list;
public String testReturn(){
return new String("is home time");
public List createRules(DomainKey domainKey, List<Address> addresses){
List list = null;
return list;
public ImAdapter getImAdapter(){
ImAdapter imAdapter = null;
return imAdapter;
public void setImAdapter(ImAdapter imAdapter){
public List getAddressesFromRules(List<DistributionRule> distributionRules){
List list = null;
return list;
public void addRule(DistributionRule distributionRule){
public void removeRule(DomainKey domainKey){
public void ejbCreate(String info){}
public void setSessionContext(SessionContext context){}
public void remove(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove(){}
public void ejbCreate(){}
public boolean isIdentical(EJBLocalObject obj)throws EJBException{
return true;
public EJBLocalHome getEJBLocalHome(){
return localHome;
public Object getPrimaryKey()throws EJBException{
return new Object();
}Thanks for any help on this,
Jp.sorry about that,
I'm doing this,
InitialContext ctx = new InitialContext();
LocalRuleEngineHome localRuleEngineHome = (LocalRuleEngineHome)ctx.lookup("ejb/LocalRuleEngine");
//localRuleEngineHome = (LocalRuleEngineHome)PortableRemoteObject.narrow(objref, LocalRuleEngineHome.class);
LocalRuleEngine lre = localRuleEngineHome.create();
log.info(lre.testReturn()); -
Hi
I have a startup class which needs to access a local entity bean. It used to work
in weblogic 6.1, i am currently migrating to 8.1 and i get a Link Exception. I
tried to make the startup class as a listener with in the application (EAR), it
still complains.
Since it worked in 6.1 i am sure there should be a way for a startup class to
access a local EJB, please help, i have seen lot of posting regarding this issue
in the newsgroup but no clear answer.
Any one who faced this problem before and had it solved please do repsond ASAP.
U can mail to me at [email protected]
Thanks
SijuAre you sure the EJB deployed with that JNDI name?
Can you show me your weblogic-ejb-jar.xml?
-- Rob
Arun wrote:
Hi,
Do we have a solution for this problem? I am encountering this problem with an
Applciation Lifecycle Listener. I have deployed this Listener with my EAR file
and it accesses a local ejb (stateful) in its postStart() method. The JNDI look
up is causing a LinkException (root exception is NameNotFoundException)
I am not at my work PC but the application was something like this.
"weblogic-application.xml" had something like.
<listener>
<listener-class>MyListener</listener-class>
<listener-uri>mylistener.jar</listener-uri>
</listener>
where mylistener.jar was placed at the root of the EAR file.
MyListener.java was something like,
import weblogic.application.ApplicationLifecycleListener;
import weblogic.application.ApplicationLifecycleEvent;
import mypackage.mylocalhome;
import mypackage.mylocal;
import javax.naming.*;
public class MyListener extends ApplicationLifecycleListener {
public void preStart(ApplicationLifecycleEvent evt) {
System.out.println
("MyListener(preStart) -- we should always see you..");
} // preStart
public void postStart(ApplicationLifecycleEvent evt) {
try {
System.out.println
("MyListener(postStart) -- we should always see you..");
Context ctx = new InitialContext();
mylocalhome localhome = (mylocalhome)ctx.lookup("MYLOCALJNDINAME");
mylocal localobj = localhome.create();
} catch (Exception e) {
e.printStackTrace();
} // postStart
public void preStop(ApplicationLifecycleEvent evt) {
System.out.println
("MyListener(preStop) -- we should always see you..");
} // preStop
public void postStop(ApplicationLifecycleEvent evt) {
System.out.println
("MyListener(postStop) -- we should always see you..");
} // postStop
public static void main(String[] args) {
System.out.println
("MyListener(main): in main .. we should never see you..");
} // main
Any help is greatly appreciated.
Thanks,
Arun
Rob Woollen <[email protected]> wrote:
We'll need some more info. Can you show me your weblogic-ejb-jar.xml,
the code you are using to lookup the bean, and the full exception?
-- Rob
Siju Hariharan wrote:
Hi
I have a startup class which needs to access a local entity bean. Itused to work
in weblogic 6.1, i am currently migrating to 8.1 and i get a Link Exception.I
tried to make the startup class as a listener with in the application(EAR), it
still complains.
Since it worked in 6.1 i am sure there should be a way for a startupclass to
access a local EJB, please help, i have seen lot of posting regardingthis issue
in the newsgroup but no clear answer.
Any one who faced this problem before and had it solved please do repsondASAP.
U can mail to me at [email protected]
Thanks
Siju -
Javax.naming.NameNotFoundException in Jdeveloper 10g
HI,
I just migrate my source code from Jdeveloper 9 to Jdeveloper 10g. Since then, all my codes do not work properly.
I cut and pasted from old version data-source.xml to 10g data-source.xml. However, when I run the project, I got javax.naming.NameNotFoundException:jdbc/mbciwebEjb not found. I check my data-souces.xml which in embeded-oc4j/config folder. The definition is there.
Can anybody help me?
Thanksganesh wrote:
using WLS 8.1:
deployed all session beans in jar1
deployed all entity beans in jar2
session code trying to jndi lookup entity bean, using localhome interface.
the entity bean descriptor has <local-jndi-name> tag specified
but jndi lookup from session bean is failing, is this because session bean is in different jar.
what is solution please
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: While trying to look up /app/ejb/ejbs2.jar#UserEntity/local-home in /app/ejb/ejbs1.jar#UserManagerBean.; remaining name '/app/ejb/ejbs2/jar#UserEntity/local-home'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:869)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:148)Are these two jar deployed in the same application or different
applications?
-- Prasad -
Help, help! I have a problem:
javax.naming.NameNotFoundException: No object bound for java:comp/env/configuratorDataSource
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:355)
at oracle.toplink.jndi.JNDIConnector.connect(Unknown Source)
at oracle.toplink.sessions.DatabaseLogin.connect(Unknown Source)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown Source)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown Source)
at oracle.toplink.threetier.ConnectionPool.buildConnection(Unknown Source)
at oracle.toplink.threetier.ConnectionPool.startUp(Unknown Source)
at oracle.toplink.threetier.ServerSession.connect(Unknown Source)
at oracle.toplink.publicinterface.DatabaseSession.login(Unknown Source)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
at com.configurator.datasource.ToplinkClientSessionManager.<init>(ToplinkClientSessionManager.java:18)
at com.configurator.datasource.ToplinkClientSessionManager.getInstance(ToplinkClientSessionManager.java:33
at com.configurator.persistence.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:16)
at com.configurator.ConfiguratorServiceMediatorImpl.getModelsFromDB(ConfiguratorServiceMediatorImpl.java:3
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:595)
code:
initialContext = new InitialContext();
LocalStatelessREHome localHome = (LocalStatelessREHome)initialContext.lookup("java:comp/env/StatelessREBean");
in web.xml:
<ejb-local-ref>
<ejb-ref-name>StatelessREBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.re.stateless.ejb.LocalStatelessREHome</local-home>
<local>com.re.stateless.ejb.LocalStatelessRE</local>
<ejb-link>StatelessREBean</ejb-link>
</ejb-local-ref>
Any help will be appreciated! Thanks in advance.Try removing the JNDI fully qualified name (i.e. java:comp\env\) Use the name of your bean to lookup.
It worked for me when i used to get a similar exception. -
EJB Local Interfaces / javax.naming.NamingException
Hi!
I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
Opening the JSP i get the following error message:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
Here's my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<display-name>oc4jJAR</display-name>
<enterprise-beans>
<session>
<display-name>TesterEJB</display-name>
<ejb-name>TesterEJB</ejb-name>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-class>oc4jtest.TesterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<description/>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params/>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<display-name>oc4jWAR</display-name>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<description/>
<filter-class>oc4jtest.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>test</servlet-name>
<display-name>test</display-name>
<jsp-file>/test.jsp</jsp-file>
</servlet>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/test.jsp</welcome-file>
</welcome-file-list>
<ejb-local-ref>
<ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
</ejb-local-ref>
</web-app>
What's wrong?
Comments would be appreciated!
Thanks!
Peter
PS: The application runs fine on Sun's Reference Implementation!Hi!
I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
Opening the JSP i get the following error message:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
Here's my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<display-name>oc4jJAR</display-name>
<enterprise-beans>
<session>
<display-name>TesterEJB</display-name>
<ejb-name>TesterEJB</ejb-name>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-class>oc4jtest.TesterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<description/>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params/>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<display-name>oc4jWAR</display-name>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<description/>
<filter-class>oc4jtest.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>test</servlet-name>
<display-name>test</display-name>
<jsp-file>/test.jsp</jsp-file>
</servlet>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/test.jsp</welcome-file>
</welcome-file-list>
<ejb-local-ref>
<ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
</ejb-local-ref>
</web-app>
What's wrong?
Comments would be appreciated!
Thanks!
Peter
PS: The application runs fine on Sun's Reference Implementation! -
Javax.naming.NoInitialContextException: Cannot instantiate
IHi,
Iam trying to run my first application on WEBLOGIC SERVER 8.1. I have already deploed class file on server.i have already set path for my client jar .
When I use my client run on JDK to access the application.
I got following errror::::
Naming Error: catch block of getInitalContext()
javax.naming.NoInitialContextException: Cannot instantiate
class: weblogic.jndi.WLInitialContextFactory [Root exception is
java.lang.ClassNotFoundException:
weblogic.jndi.WLInitialContextFactory]
from catch block of jMenuItem1
error from NamingException.getMessage()is: Cannot instantiate
class: weblogic.jndi.WLInitialContextFactory
HERE IS THE CODE FOR CLIENT:
import java.awt.event.*;
import javax.rmi.*;
import java.rmi.*;
import javax.swing.event.*;
import javax.swing.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.util.Hashtable;
import java.util.Properties;
import javax.ejb.CreateException;
import org.omg.CosNaming.*;
import java.util.Hashtable;
import weblogic.jndi.*;
//import javax.weblogic.jndi.WLInitialContext;
public class Client {
public static void main(String[] args){
Context context= null;
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL,"t3://localhost:7001");
try{
context = new InitialContext(h);
Object obj = context.lookup("ServerObject"); //Server ejb-name
System.out.println(obj.getClass());
ServerHome serverhome =(ServerHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("ServerObject"),ServerHome.class);
Server server = serverhome.create();
String Message = JOptionPane.showInputDialog("Enter Your Message");
JOptionPane.showMessageDialog(null, server.performAction(Message) );
catch(Exception e){
JOptionPane.showMessageDialog(null ,"Exception is " +e);
code for bean:::::::
//package EJBExample;
import javax.ejb.*;
import java.rmi.*;
import javax.swing.*;
public class ServerBean implements SessionBean
private SessionContext stx;
//In following five methods create is by contract others to be implemented by Container
public void ejbCreate(){}
public void ejbRemove(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void setSessionContext(SessionContext ctx)hi
Am facing the problem whenever i run the client jsp definitly run the first time but next time i get the particular error please let me clear about this error i m attaching the client code and also error screen..
client jsp
<%UserInfoSB objUserInfoSB;
System.out.println("########## 2 #########");
Properties props= System.getProperties();
System.out.println("########## 3 #########");
Context ctx = new InitialContext(props);
System.out.println("########## 4 #########");
props.put(Context.INITIAL_CONTEXT_FACTORY, "Weblogic.jndi.WlInitialContextFactory");
props.put(Context.PROVIDER_URL,"t3://localhost:7001");
System.out.println("########## 5 #########");
UserInfoSBHome objUserInfoSBHome =(UserInfoSBHome) ctx.lookup("UserInfoSBHome");
System.out.println("########## 6 #########");
objUserInfoSB = objUserInfoSBHome.create();
System.out.println("########## 7 #########");
//objUserInfoSB.processInterfaceUserHistoryDetails(objUserDetailVO);
ArrayList alResult = objUserInfoSB.processInterfaceGetAllUserDetail();
objUserInfoSB.remove();
System.out.println("########## 8 #########");
%>
It is error which i am facing plz let me clear
NoInitialContextException: Cannot instantiate class: Weblogic.jndi.WlInitialContextFactory. Root exception is java.lang.ClassNotFoundException: Weblogic.jndi.WlInitialContextFactory
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:186)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:41)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.(InitialContext.java:195)
at jsp_servlet._jsp._epfindia._mydata.__userdisplayall._jspService(__userdisplayall.java:374)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151) -
Javax.naming.AuthenticationException
Hi :
I am getting the following exception when I am trying to lookup
a MBeanHome
java.lang.IllegalArgumentException: Invalid user name or password, javax.naming.AuthenticationException
[Root exception is java.lang.SecurityException: attempting to add an object which
is not an instance of java.security.Principal to a Subject's Principal Set]
at weblogic.management.Helper.getMBH(Helper.java:62)
at weblogic.management.Helper.getAdminMBeanHome(Helper.java:28)
at TestMBeanHome.main(TestMBeanHome.java:9)
I am doing a simple lookup, like so...
MBeanHome home = (MBeanHome)Helper.getAdminMBeanHome("system", "password", "t3://localhost:7001"
The login/password work through the console.
Any help is appreciated
--krishYou should be able to get the MBeanHome with the Helper class if the system
username, pwd are correct.
unless you have put some ACLs on MBeans and restricted the access for some
specific users....
Are you sure that your system user's password is: "password" ?
I wrote a small prog to check the method and it returns the mbeanHome
correctly ....
I have attached it below ....
hope it helps,
Mihir
import weblogic.management.Helper;
import weblogic.management.*;
import javax.management.*;
public class useHelper {
public static String SERVER_NAME="myserver";
public static weblogic.management.MBeanHome localHome = null;
public static weblogic.management.MBeanHome adminHome = null;
public static void main(String[] args) {
useHelper.find("172.17.26.33", 7001, "mihirk00");
public static void find(String host, int port, String password) {
String url = "t3://" + host + ":" + port;
try {
localHome = (MBeanHome)Helper.getMBeanHome("system", password,
url, SERVER_NAME);
adminHome = (MBeanHome)Helper.getAdminMBeanHome("system",
password, url);
System.out.println("Local and Admin Homes " + "found using the
Helper class: " + localHome + " " + adminHome);
} catch (IllegalArgumentException iae) {
System.out.println("Illegal Argument Exception: " + iae);
"Krish Garimella" <[email protected]> wrote in message
news:[email protected]...
>
Hi :
I am getting the following exception when I am trying to lookup
a MBeanHome
java.lang.IllegalArgumentException: Invalid user name or password,javax.naming.AuthenticationException
[Root exception is java.lang.SecurityException: attempting to add an
object which> is not an instance of java.security.Principal to a Subject's PrincipalSet
at weblogic.management.Helper.getMBH(Helper.java:62)
at weblogic.management.Helper.getAdminMBeanHome(Helper.java:28)
at TestMBeanHome.main(TestMBeanHome.java:9)
I am doing a simple lookup, like so...
MBeanHome home = (MBeanHome)Helper.getAdminMBeanHome("system", "password","t3://localhost:7001"
The login/password work through the console.
Any help is appreciated
--krish -
Javax.naming.NoInitialContextException! Urgent help needed
Hi All
I'm using Oracle Application Server(OC4J) for J2EE. i created an application of Stateless Session Bean & tested on j2sdkee1.3.1, & it is working fine on it. Same Application (an .ear file) i deployed on OC4J. But it is giving an error NoInitialContextException, lookup fails here.
Application contains method getEchoString(String):String & a index.jsp page calling a bean's method.
Can anybody tell me the solution to get handle of beans home interface for calling method.
Already i've wasted many days for this. Plz help. It's urgent
Thanks in AdvanceTo the best of my knowledge, the 'javax.naming.ldap' package is fairly new, and is only included in the most recent distributions of the JNDI API. I know that this package is included with J2SDK 1.3, and I can also confirm that the very latest JNDI distribution (from http://java.sun.com/products/jndi/#download) contains the package.
Good luck,
-Derek
Maybe you are looking for
-
HT4722 Can Final Cut Pro be purchased and downloaded more than once?
Can final cut pro be purchased and downloaded on more than one computer?
-
Problem in construct_url and firing outbound plug data passing
Fnds, I have been posting this but no one was able to help me specifically. I am calling other WDA2 from WDA1.. i used construct_url, and called the outbound plug which is type suspend. so wda2 is opening in same browser. .good. but i want to send a
-
Pages export in Word format problem
A Pages-5 file exported as a Word file opens in MS Word as one would expect but crashes or fails to open in Open Office 4 which opens all other .doc/.docx files perfectly. The new version of Pages must be doing something strange to the Word format a
-
IMovie crashed, file lost, yet still shows up numerically?
I have the same problem. I had edited for a total of 26 hours until my iMovie was 99% done. I imported a photo and not only did iMovie crash unexpectedly, but the entire computer shut off (I was at 100% battery and plugged in). The computer restarted
-
Hi all, How the deletion indicator IKPF-LSTAT is set for the PI documents ? Many thanks for your time ! Thanks and Regards Shashank