EJB not clusterable
I have a Stateless session bean which is being flagged with a "Conflict start: ....non clusterable and you have tried to bind more than once....". I am running WLS 7.0 SP1. How is this application to be made clusterable? Thanks.
Hi,
+Please check your weblogic-ejb-jar.xml file for clustering setting. You have
to give following settings in your weblogic-ejb-jar.xml.
<clustering-descriptor>
<home-is-clusterable>true</home-is-clusterable>
<stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
</clustering-descriptor>
By default these things are true.
Check Weblogic document for details.
Regds,
Vikram
Ted Nakon <[email protected]> wrote:
>I have a Stateless session bean which is being flagged with a "Conflict
>start: ....non clusterable and you have tried to bind more than once....".
> I am running WLS 7.0 SP1. How is this application to be made clusterable?
> Thanks.
Similar Messages
-
Can't install ORACLE RAC on Solaris (specified nodes are not clusterable)
Hi all,
Could you please help with the Oracle CRS issue?
During the installation Oracle CRS the OUI indicate that the specified nodes are not clusterable.
The window appears and displays:
"The specified nodes are not clusterable.
The following error was returned by the operating system:"
I am using 10gr2_cluster_sol.cpio.gz file.
My Solaris 10 configuration:
server - sun3
bash-3.00# cat /etc/hosts
# Internet host table
127.0.0.1 localhost
10.160.19.49 sun3 loghost
10.160.19.50 sun4 loghost
10.11.12.13 sun3prv
10.11.12.14 sun4prv
10.160.19.64 sun3pub
10.160.19.65 sun4pub
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.160.19.49 netmask fffffe00 broadcast 10.160.19.255
ether 0:14:4f:0:64:82
bge1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 10.11.12.13 netmask fffffe00 broadcast 10.11.13.255
ether 0:14:4f:0:64:83
bash-3.00# cat /etc/netmasks
10.160.18.0 255.255.254.0
10.160.19.0 255.255.254.0
10.11.12.0 255.255.254.0
bash-3.00# cat /etc/hostname.bge0
sun3
bash-3.00# cat /etc/hostname.bge1
sun3prv
server - sun4
bash-3.00# cat /etc/hosts
# Internet host table
127.0.0.1 localhost
10.160.19.50 sun4 loghost
10.160.19.49 sun3 loghost
10.11.12.14 sun4prv
10.11.12.13 sun3prv
10.160.19.63 sun4pub
10.160.19.62 sun3pub
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.160.19.50 netmask fffffe00 broadcast 10.160.19.255
ether 0:14:4f:0:41:c8
bge1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 10.11.12.14 netmask fffffe00 broadcast 10.11.13.255
ether 0:14:4f:0:41:c9
bash-3.00# cat /etc/netmasks
10.160.18.0 255.255.254.0
10.11.12.0 255.255.254.0
10.160.19.0 255.255.254.0
bash-3.00# cat /etc/hostname.bge1
sun4prv
bash-3.00# cat /etc/hostname.bge0
sun40) This error occur when I run .runInstaller
All prerequisites check passed. The error window appears after clicking Next button in Specify Cluster Configuration window.
1) I have changed /etc/hosts file as you have mentioned
SUN3
bash-3.00# cat /etc/hosts
# Internet host table
::1 localhost
127.0.0.1 localhost
10.160.19.49 sun3
10.160.19.50 sun4
10.11.12.13 sun3-vip
10.11.12.14 sun4-vip
10.160.19.64 sun3pub
10.160.19.65 sun4pub
SUN4
bash-3.00# cat /etc/hosts
# Internet host table
::1 localhost
127.0.0.1 localhost
10.160.19.50 sun4
10.160.19.49 sun3
10.11.12.13 sun3-vip
10.11.12.14 sun4-vip
10.160.19.64 sun3pub
10.160.19.65 sun4pub
Also I have configured bge0:1 interface
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.160.19.49 netmask fffffe00 broadcast 10.160.19.255
ether 0:14:4f:0:64:82
bge0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.160.19.64 netmask ffffff00 broadcast 10.160.19.255
bge1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 10.11.12.13 netmask fffffe00 broadcast 10.11.13.255
ether 0:14:4f:0:64:83
2) I have removed loghost from /etc/hosts file
3) Currently I do not have shared storage. I am going to use Storage Foundation to create a shared storage
Also I was trying to test the machines using runcluvfy.sh command
The output is the following:
-bash-3.00$ ./runcluvfy.sh stage -pre crsinst -n sun3,sun4
Performing pre-checks for cluster services setup
Checking node reachability...
Node reachability check passed from node "sun3".
Checking user equivalence...
User equivalence check failed for user "oracle".
Check failed on nodes:
sun4,sun3
ERROR:
User equivalence unavailable on all the nodes.
Verification cannot proceed.
Pre-check for cluster services setup was unsuccessful on all the nodes. -
Message: the specified nodes are not clusterable
Hi,
I am geting message "the specified nodes are not clusterable" at the time of crs installation on solaris 10.
i have already configure ssh and configure properelly.
please suggest.
thanks
AnupHello IndiaDBA,
The id on OS groups and users are the same on all nodes?
Check Metalink note ID 338045.1
Error:*** Alert: The specified nodes are not clusterable. This could be due to one or more of the following reasons:
1. The user performing the install is not configured in an equivalent manner on all nodes.
2. ssh and scp are not configured properly on all nodes.
3. rsh and rcp are not configured properly on all nodes.
Do a simple test before proceed the installation
# Public
$ ssh node1 date
$ ssh node2 date
$ ssh nodeN date
# Priv
$ ssh node1-priv date
$ ssh node2-priv date
$ ssh nodeN-priv date
# Vip
$ ssh node1-vip date
$ ssh node2-vip date
$ ssh nodeN-vip date
Check Metalink note ID 300548.1 How To Configure SSH for a RAC Installation
Regards,
Rodrigo Mufalani
http://www.mrdba.com.br/mufalani -
Package javax.ejb not found error
Hi there,
I've downloaded j2se 1.4 and j2ee 1.3.1 and installed it on Windows XP. I set the environment variables as described. When I compile a .java file that imports the javax.ejb.* package, then I get an error "package javax.ejb not found". I feel like an idiot and I know it's something to do with the environment variables. (or just XP, most likely)
Thanks in advance
HoennerHow are you compiling your source? If you're using an IDE then you should edit your project classpath to include the j2ee.jar file (it'll probably be in the lib directory of your J2EE installation).
If you're doing it from the command line then type in SET CLASSPATH, look at the classpath it returns and check that it includes the j2ee.jar file.
Hope this helps. -
Hello
Recently i faced an Exception when i run the client that "EJB not Bound exception". It only comes on Entity bean when i run any session bean i run porperly i don't know whats happen with Entity bean plz guide me on that i m using Jboss server.
And when i define relation b/w local ejbs how can i define forigen key?
Best Regards
Uzairhi
Here is my client
HelloClient
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.*;
public class HelloClient
public static void main(String [] args)
try{
InitialContext ctx=new InitialContext();
Object obj=ctx.lookup("HelloEJB");
HelloHome home=(HelloHome)PortableRemoteObject.narrow(obj, HelloHome.class);
Integer id=new Integer(Integer.parseInt(args[0]));
Hello h=home.create(id,args[1]);
}catch(Exception e)
System.out.println(e);
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>
<entity>
<ejb-name>HelloEJB</ejb-name>
<local-home>HelloHome</local-home>
<local>Hello</local>
<ejb-class>HelloBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<abstract-schema-name>HelloAA</abstract-schema-name>
<cmp-field>
<field-name>helloId</field-name>
</cmp-field>
<cmp-field>
<field-name>helloName</field-name>
</cmp-field>
<primkey-field>helloId</primkey-field>
</entity>
</enterprise-beans>
</ejb-jar> -
As I mentioned in subject, I am just wondering Whether the java component (Not
ejb, not servlet) can be deployed in App Server and get the services provided
by App Server or not?Nevermind folks - I got it to work. All my configuration was correct; I had other issues with the ejb-jar file that the verifier informed me of (my previous deployments were with the verifier turned-off).
-
The specified nodes are not clusterable
Hello,
I am trying to install RAC 10g,during the installation , i got error saying the specific nodes are not clusterable, i have checked below things on both nodes, node reachablity and node connectivity are successful.
ssh rac1 date
ssh rac1-priv date
ssh rac2 date
ssh rac2-priv date
Could you please help me, how to resolve this issue.
Thanks
Nitya
Edited by: user8773474 on Aug 28, 2009 8:32 AMHello Andy,
I searched the link to reward you, but i couldn't
Really thanks for you quick response,
Right now i can say helpful, i will download and try ,if it is working , then i will update you as correct.
Best Regards
Nitya -
JMS is not clustering correctly anymore
Hi all,
I'm knee deep in a problem that has completely perplexed me. We have a
cluster of two managed servers ms1, ms2 they are clustered together.
They run on separate machines. We also have two JMS servers
JMSServer1, and JMSServer2. JMSServer1 runs on ms1, JMSServer2 runs on
ms2. We have a distributed queue with physical queue members that
belong on both JMSServer1 and JMSServer2, our client application
creates temporary topics, attaches itself as a listener to each temp
topic it creates, then fires off a message to the distributed queue,
with the message's JMSReplyTo field set to the temp topic that was
created. A MDB reads the message off of the dist queue and then fires
messages to the temp topic referenced in the JMSReplyTo field. Our
configuration used to work great such that each temp topic that got
created round robined between each JMSServer (JMSServer1, and
JMSServer2), and which ever MDB was servicing the message from the
queue had no problem locating and then sending the response messages to
the appropriate temp topic whether the temp topic so happened to be
located on the same managed server as the MDB or not.
But then I was forced to dismantle the cluster, and had to make a whole
bunch of changes. Later I went back to my cluster configuration, and
at the same time our networking folks made a whole bunch of changes to
the machines that the managed servers run on. So I had to adjust ip
addresses and host names, and thought I got everything back together
again, however now when the client creates each temp topic they are all
created on the same managed server/JMSServer they are no longer round
robined (i.e ms2) Also the MDB that services the message is always on
the opposite mangaged server (i.e ms1), and when it tries to send its
response messages to the temp topic I now get Destination not found
errors, and when I look deeper in the stack trace weblogic reports that
it can't do a JNDI lookup on weblogic.jms.S:<name of managed server>
So I went and verified my cluster configuration is the same as it used
to be except for IP addresses and it is... Also I went and looked at
the JNDI tree for each managed server, and I noticed that for ms1 there
is an entry of weblogic.jms.S:ms1, and for ms2 there is a JNDI entry of
weblogic.jms.S:ms2, so the problem is the MDB that is servicing the
message needs to get to the other managed server but it cannot find
it...which makes sense because it is not listed in the JNDI tree. But
why is not listed in the JNDI tree??? I went and looked at a cluster
we have running in development and noticed that for ms1 I have JNDI
entries of both weblogic.jms.S:ms1 AND weblogic.jms:Sms2, and the same
for when I look at the JNDI entries of ms2. So I've also tried
creating a brand new cluster from scratch with brand managed servers on
dev, and everytime I add the managed servers to the cluster and view
the JNDI tree for each managed server I see both managed servers
listed. This seems correct, and things work fine in dev! For our test
env I only see one weblogic.jms.S:<managed server> entry per managed
server! I have no idea why this occurs. I see no errors in the
managed server logs or admin logs when starting the cluster. I've run
the multicast tool and multicast reports things are working correctly.
The test cluster from a setup and startup standpoint acts like it is
clustered correctly but when I try to attach a client now it acts as if
its not clustered correctly WEIRD!?
I'm assuming that whenver you create a new cluster that for each
managed server that is part of the cluster all managed servers should
be listed (weblogic.jms:Sms1, weblogic.jms.S:ms2,etc) for each JNDI
tree on every managed server correct? What could cause this NOT to
happen. Should I reinstall weblogic, I've tried creating new clusters,
brand new domains and everytime now I can never get the managed servers
JNDI trees to listed the other managed server!
This is weblogic 8.1 sp3 BTW
Please Help!I don't think a re-install is in order. Usually, the first thing to check is if multicast is working on your network. You can use the following stand-alone utility:
http://e-docs.bea.com/wls/docs81/admin_ref/utils25.html
For further advice, you can try the "clustering" newsgroup.
Tom -
Hi, does anybody have any experience on starting some kind of OC4J servers cluster? Is it easy to have then common JNDI namespace (when one EJB deployed on one calls another EJB deployed on another node without any trouble)? Is it possible at all?
Thank you,
Andrejus Chaliapinasoc4j/orion replicates httpsessions across clusters, but not Statefull Session beans. If you have a sfsb, you won't be able to deploy it in a clustered environment.
Entity beans and slsb's are ok, however. You can also set up an rmi cluster which will assure that if you have missing beans for some reason or another from a remote invocation, the next node in line will be used for the remote method.
regards,
the elephantwalker
www.elephantwalker.com -
I'm just curious about what happens when I use an ejb handle for a stateful session
bean in a clustered environment. Does the reference I get back when I use the
handle point me back to the exact bean I was using or does it pick a clone of
the bean on any one of the servers? Assume that the stateful bean replication
has been enabled.
Many Thanks,
RonJason Pringle wrote:
> Since serialization of the handle is not supported under clustering, how do
> I get the servlet to "find" the same stateful bean instance on subsequent
> invocations?
Our docs should be more clear here. Our current version doesn't support
fail-over on handles in a cluster. So if you create a handle on server A
and server A goes down you will not be able to re-create the bean currently.
This is a known bug, and it should be fixed by the EJB 1.1 release (the final
release not the beta(s))
As long as the server where the handle was created and where the stateful
session bean lives are alive, handles will work fine.
-- Rob
> I'm ok with having it die if the server goes down (my session
> will still exist, I'll get an "object not found" error and have the user
> restart the operation), but would like to be able to use stateful session
> EJBeans across servlet invocations.
>
> Thanks for any input!
>
> --Jason
-
Servlets, EJB in clustering!
Hello,
Im new to the clustering mechanism and would like to know:
1. Can servlets which are associated with EJBs can also be clustered?
2. How about an RMI Server running in association with an app server? Can that too be clustered?
- ananthclustering capability is not defined in the specification, each vendor decides what to support. However, for the most part J2EE servers support clustering of web and ejb components as well as JMS and JNDI. I don't know of any off hand that support clustering of RMI (beyond RMI over IIOP for EJB's).
Chuck -
@EJB not working when used in Cactus ServletTestCase
Hi All,
I am running my tests using Cactus ServletTestCase servlet and testing my EJB from there. I deploy my EAR application (my test servlet is in WAR, EJB in EAR modul)
When I run the test, I got NPE as the @EJB is not working and EJB ref is not initialized. Strange thing is, the @EJB is working fine from any other servlet or POJO in WAR.
Test result:
<webresult>
−
<exception classname="java.lang.NullPointerException">
<message>null</message>
−
<stacktrace>
java.lang.NullPointerException
at test.fenix.legalsubject.TestLegalSubjectController.testConvert(TestLegalSubjectController.java:56)
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:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:155)
at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:120)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:94)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:218)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java:1)
at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:102)
at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:218)
at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:1)
at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:73)
at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:218)
at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java:1)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
</stacktrace>
</exception>
</webresult>
my test class:
public class TestLegalSubjectController extends ServletTestCase {
* Class under test
static final Logger log = Logger
.getLogger(TestLegalSubjectController.class);
* TODO nemuzu to rozchodit
@EJB
public LegalSubjectController legalSubject;
local interface:
@Local
public interface LegalSubjectController extends ControllerFilter {
public LegalSubjectWizardData getByID(Long ID);
public void createLegalSubject(LegalSubjectWizardData legalSubjectWizardData);
public LegalSubject findByName(String name);
EJB implementation
@Stateless
public class LegalSubjectControllerBean implements LegalSubjectController, LegalSubjectControllerRemote {
private static final Logger log = Logger.getLogger(LegalSubjectControllerBean.class);
I am stucked with this one, dont want to use the EJB2 way with JNDI look up. Any suggestions much appreciated!Was anyone ever able to figure out a solution for this issue? I'm having the exact same problem right now and this is the only reference to it I've been able to find online.
Thanks!
-Blake -
Is there a way to have two hosts, not clustered, share an ssh identity?
Hi,
I'm using Data Guard to replicate Oracle Databases between two Solaris 10 servers. They aren't clustered at the OS level but if we invoke DR the standby server is promoted to production and vice versa.
Along with the databases, I also have application processes which ssh to the server.
In the past I've worked on VCS environments where we've configured the two nodes to share the same ssh fingerprint so that when the clusters failed over, ssh users would not be prompted about a changed identity when connecting... but in those environments VCS meant a shared IP and clustered hostname floated between the two.
Is there a way to do something similar with my non-clustered, related servers now so that a DNS alias can be used to direct ssh connections to whichever server Oracle is active on without the users being prompted (or even aware)?
Thanks in advance,
Joe
PS - not asking for anybody to do my work here; just an idea if it's possible and a pointer in the right direction so I can go figure this out.Okay, I got an answer to this:
1 - copy the contents of /etc/ssh from the primary server to secondary and restart ssh
2 - use a DNS alias to switch between the two. The first time with the new alias I'll need to add the host to the known_hosts file but after that the hostnames and identities will be the same so I won't even after failover.
Sorted. -
I deplyed a simple EJB on S17AS. The server.log tells me it is deployed successful.
CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1017ca1
CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@9d5793
LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
The relevant simpleEjb.jar_verified.txt is as follows
Test Name : tests.ejb.ias.ASEjbJndiName
Test Assertion :
Test Description : PASSED [AS-EJB ejb] : jndi-name is simpleHome
However, the server log did not indicate the EJB is bound even if I set the log level to finest.
Therefore when I tried to access it, I get the following error
Exception in thread "main" javax.naming.NameNotFoundException: No object bound f
or java:comp/env/ejb/simpleHome
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
ava:116)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at HelloClient.main(HelloClient.java:61)
The client code is as follows
String JNDIName = "java:comp/env/ejb/simpleHome";
myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(
initContext.lookup(JNDIName), GreeterDBHome.class);
The sun-ejb-jar.xml is as follows
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2002 Sun Microsystems, Inc. All rights reserved.
-->
<!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN' 'http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd'>
<sun-ejb-jar>
<enterprise-beans>
<name>simpleEjb.jar</name>
<ejb>
<ejb-name>simpleEJB</ejb-name>
<jndi-name>simpleHome</jndi-name>
<is-read-only-bean>false</is-read-only-bean>
<bean-pool>
<steady-pool-size>2</steady-pool-size>
<resize-quantity>5</resize-quantity>
<max-pool-size>20</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
</bean-pool>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
I tried to use lookup for both "java:comp/env/ejb/simpleHome" and "java:comp/env/simpleHome". None succeed.
Does anyone know why the ejb is deployed successful but not bound?
ShaHi, Parsuram,
I did restart the server and the error is the same.
Here is the sample code. I did not change them. Only the names in deployment descriptors are modified.
Below is the info.
*************************Remote Interface
Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
package samples.jdbc.simple.ejb;
* Remote interface for the GreeterDBEJB. The remote interface defines all possible
* business methods for the bean. These are the methods going to be invoked remotely
* by the servlets, once they have a reference to the remote interface.
* Servlets generally take the help of JNDI to lookup the bean's home interface and
* then use the home interface to obtain references to the bean's remote interface.
public interface GreeterDB extends javax.ejb.EJBObject {
* Returns the greeting String such as "Good morning, John"
* @return the greeting String
public String getGreeting() throws java.rmi.RemoteException;
*************************Home Interface
Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
package samples.jdbc.simple.ejb;
* Home interface for the GreeterDB EJB. Clients generally use home interface
* to obtain references to the bean's remote interface.
public interface GreeterDBHome extends javax.ejb.EJBHome {
* Gets a reference to the remote interface to the GreeterDBBean.
* @exception throws CreateException and RemoteException.
public GreeterDB create() throws java.rmi.RemoteException, javax.ejb.CreateException;
*************************Bean Class
Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
package samples.jdbc.simple.ejb;
import java.util.*;
import java.io.*;
* A simple stateless session bean which generates the greeting string for jdbc-simple
* application. This bean implements the business method as declared by the remote interface.
public class GreeterDBBean implements javax.ejb.SessionBean {
private javax.ejb.SessionContext m_ctx = null;
* Sets the session context. Required by EJB spec.
* @param ctx A SessionContext object.
public void setSessionContext(javax.ejb.SessionContext ctx) {
m_ctx = ctx;
* Creates a bean. Required by EJB spec.
public void ejbCreate() {
System.out.println("ejbCreate() on obj " + this);
* Removes a bean. Required by EJB spec.
public void ejbRemove() {
System.out.println("ejbRemove() on obj " + this);
* Loads the state of the bean from secondary storage. Required by EJB spec.
public void ejbActivate() {
System.out.println("ejbActivate() on obj " + this);
* Keeps the state of the bean to secondary storage. Required by EJB spec.
public void ejbPassivate() {
System.out.println("ejbPassivate() on obj " + this);
* Required by EJB spec.
public void GreeterDBBean() {
* Returns the Greeting String based on the time
* @return the Greeting String.
public String getGreeting() throws java.rmi.RemoteException {
System.out.println("GreeterDB EJB is determining message...");
String message = null;
Calendar calendar = new GregorianCalendar();
int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
if(currentHour < 12) message = "morning";
else {
if( (currentHour >= 12) &&
(calendar.get(Calendar.HOUR_OF_DAY) < 18)) message = "afternoon";
else message = "evening";
System.out.println("- Message determined successfully");
return message;
************************ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2002 Sun Microsystems, Inc. All rights reserved.
-->
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<display-name>simple</display-name>
<ejb-name>simpleEJB</ejb-name>
<home>samples.jdbc.simple.ejb.GreeterDBHome</home>
<remote>samples.jdbc.simple.ejb.GreeterDB</remote>
<ejb-class>samples.jdbc.simple.ejb.GreeterDBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
************************sun-ejb-jar.xml
<sun-ejb-jar>
<enterprise-beans>
<name>simpleEjb.jar</name>
<ejb>
<ejb-name>simpleEJB</ejb-name>
<jndi-name>ejb/simpleHome</jndi-name>
<is-read-only-bean>false</is-read-only-bean>
<bean-pool>
<steady-pool-size>2</steady-pool-size>
<resize-quantity>5</resize-quantity>
<max-pool-size>20</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
</bean-pool>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
************************Assemble Info
C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar cvf simpleEjb.jar *
added manifest
ignoring entry META-INF/
adding: META-INF/ejb-jar.xml(in = 710) (out= 350)(deflated 50%)
adding: META-INF/sun-ejb-jar.xml(in = 803) (out= 424)(deflated 47%)
adding: samples/(in = 0) (out= 0)(stored 0%)
adding: samples/jdbc/(in = 0) (out= 0)(stored 0%)
adding: samples/jdbc/simple/(in = 0) (out= 0)(stored 0%)
adding: samples/jdbc/simple/ejb/(in = 0) (out= 0)(stored 0%)
adding: samples/jdbc/simple/ejb/GreeterDB.class(in = 210) (out= 168)(deflated 20%)
adding: samples/jdbc/simple/ejb/GreeterDBBean.class(in = 1441) (out= 734)(deflated 49%)
adding: samples/jdbc/simple/ejb/GreeterDBHome.class(in = 257) (out= 177)(deflated 31%)
C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar tf simpleEJB.jar
META-INF/
META-INF/MANIFEST.MF
META-INF/ejb-jar.xml
META-INF/sun-ejb-jar.xml
samples/
samples/jdbc/
samples/jdbc/simple/
samples/jdbc/simple/ejb/
samples/jdbc/simple/ejb/GreeterDB.class
samples/jdbc/simple/ejb/GreeterDBBean.class
samples/jdbc/simple/ejb/GreeterDBHome.class
******************************** Deployment Info
server1: Applications: EJB Modules: simpleEjb
EJB Module Name: simpleEjb
Location: C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1
******************************** simplEJB.jar_verified.txt
STATIC VERIFICATION RESULTS
NUMBER OF FAILURES/WARNINGS/ERRORS
# of Failures : 0
# of Warnings : 1
# of Errors : 0
Test Name : tests.ejb.ias.ASEjbJndiName
Test Assertion :
Test Description : PASSED [AS-EJB ejb] : jndi-name is ejb/simpleHome
WARNINGS :
Test Name : tests.ejb.businessmethod.BusinessMethodException
Test Assertion : Enterprise bean business method throws RemoteException test
Test Description : For [ module_simpleEjb#simpleEjb#simpleEJB ]
For EJB Class [ samples.jdbc.simple.ejb.GreeterDBBean ] business method [ getGreeting ]
Error: Compatibility Note: A public business method [ getGreeting ] was found, but EJB 1.0 allowed the business methods to throw the java.rmi.RemoteException to indicate a non-application exception. This practice is deprecated in EJB 1.1 ---an EJB 1.1 compliant enterprise bean should throw the javax.ejb.EJBException or another RuntimeException to indicate non-application exceptions to the Container.
*********************** server log (no binding info)
[05/Jan/2003:17:07:19] FINE ( 1760): [EJBClassPathUtils] EJB Class Path for [simpleEjb] is ...
[C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1, C:\Sun\AppServer7\domains\domain1\server1\generated\ejb\j2ee-modules\simpleEjb]
[05/Jan/2003:17:07:20] FINE ( 1760): Loading StatelessSessionContainer...
[05/Jan/2003:17:07:20] FINE ( 1760): [BaseContainer] Registered EJB [simpleEJB] with MBeanServer under name [ias:instance-name=server1,mclass=stateless-session-bean,name=simpleEJB,root=root,standalone-ejb-module=simpleEjb,type=monitor]
[05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_RemoteHomeImpl_Tie", codebase = ""
[05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
[05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
[05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_EJBObjectImpl_Tie", codebase = ""
[05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDB_Stub", codebase = ""
[05/Jan/2003:17:07:20] FINE ( 1760): [Pool-ejb/simpleHome]: Added PoolResizeTimerTask...
[05/Jan/2003:17:07:20] FINE ( 1760): Created container with uinque id: 68275827784351744
[05/Jan/2003:17:07:20] FINE ( 1760): Application deployment successful : com.sun.ejb.containers.StatelessSessionContainer@1083717
[05/Jan/2003:17:07:20] INFO ( 1760): LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
[05/Jan/2003:17:07:22] FINE ( 1760): Started 48 request processing threads
[05/Jan/2003:17:07:22] INFO ( 1760): CORE3274: successful server startup
[05/Jan/2003:17:07:22] FINE ( 1760): The server is now ready to process requests
[05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@10613aa
[05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1f52460
[05/Jan/2003:17:07:22] INFO ( 1760): CORE5053: Application onReady complete.
*********************** Client class
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties;
import java.util.Hashtable;
import javax.ejb.*;
import java.sql.*;
import javax.sql.*;
import samples.jdbc.simple.ejb.*;
public class HelloClient {
public static void main(String[] args) throws Exception {
javax.ejb.Handle beanHandle;
GreeterDBHome myGreeterDBHome;
GreeterDB myGreeterDBRemote;
InitialContext initContext = null;
Hashtable env = new java.util.Hashtable(1);
initContext = getContextInfo();
String JNDIName = "java:comp/env/ejb/simpleHome";
System.out.println("- Looking up: " + JNDIName);
myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(initContext.lookup(JNDIName), GreeterDBHome.class);
myGreeterDBRemote = myGreeterDBHome.create();
String theMessage = myGreeterDBRemote.getGreeting();
myGreeterDBRemote.remove();
public static InitialContext getContextInfo() {
InitialContext ctx = null;
String url = "iiop://1st:3700";
String fac = "com.sun.enterprise.naming.SerialInitContextFactory";
try {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, fac);
props.put(Context.PROVIDER_URL, url);
ctx = new InitialContext(props);
catch (NamingException ne){
System.out.println("We were unable to get a connection to " +
" the application server at " + url);
ne.printStackTrace();
return ctx;
*********************** Running Client from command line
C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>java HelloClient
- Looking up: java:comp/env/ejb/simpleHome
Exception in thread "main" javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/simpleHome
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at HelloClient.main(HelloClient.java:34) -
New Business Method in EJB not available in Webdynpro Model
Hi,
I am using EJBs for Business Logic in my webdynpro java application. I have added a new Business Method in one of the session bean. But I am not able to see the new method in webdynpro model. I am following the below procedure -
1. Select the Session bean.
2. Add New Business Method. It automatically adds the method in Remote and Local Interface.
3. Implement thie new method.
4. Build EJB project
5. Add it to EAR
6. Build EAR Project
7. Deploy EAR Project
After following above steps, when I am trying to create a model in my webdynpro project, it does not reflect the changes (context returned by new business method).
Can any one help me on this ?
Thanks in advance,
GauravThe issue is resolved. This is the case where methods in beans returns collections. For such scenario, relations have to be created manually, it does not come automatically. For details refer the blog at below link --
/people/balaramnaidu.bankuru/blog/2006/04/23/importing-complex-javabean-model-into-webdynpro-by-creating-relationships-for-the-model-classes
Thanks everyone.
Gaurav
Maybe you are looking for
-
I recently downloaded Mlountain Lion on my Imac. It shows that I have an update for Evernote that should be downloaded, but I cannot find out how to complete this update. It asks for me to sign in with my email address, but does not show how to do th
-
Can you run a Query in a Process Chain?
As part of a data validation process chain, I need to run a query and send the results by email. I've created the query (with the exception) and set it up in information broadcaster to be sent by email. I thought that I would be able to just drop i
-
How to stop the configuration wizard
Hi , I am running a configuration task(wizard based) in NWA(netweaver administrator). during the wizard, I lost internet connection, when I connected again, the application expired. I want to reexecute the wizard, but its status is "Currently execut
-
How do I install Tutorial Builder in Photoshop CC?
There are some tutorials for PSCC, so I know it can be done, but how? Is there a way to make the extension manager see it?
-
Re: DVBLocator getByte() and encode to MPEG2 PS
I found that irt MHP RI 1.1.1 has implemented this function, but it seems that irt don't want to publish their API yet. It allows you to tune to a TS and record it to local HD given several parameters such as recording date and duration. I tried to u