Binding EJB from server A to jndi on server B
Can I do a thing like this:
-) I deploy an EJB on a server A.
-) I bind the EJB that is deployed on the server A to jndi on a server
B. The EJB is not deployed on server B.
-) Web client that runs on server B can lookup the EJB in its local
jndi. However all calls go to the server A.
Server A and B are not in the cluster.
Rafal
What version of WLS are you using?
Bart Jenkins, Globeflow SA
"Rafal Mantiuk" <[email protected]> wrote in message
news:[email protected]..
Can I do a thing like this:
-) I deploy an EJB on a server A.
-) I bind the EJB that is deployed on the server A to jndi on a server
B. The EJB is not deployed on server B.
-) Web client that runs on server B can lookup the EJB in its local
jndi. However all calls go to the server A.
Server A and B are not in the cluster.
Rafal
Similar Messages
-
Unable to bind EJB Home Interface to the JNDI name
Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
Unable to bind EJB Home Interface to the JNDI name:
com.sempire.builder.business
_component.Organization. The error was:
javax.naming.NameAlreadyBoundException: Organization is already bound;
remaining
name 'com.sempire.builder.business_component'
<<no stack trace available>>Slava,
In case I change the name of the jndi name to a unique name. I still get the same
problem. I checked for multiple occurences, but there aren't any.
My web.xml file is:
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>GangsterEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
<local>com.sempire.builder.business_component.Gangster</local>
</ejb-local-ref>
My weblogic-ejb-jar.xml file is:
<weblogic-enterprise-bean>
<ejb-name>GangsterEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/GangsterDB</res-ref-name>
<jndi-name>oraclePool</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Gangster_test</local-jndi-name>
</weblogic-enterprise-bean>
I do not get the problem.
Thank you
Ronak Parekh
"Slava Imeshev" <[email protected]> wrote:
Hi Ronak,
This exception means that you already have a bean
with the same JNDI name. Search your weblogic-ejb-jar.xml files
for multiple occurrences of the name and fix the problem.
Regards,
Slava Imeshev
"Ronak Parekh" <[email protected]> wrote in message
news:[email protected]...
Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
Unable to bind EJB Home Interface to the JNDI name:
com.sempire.builder.business
_component.Organization. The error was:
javax.naming.NameAlreadyBoundException: Organization is already bound;
remaining
name 'com.sempire.builder.business_component'
<<no stack trace available>> -
Undable to bind EJB Home during deploy
Hi
I'm getting an exception when I redeploy to weblogic81. I have and ear with several ejb jars in it. The following is the message I get...
Unable to bind EJB Home Interface to the JNDI name: EJBTestService. javax.naming.NameAlreadyBoundException: EJBTestService is already bound; remaining name :at weblogic.jndi.internal.BasicNamingNode.bindHere(BasicNamingNode.java:333) 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:384) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1116) at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1362) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:631)
This error doesn't always occur with the same jar in the ear. Sometimes the above jar prepares and activates fine and another one fails.
If anyone has any idea I'd appreciate feedback.Hello,
The error suggests that an object is already bound to the JNDI name.
This can happen if you have 2 or more ejbs in your EAR file wit the same JNDI name or if your application has not fully/cleanly undeployed before you try to redeploy it.
I suspect the latter is your problem. Once you have undeployed your application use the weblogic console to view your JNDI tree and make sure nothing is bound that should not be bound. Then redeploy your app. If you still have the problem check your ear does not have duplicate ejbs or ejbs using the same JNDI name. -
How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?
How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?
Reason I ask is I keep getting this error:
javax.naming.NoInitialContextException: Cannot instantiate cla
ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
oundException: weblogic.jndi.WLInitialContextFactory]
Note: I am using <bpelx:exec> as a way to execute some java program.
Essentially my java client (essentially an EJB client hosted on Oc4J) needs access to wlclient.jar since it needs access to weblogic.jndi.WLInitialContextFactory. I have a EJB client running on BPEL server hosted on Oc4J that needs to access some EJBs hosted on weblogic.
Where do I place this wlclient.jar so that BPEL PM can start peacefully and at runtime discover the InitialContextFactory classes?
Placing it in the j2ee/home/applib doesn't solve the problem. The server fails to start up if I do this
I tried placing it in BPEL-INF\lib directory ...
I still get the same exception...see below for exception dump
I verified the BPEL suitcase, and it in fact does contain the jar file wlclient.jar
integration\orabpel\domains\default\deploy contains the bpel_BPELProcess2_1.0.jar file and snapshot of that is as follows:
<PRE>
│ bpel.xml
│ BPELProcess2.bpel
│ BPELProcess2.jpr
│ BPELProcess2.wsdl
│ bpel_BPELProcess2_1.0.jar
│ build.xml
│ buildxml.copy
│ graphics.xml
│
├───BPEL-INF
│ └───lib
│ myEJB.jar
│ wlclient.jar
│
├───META-INF
│ MANIFEST.MF
│
└───output
bpel_BPELProcess2_1.0.jar
</PRE>
I tried using the BPEL-INF\jar directory...Is this something the obant automatically detects? or do I have to modify the build.xml? I created this directory and let Jdev deploy to local BPEL server->default domain handle it
#####################3
I even tried copying the wlclient.jar to
integration\orabpel\system\classes but this doesn't help since the BPEL PM fails to start if I explode this jar into this directory.
In short,where do I place the wlclient.jar so that this exception can be contained.
I edited the build.xml to point to the jar, that too didn't work, unless I made some mistake in the file
<bpelc classpath="${basedir}/BPEL-INF/classes;${home}/system/classes;${home}/lib/j2ee_1.3.01.jar;${basedir}/BPEL-INF/jar/wlclient.jar" input="${basedir}/bpel.xml" rev="${rev}" deploy="${deploy}" />
</target>
</project>
DETAILS on ERROR
I get the following error
Process "BPELProcess2" (revision "1.0") successfully compiled.
<2005-12-14 09:17:55,770> <INFO> <default.collaxa.cube.engine.deployment> Proces
s "BPELProcess2" (revision "1.0") successfully loaded.
05/12/14 09:18:36 weblogic.jndi.WLInitialContextFactory
javax.naming.NoInitialContextException: Cannot instantiate cla
ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
oundException: weblogic.jndi.WLInitialContextFactory]
05/12/14 09:18:36 at javax.naming.spi.NamingManager.getInitialContext(Nami
ngManager.java:652)
05/12/14 09:18:36 at javax.naming.InitialContext.getDefaultInitCtx(Initial
Context.java:243)
05/12/14 09:18:36 at javax.naming.InitialContext.init(InitialContext.java:
219)
05/12/14 09:18:36 at javax.naming.InitialContext.<init>(InitialContext.jav
a:195)
05/12/14 09:18:36 at com.ejb.test.MapFinder.getDefaultMapName(Map
Finder.java:37)
##################3
with the bpelx all I have is two lines of code that creates a java object and calls a method on it.
The method does this:
private String initialContextFactory = "weblogic.jndi.WLInitialContextFactory";
private String providerUrl = "t3://localhost:7001";
private String urlPkgPrefixes = "";
private String mapEjbJndiName = "ejb/mycompany/Redlands";
public String getDefaultMapName() {
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
env.put(Context.PROVIDER_URL, getProviderUrl());
if (getUrlPkgPrefixes() != null && !getUrlPkgPrefixes().equals(""))
env.put(Context.URL_PKG_PREFIXES, getUrlPkgPrefixes());
System.out.println(" " + getInitialContextFactory());
System.out.println(" " + getProviderUrl());
System.out.println(" " + getUrlPkgPrefixes());
System.out.println(" " + getEjbName());
// Get a naming context
context = new InitialContext(env);
Object ms = context.lookup(getEjbName());
MyEJBHome home = (MyEJBHome ) PortableRemoteObject.narrow(ms, MyEJBHome.class);
myEjb = home.create();
return myEjb.getDefaultName();
} catch (RemoteException re){
System.out.println(re.getCause().getMessage());
catch (Exception ex) {
ex.printStackTrace();
return null; //if unable to resolve the context factory etc...
}I did exactly as you suggested. I edited the application.xml and added this
<library path="C:\ArcGIS\test\bea\wlclient.jar"/>
I didn't add weblogic because the needed classes were all in wlclient.jar
I also edited the BASE_OB_CLASSPATH to include this jar.
Here is the result when I just start BPEL PM Server. Somehow BPEL PM doesn't like to have wlclient.jar in its classpath during startup.
Failed to create "worker" bean; exception reported is: "javax.naming.NameNotFoun
dException: remaining name: env
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:49)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:57)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.collaxa.cube.engine.ejb.impl.WorkerBean.ejbCreate(WorkerBean.java
:49)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.ejb.MessageDrivenHome.getInstance(MessageDrivenHo
me.java:1235)
at com.evermind.server.ejb.MessageDrivenHome$2.run(MessageDrivenHome.jav
a:1150)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
sableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
<2005-12-29 13:39:05,281> <ERROR> <collaxa> <ServerManager::loadAllDomains>
ORABPEL START-UP ERROR!!!!!!!!
OraBPEL run-time system failed to start due to exception:
Could not initialize jms connection pool.
Could not initialize connection pool for connection factory "java:comp/env/jms/
ollaxa/BPELInvokerQueueFactory"; the reason is remaining name: env/jms/collaxa/
PELInvokerQueueFactory.
Note: So what I did was to removed the entry from application.xml and tried with just obsetenv.bat having the wlclient.jar added to it. This too failed!!
Here is a snapshot of the error I got.
Process "BPELProcess2" (revision "1.0") successfully compiled.
<2005-12-29 13:53:11,207> <INFO> <default.collaxa.cube.engine.deployment> Proces
s "BPELProcess2" (revision "1.0") successfully loaded.
05/12/29 13:53:32 Cannot instantiate class: weblogic.jndi.WLInitialContextFactor
y
05/12/29 13:53:32 javax.naming.NoInitialContextException: Cannot instantiate cla
ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
oundException: weblogic.jndi.WLInitialContextFactory]
05/12/29 13:53:32 at javax.naming.spi.NamingManager.getInitialContext(Nami
ngManager.java:652)
05/12/29 13:53:32 at javax.naming.InitialContext.getDefaultInitCtx(Initial
Context.java:243)
05/12/29 13:53:32 at javax.naming.InitialContext.init(InitialContext.java:
219)
05/12/29 13:53:32 at javax.naming.InitialContext.<init>(InitialContext.jav
a:195)
05/12/29 13:53:32 at com.esri.adf.ejb.test.MapFinder.getDefaultMapName(Map
Finder.java:57)
05/12/29 13:53:32 at bpel.p0.ExecLetBxExe1.execute(ExecLetBxExe1.java:62)
05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__execut
eStatements(BPELXExecWMP.java:49)
05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perfo
rm(BPELActivityWMP.java:185)
05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.performActivity(Cu
beEngine.java:3398)
05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.handleWorkItem(Cub
eEngine.java:1905)
05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.message.instance.Per
formMessageHandler.handleLocal(PerformMessageHandler.java:75)
05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.handl
eLocalMessage(DispatchHelper.java:100)
05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.sendM -
How to get the JNDI name of an EJB from within itself
Hello,
I'm trying to find a way to get the JNDI name of a session bean from
within itself.
In the application I'm working on we need to support multiple
customers. In order to do that, each EJB has a normal home and remote
interface, a base class bean implementation and different children
bean implemetations for each customer (when the logic for the
customers is different). JNDI is used to get the proper implementation
based on the customer.
I've got an EJB that provides some services that are the same for all
customers, except for the fact that it contains one variable that
should have a different value depending on the customer. I don't want
to creat subclasses just for that. What I want is to be able to get
the JNDI name and set the variable based on the it.
Is there a way to get the JNDI name for the EJB from within itself?
TIA
MJHi Pradeep,
Please try referring to this post which is discussed earliar and seems its also answered.
http://forums.adobe.com/thread/504861
Thanks,
Bhasker Chari -
Calling EJB from other EJB on other J2EE Server
Can I call EJB from other EJB on other J2EE Server
Servers - Websphere 5.0
Do i require home & remote interface of that ejb on client side also
Help me, pleasethe problem is actually i require that is specific to websphere
for example i want to call a method ion that ejb
say my ejb name is myejb
so the normal way i should call is
InitialContext initialContext = new InitialContext();
Object homeObject = initialContext.lookup("ejb/MyEjbHome");
MyEJBHome myEJBHome =(MYEjbHome )javax.rmi.PortableRemoteObject.narrow(homeObjectMYEjbHome.class);
myEJB = lSHome.create();
myEJB.someMethod();
but here i am having class for home and remote available
now if other app server i am not having this classes then what to do -
EJB access problem from server A to B
hI All,
I use Weblogic 6.1 SP3 on Windows 2000:
When I am calling a Session EJB (on server B) from server A I get:
java.lang.ClassCastException: Assigning instance of class $Proxy105 to
field com.traiana.core.engine.connector.ConnectorAdaptorData#_addressData
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2266)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:110)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:123)
at
com.traiana.core.engine.connector.ejb.connectorbean.ConnectorBean_7l9wfx_EOImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Any clue ?I am able to ping my server
C:\>ping serverB
Reply from xx.xxx.xx.xxx: bytes=32 time<1ms TTL=128
Reply from xx.xxx.xx.xxx: bytes=32 time<1ms TTL=128
Reply from xx.xxx.xx.xxx: bytes=32 time<1ms TTL=128
Reply from xx.xxx.xx.xxx: bytes=32 time<1ms TTL=128
Ping statistics for xx.xxx.xx.xxx:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:>tnsping ORCL
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-OCT-2012 17:19:55
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ServerB)(PORT=1521)) (CONNECT_DATA=(SERVER=DEDICATED) (SERVICE_NAME =ORCL)))
TNS-12535: TNS:operation timed out -
Unable to invoke EJB from a BPEL process.
Hello all
I am running BPEL process manager over weblogic 8.1 App server. I am trying to invoke a simple stateless session bean from a synchronous BPEL process. I have created a WSDL for this EJB with appropriate binding and service elements.
I am able to build my BPEL sync process and deploy it. But, when I run the process and invoke the EJB, I am getting the following exception-
BPEL Fault: {http://schemas.oracle.com/bpel/extension}bindingFaultCould not create instance for home 'ClusterableRemoteRef(-3059145150938040994S:172.26.210.17:[9700,9700,-1,-1,9700,-1,-1,0,0]:myorabpel:orabpelServer [-3059145150938040994S:172.26.210.17:[9700,9700,-1,-1,9700,-1,-1,0,0]:myorabpel:orabpelServer/288])/288'; nested exception is:
java.lang.NoSuchMethodException: com.carlson.sample.HelloWorldSessionBean_n4vx3i_HomeImpl_812_WLStub.create()
I have a home interface for the EJB which has a 'create' method and my session bean has a ejbCreate method. I am using weblogic.appc to create the stubs and skeletons for the EJB.
Has anyone tried this ?? The tutorial in the download 702.bindings/EJBBinding does something similar to this. But, I am having problems with that too.
Any comments, advice, sample code will be helpful.
Thanks a bunch
- Mahesh :)I have deployed my Bean Managed Persistance Entity Bean in Weblogic 8.1 App Server. Trying to access the ejb from Synchronous BPEL process. I tried in two ways
1. By accessing the ejb directly from BPEL process, writing the following code in BPEL process
<bpelx:exec xmlns:bpelx="http://schemas.oracle.com/bpel/extension" language="java" version="1.4" name="InventoryEJB">
<![CDATA[
// Java code snippet
try{
Hashtable properties = new Hashtable();
properties.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(InitialContext.PROVIDER_URL, "t3://PCIIB07447:7001");
InitialContext context = new InitialContext(properties);
InventoryHome home = (InventoryHome) context.lookup("Inventory");
InventoryRemote remote = home.create();
int status = remote.getInventory("Chevrolet","2-Door Coupes","Chevy Cobalt",5);
addAuditTrailEntry("Status is: " + status);
setVariableData("output", "payload",
"/status", new Integer(status));
catch(Exception e){}
]]>
</bpelx:exec>
Also copied the interface files in system\classes directory. I got the expected output but i am not able to view the "Visual Flow". Getting the following error in my BPEL server console
<Sep 9, 2004 12:46:51 PM IST> <Warning> <RMI> <BEA-080003> <RuntimeException thr
own by rmi server: weblogic.management.internal.RemoteMBeanServerImpl.invoke(Lja
vax.management.ObjectName;Ljava.lang.String;[Ljava.lang.Object;[Ljava.lang.Strin
g;)
weblogic.management.NoAccessRuntimeException: Access not allowed for subject: p
rincipals=[], on ResourceType: ServerConfig Action: execute, Target: lookupServe
rRuntime.
weblogic.management.NoAccessRuntimeException: Access not allowed for subject: pr
incipals=[], on ResourceType: ServerConfig Action: execute, Target: lookupServer
Runtime
at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeA
ction.wlsRun(SecurityHelper.java:564)
at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeA
ction.run(SecurityHelper.java:456)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.management.internal.SecurityHelper.isAccessAllowed(SecurityH
elper.java:350)
at weblogic.management.internal.RemoteMBeanServerImpl.private_invoke(Rem
oteMBeanServerImpl.java:946)
at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBean
ServerImpl.java:908)
at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unkn
own Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
2. The other way i used WSIF frame work, but i could not resolved.
Thanks for your help in advance. -
Challenge: call local ejb from remote ejb on weblogic 9.2
Hi ALL,
How do I call to local ejb from remote ejb object. The jar file is deployed on weblogic server 9.2, if you want get it http://geocities.yahoo.com.br/lindembe/BEAProject.jar and the source code are http://geocities.yahoo.com.br/lindembe/BEAProject.zip. It is a sample app with two ejb that works so good on JBOSS, JOnAS, but BEA Weblogic.....
The complete problem you watch http://forum.java.sun.com/thread.jspa?threadID=768718&messageID=4387570#4387570
or
http://forums.bea.com/bea/message.jspa?messageID=600043148&tstart=0Your code in SigemFacadeBean should just do:
InitialContext ctx = new InitialContext();
when you lookup the local EJB. (This will work on all app servers. There's no need to put an app-server specific intial context factory in your code.)
Also, you can remove the jndi-name setting for the local ejb from your weblogic-ejb-jar.xml. jndi-name is only applied to remote ejbs.
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/ -
Error in IB (When trying to import objects into ESR from SLD or from server
Hi Experts,
We are facing an error with the Integration builder recently. When we open Enterprise Services Repository of PI 7.1, we are able to see the GUI with objects perfectly. When we try to import an object into the repository from the server ( In ESR, choose Tools -> Import Design objects -> From Server), we are thrown with an exception...
Error when exectuting search (QUERY_ERROR)
& java.lang.NullPointerException
The server throws the above two exceptions. I have pasted the logs of the error when trying to import an object from the server and also from the sld, below.
Have any of you experieced the issue? Request you to please check this out and suggest what the problem could be. Thanks in advance.
Regards,
Basker
Log of the error received when trying to import an object from the server...
====================================================================
= Root Exception ===================================================
====================================================================
Thrown:
com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
Caused by: java.lang.NullPointerException: null
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
... 3 more
====================================================================
== Content from the LogHandler =====================================
====================================================================
#12 13:44:56 AWT-EventQueue-2 ERROR com.sap.aii.utilxi.swing.toolkit.ExceptionDialog: Throwable
Thrown:
com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
Caused by: java.lang.NullPointerException: null
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
... 3 more
#11 13:44:55 Pool-Thread-0 FINE AutoLog.created.java.lang.NullPointerException: java.lang.NullPointerException
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
#10 13:44:55 Pool-Thread-0 DEBUG AutoLog.created.java.lang.NullPointerException: null
#9 13:44:55 Pool-Thread-0 FINE AutoLog.created.com.sap.aii.utilxi.swing.framework.ExecuteException: com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
Caused by: java.lang.NullPointerException
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
... 3 more
#8 13:44:55 Pool-Thread-0 DEBUG AutoLog.created.com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
#7 13:43:52 AWT-EventQueue-2 FINE AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
predecessor system
com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
#6 13:43:52 AWT-EventQueue-2 DEBUG AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
#5 13:43:52 AWT-EventQueue-2 FINE AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:175)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
... 13 more
predecessor system
com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:175)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
... 13 moreHi Rajeev,
Thanks for your inputs. I myself am a basis guy. I ve already checked all the authorizations given to the user - PISUPER, and have found it to be fine. Can't understand why this security issue crops up still. anyways, i m getting this error when trying to import an object from the server. If i try to create a new object and during the process, try to import the SCV from SLD, i m facing with an error again, of a different sort. The log says...
====================================================================
= Root Exception ===================================================
====================================================================
Thrown:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Internal error during bean lookup for bean SldAccessServiceBean
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.handleRuntimeExInBusinessMethod(BeanAccessHandler.java:113)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:55)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Internal error during bean lookup for bean SldAccessServiceBean
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:460)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
... 6 more
Caused by: com.sap.aii.ib.core.ejbutil.HomeFactoryException: Exception during lookup operation of object with name sap.com/com.sap.xi.repository/SldAccessServiceBean, cannot resolve object reference.
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:381)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
... 10 more
Caused by: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name sap.com/com.sap.xi.repository/SldAccessServiceBean, cannot resolve object reference.
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:528)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
... 11 more
Caused by: javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name:
Type: clientAppName
Content: sap.com/com.sap.xi.repository
Type: interfaceType
Content: remote
Type: home
Content: com.sap.aii.ib.sbeans.sldAccess.SldAccessServiceHome
Type: ejb-link
Content: SldAccessServiceBean
Type: remote
Content: com.sap.aii.ib.sbeans.sldAccess.SldAccessServiceRemote
com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext.
at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:488)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:73)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Can't get Socket. Reason:Connection timed out: connect
at com.sap.engine.interfaces.cross.io.transport.PortManager.getRealSocket(PortManager.java:284)
at com.sap.engine.interfaces.cross.LoadBalancerImpl.getAllAccessPoints(LoadBalancerImpl.java:97)
at com.sap.engine.interfaces.cross.CrossObjectBroker.getDestination(CrossObjectBroker.java:142)
at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:347)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:73)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
at java.lang.Thread.run(Unknown Source)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:140)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
... 14 more
Any clues what might be the issue?
thanks in advance,
Regards,
Basker -
Error while running EJB from java client on JBOSS
Hi
As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.gl.TestClient.main(TestClient.java:39)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
... 5 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:266)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
... 5 more
Following is my code:
Home Interface:
package com.gl;
import javax.ejb.CreateException;
public interface testHome extends EJBHome {
String JNDI_NAME = "testBean";
public test create()
throws java.rmi.RemoteException,CreateException;
Remote Interface:
package com.gl;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
public interface test extends EJBObject {
public String welcomeMessage() throws RemoteException;
Bean:
package com.gl;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class testbean implements SessionBean {
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub
public void setSessionContext(SessionContext arg0) throws EJBException,
RemoteException {
// TODO Auto-generated method stub
public void ejbCreate(){}
public String welcomeMessage(){
return "Welcome to the World of EJB";
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>
<session>
<ejb-name>testBean</ejb-name>
<home>com.gl.testHome</home>
<remote>com.gl.test</remote>
<ejb-class>com.gl.testbean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
jboss.xml:
<?xml version='1.0' ?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<jboss>
<enterprise-beans>
<entity>
<ejb-name>testBean</ejb-name>
<jndi-name>testBean</jndi-name>
</entity>
</enterprise-beans>
</jboss>
Client code:
package com.gl;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class TestClient {
public static void main(String[] args) throws Exception{
try{
/* Properties props=new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");
System.out.println("Properties ok");
//env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
//env.put(Context.PROVIDER_URL,"http://localhost:8080");
//env.put(Context.SECURITY_PRINCIPAL, "");
//env.put(Context.SECURITY_CREDENTIALS, "");
Context ctx=new InitialContext(props);
System.out.println("context ok");
//testHome home = (testHome)ctx.lookup("testBean");
Object obj = ctx.lookup ("testBean");
System.out.println("ojb = " + obj);
testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
test ejbObject = ejbHome.create();
String message = ejbObject.welcomeMessage();
System.out.println("home ok");
System.out.println("remote ok");
System.out.println(message);
catch(Exception e){e.printStackTrace();}
I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
kindly suggest me something to solve this issue.
Regards
Gagan
Edited by: Gagan2914 on Aug 26, 2008 3:28 AMIs it a remote lookup? Then maybe this will help:
[http://wiki.jboss.org/wiki/JBoss42FAQ]
- Roy -
'Class Cast Exception' while invoking a EJB from a Servlet
Hi,
I am working on J2EE applications.I am using Webgain studio and weblogic server.I
got a problem while invoking EJB from the servlet.
While calling an EJB from the servlet, it is giving that "Class Cast Exception".This
is because, the remote home reference is not able to type casted to the"Home Interface"
of the EJB, even if I type casted explicitly. It is creating the context and able
to identify the EJB with the JNDI name.
Could please help me in solving this problem.I am pasting the code here.
Thanks in advance,
Dharma
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
resp.setContentType("text/html");
PrintWriter out = new PrintWriter(resp.getOutputStream());
try
Context context=getInitialContext();
Object reference=context.lookup("ArlProjContractorAppletSession");
ArlProjContractorAppletSessionHome home=(ArlProjContractorAppletSessionHome)PortableRemoteObject.narrow(reference,ArlProjContractorAppletSessionHome.class);
//Exception is occuring in the above statement. It is unable
//to cast to the home interface
ArlProjContractorAppletSession the_ejb=null;
try
the_ejb=home.create();
System.out.println("the_ejb = " + the_ejb.toString());
catch(Exception e)
e.printStackTrace();
catch(Exception e)
e.printStackTrace();
// to do: code goes here.
out.println("<HTML>");
out.println("<HEAD><TITLE>Contractor TimeTracker</TITLE></HEAD>");
out.println("<BODY>");
// to do: your HTML goes here.
out.println("</BODY>");
out.println("</HTML>");
out.close();
I came across this kind of problem once. My problem went away after I upgraded
from 5.1 SP6 to 5.1 SP8.
"Dharma" <[email protected]> wrote:
>
>Hi,
>
>I am working on J2EE applications.I am using Webgain studio and weblogic
>server.I
>got a problem while invoking EJB from the servlet.
>
>While calling an EJB from the servlet, it is giving that "Class Cast
>Exception".This
>is because, the remote home reference is not able to type casted to the"Home
>Interface"
>of the EJB, even if I type casted explicitly. It is creating the context
>and able
>to identify the EJB with the JNDI name.
>
>Could please help me in solving this problem.I am pasting the code here.
>
>Thanks in advance,
>Dharma
>
>
>public void doGet(HttpServletRequest req, HttpServletResponse resp)
> throws ServletException, IOException
> {
> resp.setContentType("text/html");
> PrintWriter out = new PrintWriter(resp.getOutputStream());
>
> try
> {
>
> Context context=getInitialContext();
>
> Object reference=context.lookup("ArlProjContractorAppletSession");
>
> ArlProjContractorAppletSessionHome home=(ArlProjContractorAppletSessionHome)PortableRemoteObject.narrow(reference,ArlProjContractorAppletSessionHome.class);
>
>//Exception is occuring in the above statement. It is unable
>//to cast to the home interface
>
> ArlProjContractorAppletSession the_ejb=null;
>
> try
> {
> the_ejb=home.create();
>
> System.out.println("the_ejb = " + the_ejb.toString());
>
> }
> catch(Exception e)
> {
> e.printStackTrace();
> }
> }
> catch(Exception e)
> {
> e.printStackTrace();
> }
> // to do: code goes here.
>
> out.println("<HTML>");
> out.println("<HEAD><TITLE>Contractor TimeTracker</TITLE></HEAD>");
> out.println("<BODY>");
>
> // to do: your HTML goes here.
>
> out.println("</BODY>");
> out.println("</HTML>");
> out.close();
> }
>
>
>
>
>
-
Can I call an EJB from the database?
Hi,
I've just spent the last few days attempting to call an EJB from a stored procedure in a 10g database (and still haven't succeeded).
Now having spent hours searching the web (and this forum) for any successful examples (so far I have found none) I thought I'd add a message to see if there is anybody out there who has done this successfully. If so can you please provide me some details on how to do this?
Alternatively, I'd appreciate any input on how I can overcome my current hurdle in attempting to do this myself.
Here's how far I've got in my attempt:
I have a simple stateless session bean deployed to both Oracle 10gAS (a standalone OC4J container in 10.1.3) and to Weblogic 9. I have a client java class that calls a method on this bean and displays some ouput if successful. This all works from a standalone JVM (version 1.4) on both Weblogic and 10gAS.
I then tried to load the required libraries for Weblogic onto the database (namely the Weblogic.jar file). This resulted in the addition of some 32,000 odd objects of which 30,000 odd could not be resolved. I figured a lot of these may be down to JVM version issues (I believe that Weblogic 9 uses the 1.5 JRE) so I decided to put the Weblogic test on the back burner for now and just use the Oracle app server.
The tests with the Oracle app server looked promising. I only needed a handful of libraries to be loaded onto the database and all the relevant classes required for my test client had resolved (including the initial context factory required to do the jndi lookup of the bean). After granting all the permissions I believed I needed I'd got to the point where I could do a jndi lookup of the EJB; but when I tried to create an instance of the beans remote interface I got the following error:
java.security.AccessControlException: the Permission (java.lang.RuntimePermission getClassLoader) has not been granted to ProtectionDomain (file:generated/by/proxy <no certificates>)
com.evermind.net.DynamicClassLoader@612d9d34
<no principals>
java.security.Permissions@eb0f3c1a (
(java.util.PropertyPermission java.version read)
(java.util.PropertyPermission java.vm.name read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission os.name read)
(java.util.PropertyPermission java.vendor.url read)
(java.util.PropertyPermission java.vm.specification.vendor read)
(java.util.PropertyPermission java.specification.vendor read)
(java.util.PropertyPermission os.version read)
(java.util.PropertyPermission java.specification.name read)
(java.util.PropertyPermission java.class.version read)
(java.util.PropertyPermission file.separator read)
(java.util.PropertyPermission java.vm.version read)
(java.util.PropertyPermission os.arch read)
(java.util.PropertyPermission java.vm.specification.name read)
(java.util.PropertyPermission java.vm.specification.version read)
(java.util.PropertyPermission java.specification.version read)
(java.util.PropertyPermission java.vendor read)
(java.util.PropertyPermission path.separator read)
(java.util.PropertyPermission line.separator read)
(java.net.SocketPermission localhost:1024- listen,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:280)
at java.security.AccessController.checkPermission(AccessController.java:429)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:528)
at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java:192)
at java.lang.Thread.getContextClassLoader(Thread.java:1203)
at com.evermind.server.rmi.RMICall.<init>(RMICall.java:36)
at com.evermind.server.rmi.RmiCallQueue.createCall(RmiCallQueue.java:33)
at com.evermind.server.rmi.RMIClientConnection.createQueuedCall(RMIClientConnection.java:592)
at com.evermind.server.rmi.RMIClientConnection.writeRequest(RMIClientConnection.java:581)
at com.evermind.server.rmi.RMIClientConnection.sendMethodInvocationRequest(RMIClientConnection.java:426)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:415)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at __Proxy0.create(Unknown Source)
at com.axiomsystems.test.client.TestDBClient.test(TestDBClient.java:76)
Has anybody come across this before? If so can they help?
If not has anybody out there actually managed to call an EJB method (without going via an RMI server/Servlet/or any other proxy).
Any help in this matter would be greatfully appreciated.
Cheers,
Anand.Sure, here's the code. It's what JDev generates automatically but I have seperated some things into several diffrent lines so I could experiment easier.
final Context context = getInitialContext();
Object o=context.lookup( "SessionEJB4" );
Object l= PortableRemoteObject.narrow( o, SessionEJB4Home.class );
final SessionEJB4Home sessionEJB4Home = (SessionEJB4Home)l;
SessionEJB4 sessionEJB4 = sessionEJB4Home.create();
String ret=( sessionEJB4.hello( ) );
As I mentioned, for this I have used EJB2.1 bean, because I had same problems with EJB3.0, so I tried earlier versions of Java to make sure that is not the problem.
hello() method just returns string "hello".
Of course, this works in standalone client that is not loaded into database.
Now, I loaded all the jars mentioned in this thread, using loadjava options -v -resolve, and I loaded client using options -v -resolve -genmissing . Select query on user objects in database shows that client class and relevant classes are all valid.
Then I created stub and ran it. First it stopped throwing exception ORA-29532: Java call terminated by uncought Java exception: Java.lang.NoClassDefFoundError.
Method I try to run returns String value which is hello message if it works fine, else it prints the part of the stack trace. In this case, after p[revious error, When I try to run it again, i get return from the method :
Lookup error: java.lang.NoClassDefFoundError; nested exception is:
java.lang.NoClassDefFoundError
com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:89)
com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMIClientConnection.java:371)
com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:179)
com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:283)
com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
javax.naming.InitialContext.lookup(InitialContext.java:347)
simpleejbproject.EJB4Client.hello(EJB4Client.java:35)
Of course, regular version of the client I run frokm command line works fine.
So I'm kind of a stuck here. I followed all directions, tried it on oracle 9 and oracle 10 DB, the problems remain the same. Am I missing something here?
Thanks
Just to add, getInitialContext()
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Oracle Application Server 10g connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "manager1" );
env.put(Context.PROVIDER_URL, "opmn:ormi://mserv:4005:home/TestEjb4");
return new InitialContext( env );
It goes withouth any exceptions.
Message was edited by:
user510152 -
Connecting to Remote EJB from Servlet in same application
Please help!
I was able to connect to SessionBeans and EJB from my sample java client in OCJ4 but when I try to do same thing from my web application using servlets, I get the below NullPointerException error.
The JNDI lookup works fine using java client but difficult from a servlet.
I am sure there is something I am missing.
Thanks
This is what I do in the servlet:
public void init() throws ServletException, NamingException, CreateException, RemoteException
Context jndiContext = getInitialContext();
SessionCartEJBHome home = (SessionCartEJBHome)jndiContext.lookup("SessionCartEJBBean");
sessionEJB = null;
try{
sessionEJB = (SessionCartEJB) home.create();
}catch (Exception e)
e.printStackTrace();
private static Context getInitialContext() throws NamingException
Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "admin");
env.put(Context.PROVIDER_URL, "ormi://Princeton/ejb1");
return new InitialContext(env);
And when I call the following procedure, it blow up at the line sessionEJB.getLineItem(new Long(1304));
sessionEJB is a class variable.
void processCatalogPage(HttpServletRequest request,
HttpServletResponse response,
ActionMapping mapping,
HttpSession session
throws ServletException, IOException , Exception, FinderException{
try {
ActionForward actFor = null;
String itemId = request.getParameter("id");
if ( itemId != null ) {
String[] itemIds = new String[1];
itemIds[0] = itemId;
sessionEJB.getLineItem(new Long(1304));
actFor = mapping.findForward("catalog");
return (mapping.findForward("success"));
} catch (Exception ex)
ex.printStackTrace();
System.err.println(ex.toString());
throw new EJBException(ex.toString());
04/12/11 23:45:24 java.lang.NullPointerException
04/12/11 23:45:24 at com.alashoofi.Cart.processCatalogPage(Cart.java:187)
04/12/11 23:45:24 at com.alashoofi.Cart.execute(Cart.java:86)
04/12/11 23:45:24 at org.apache.struts.action.RequestProcessor.processActi
onPerform(RequestProcessor.java:484)
04/12/11 23:45:24 at org.apache.struts.action.RequestProcessor.process(Req
uestProcessor.java:274)
04/12/11 23:45:24 at org.apache.struts.action.ActionServlet.process(Action
Servlet.java:1482)
04/12/11 23:45:24 at org.apache.struts.action.ActionServlet.doGet(ActionSe
rvlet.java:507)
04/12/11 23:45:24 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
va:740)
04/12/11 23:45:24 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
va:853)
04/12/11 23:45:24 at com.evermind.server.http.ServletRequestDispatcher.inv
oke(ServletRequestDispatcher.java:765)
04/12/11 23:45:24 at com.evermind.server.http.ServletRequestDispatcher.for
wardInternal(ServletRequestDispatcher.java:317)
04/12/11 23:45:24 at com.evermind.server.http.HttpRequestHandler.processRe
quest(HttpRequestHandler.java:790)
04/12/11 23:45:24 at com.evermind.server.http.HttpRequestHandler.run(HttpR
equestHandler.java:270)
04/12/11 23:45:24 at com.evermind.server.http.HttpRequestHandler.run(HttpR
equestHandler.java:112)
04/12/11 23:45:24 at com.evermind.util.ReleasableResourcePooledExecutor$My
Worker.run(ReleasableResourcePooledExecutor.java:192)
04/12/11 23:45:24 at java.lang.Thread.run(Thread.java:534)
04/12/11 23:45:24 java.lang.NullPointerException
Dec 11, 2004 11:45:24 PM org.apache.struts.action.RequestProcessor processExcept
ion
WARNING: Unhandled Exception thrown: class javax.ejb.EJBExceptionAvi,
Thanks for your response. I am actually returning a new InitialContext in a function call in the servlet. What I have noticed though is that JDeveloper creates two ear files for the application. One for the ejbs called ejb1.ear and another for the web files webapp1.ear. These are located in the applications subdirectory in OC4J directory.
I know I have two projects in the application, model and viewController. I am just trying to follow the MVC pattern.
In short, I don't think the web and the ejbs are in same ear file. I made the web project depend on the ejbs though. There is an option to set such. I don't know how to tell JDeveloper to put them all in one ear file.
I will appreciate any suggestion.
Thanks
Matilda -
Hello Developers!
I deployed my ejb to OAS4081. I call that
from JDeveloper so it good. But when I try
to call from applet in IExpl5 I can't
instantiate the ORB. I've got a com.ms.security.SecurityException : oracle.oas.orb.CORBA.ORB.init
I coded the CLASSPATH(oasoorb(yoj),client,
ejbapi...) perfectly, I think.
If anybody could help, please...
Thanx!Hi there,
I saw someone on this group had a problem to locate proper classpath
to call EJB from JSP. I thought if you call EJB from classpath, you are
calling the bean. But you loss all the EJB functions. To be able to utilize
EJB features like object pooling. You need to call it from Weblogic server
using url/jndi, not from the jar directly.
Any comment? Am I right?
BTW, my question about calling EJB from JSP means calling through URL,
not a local path.
Thank you
>-------------------------------------------------------------------->
Jim wrote in message <[email protected]>...
>Hi there,
> Can I call EJB from JSP? Is there a particular security setting or
>concern for Weblogic? Is there an coding example?
>
>Thank you
>
>
Maybe you are looking for
-
I have a new Nokia 6300. It seems to have a very pathetic battery life. It doesn't last a day with nrmal usage and not more than one and a half day with no usage at all. Does any one else have this issue or the problem is specific to my set.
-
Java applet (internet access)
I am trying to access internet through wifi on Blackberry Curve 9300 phone. I am behind my college LAN. I get this message: Cisco Clean Access Java Applet web client could not be launched. The reasons for this might include: Java plug-in not installe
-
Echosign compatibility with Protection settings of acrobat pro
Acrobat pro has the possibility to protect files and prevent users with access to the document to print or copie text of a document (different than a password to open a pdf file), if i want to use echosign to get aproval of the doccument it no longer
-
Business Process harmonization
Hi My Client operates in multiple SAP environments from 4.6c to ECC 5.0 across the globe apart from many other legacy applications. Legacy applications interface with SAP on predominantly accounting functions They want to consolidate and reduce the n
-
Cs6 histogram why always set to colors?
Hi about cs6 , why the histogram is always set to colors?? i mean is a bug like cs5 it should be set by default to rgb every photo i load it's always set to colors and i guess there is not option to save and have rgb by default thanks cheers