Re: [JBoss-user] MBean NameAlreadyBoundException

2001-08-01 Thread David Jencks

Hi,

Thanks for the info.

The mbeans for key generation are certainly fine, the security related one
I don't know enough about to comment on, however I don't think you need the
bean with the jndi name of the datasource.  I apologize for not being able
to give you the exact syntax, but (normally) you remap the jndi name used
in your beans to the jndi name the datasource is bound under.  This mapping
is not in java but in one of the xml config files - I think jboss.xml.

On 2001.07.30 09:29:14 -0400 Frederick N. Brier wrote:
 At 12:00 AM 7/30/2001, David Jencks wrote:
 Out of curiousity, what is the relationship between the ejbs and the
 mbeans?
 
 One of the MBean(s) is a incrementing key generator for the primary keys
 of 
 entity beans.  One is instantiated for each table.  The other two act as
 a 
 central place to stick configuration information.  One is security
 related 
 and stores the JNDI/LDAP server connection info as well as other related 
 security configuration.  The other is application related and stores a 
 reference to the DataSource.  It bothered me to have hard coded JNDI
 names 
 to look up the data sources spread out and in all the different methods
 of 
 all the EJBs.  So I have a base class that all EJBs extend that maintains
 a 
 lazy reference to the application MBean which contains any necessary 
 configuration information.  End result is there is only one hard coded
 JNDI 
 name in the base EJB class.  Currently the app MBean keeps a reference to
 
 the security MBean.  Does this sound ok, or am I violating any EJB server
 
 design rules and my code blow up?  Thanks again.
 
 Frederick N. Brier
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] MBean NameAlreadyBoundException

2001-07-30 Thread Frederick N. Brier

At 12:00 AM 7/30/2001, David Jencks wrote:
Out of curiousity, what is the relationship between the ejbs and the
mbeans?

One of the MBean(s) is a incrementing key generator for the primary keys of 
entity beans.  One is instantiated for each table.  The other two act as a 
central place to stick configuration information.  One is security related 
and stores the JNDI/LDAP server connection info as well as other related 
security configuration.  The other is application related and stores a 
reference to the DataSource.  It bothered me to have hard coded JNDI names 
to look up the data sources spread out and in all the different methods of 
all the EJBs.  So I have a base class that all EJBs extend that maintains a 
lazy reference to the application MBean which contains any necessary 
configuration information.  End result is there is only one hard coded JNDI 
name in the base EJB class.  Currently the app MBean keeps a reference to 
the security MBean.  Does this sound ok, or am I violating any EJB server 
design rules and my code blow up?  Thanks again.

Frederick N. Brier


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] MBean NameAlreadyBoundException

2001-07-29 Thread David Jencks

I'm highly confused by trying to guess what you might be doing.  What
configuration are you running? What do you mean by the second time a
server comes up?  Are you running any non-jboss mbean servers or jndis? 
My impression was that jboss jndi was 100% non persistent, when you stop
your jboss instance everything goes away, and this is what I observe.

Have you written your own mbean? How do you deploy it?

What exactly is your configuration, what you are doing, and the result you
don't like?

david jencks

On 2001.07.29 11:07:17 -0400 Frederick N. Brier wrote:
 The second time a server comes up the console is showing 
 NameAlreadyBoundException(s) when an MBean name in its JNDI bind() 
 call.  Now unbind() is called within the stopService() method, but my log
 
 message never shows that the stopService() method is ever called.   The 
 MBean extends org.jboss.util.ServiceMBeanSupport.  Now I could catch the 
 NameAlreadyBoundException and try to rebind() it, but that seems like a 
 hack or a preventative measure.  What do I need to do to get the 
 stopService method to be called?
 
 Lastly, is there an easy way to clear all the names out of the JBoss JNDI
 
 namespace, such as editing a flat text file,  or deleting a binary file 
 sitting in a JBoss directory?
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] MBean NameAlreadyBoundException

2001-07-29 Thread Jim Brownfield

This is probably not relavent, but I thought I'd throw it in.

I had a similar problem, and it turned out to be that somehow my MBean ended
up being put into jboss-auto.jcml twice without me knowing it.  What was
happening was two of my MBeans were trying to start at the same time, and
the second instance was getting the NameAlreadyBoundExceptionss.  I just
deleted the jboss-auto.jcml.  I was never able to reproduce the
circumstances causing the double entries, but I've seen it at least twice.

Probably not your problem, but FYI...

Jim

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Frederick N.
 Brier
 Sent: Sunday, July 29, 2001 8:07 AM
 To: [EMAIL PROTECTED]
 Subject: [JBoss-user] MBean NameAlreadyBoundException


 The second time a server comes up the console is showing
 NameAlreadyBoundException(s) when an MBean name in its JNDI bind()
 call.  Now unbind() is called within the stopService() method, but my log
 message never shows that the stopService() method is ever called.   The
 MBean extends org.jboss.util.ServiceMBeanSupport.  Now I could catch the
 NameAlreadyBoundException and try to rebind() it, but that seems like a
 hack or a preventative measure.  What do I need to do to get the
 stopService method to be called?

 Lastly, is there an easy way to clear all the names out of the JBoss JNDI
 namespace, such as editing a flat text file,  or deleting a binary file
 sitting in a JBoss directory?


 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] MBean NameAlreadyBoundException

2001-07-29 Thread David Jencks

Yes, if you are running a jboss version that reads jboss-auto.jcml, delete
it (jboss-auto) frequently.

This could perhaps cause apparent persistence of jndi bindings also.

david jencks

On 2001.07.29 14:15:13 -0400 Jim Brownfield wrote:
 This is probably not relavent, but I thought I'd throw it in.
 
 I had a similar problem, and it turned out to be that somehow my MBean
 ended
 up being put into jboss-auto.jcml twice without me knowing it.  What was
 happening was two of my MBeans were trying to start at the same time, and
 the second instance was getting the NameAlreadyBoundExceptionss.  I
 just
 deleted the jboss-auto.jcml.  I was never able to reproduce the
 circumstances causing the double entries, but I've seen it at least
 twice.
 
 Probably not your problem, but FYI...
 
 Jim
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]On Behalf Of Frederick
 N.
  Brier
  Sent: Sunday, July 29, 2001 8:07 AM
  To: [EMAIL PROTECTED]
  Subject: [JBoss-user] MBean NameAlreadyBoundException
 
 
  The second time a server comes up the console is showing
  NameAlreadyBoundException(s) when an MBean name in its JNDI bind()
  call.  Now unbind() is called within the stopService() method, but my
 log
  message never shows that the stopService() method is ever called.   The
  MBean extends org.jboss.util.ServiceMBeanSupport.  Now I could catch
 the
  NameAlreadyBoundException and try to rebind() it, but that seems like a
  hack or a preventative measure.  What do I need to do to get the
  stopService method to be called?
 
  Lastly, is there an easy way to clear all the names out of the JBoss
 JNDI
  namespace, such as editing a flat text file,  or deleting a binary file
  sitting in a JBoss directory?
 
 
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
  http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] MBean NameAlreadyBoundException

2001-07-29 Thread Frederick N. Brier

Jim, David, thank you.  I think you are both correct about the 
jboss-auto.jcml file.  Delete it and no duplicate messages.  I guess I 
should probably put the rebind in there in case the server gets restarted 
and the jboss-auto.jcml file has still references.

My configuration is JBoss 2.2.1 with Tomcat 3.2.1 in a single Sun 1.3.1 JVM 
running on Redhat Linux 7.0.  Only one JVM runs at any given time.  My 
reference was to Ctrl-C'ing the server, and then restarting it a second 
time.  Although I haven't gotten to the point where I am integrating JSPs 
and Servlets, I do have Apache set up as the httpd server with mod_jserv.

I've written 3 MBean(s) so far.  Ant builds their code in a jar and I then 
copy it into jboss/lib/ext (haven't tried to make ant do that yet), and 
make the appropriate entries in jboss.jcml.  Two of the MBean(s) are single 
instance and the last has multiple instances and entries in the jboss.jcml 
file.  I haven't fully tested them yet.  All the instances load without 
error, and appear to do what they are supposed to in startService().  Is 
this what you were asking?  Am I doing anything wrong?

I'm just learning all this EJB/JMX/JNDI/Castor(XML and JDO) and figuring 
out how all the pieces play with each other.  I've created 4 entity beans 
that are supported by the MBean(s).  Those also need to be tested.  I'd 
like to see my stopService log.debug() message (other debug messages are 
being displayed).

So far so good.  Thank you again.

Frederick N. Brier

At 12:53 PM 7/29/2001, you wrote:
I'm highly confused by trying to guess what you might be doing.  What
configuration are you running? What do you mean by the second time a
server comes up?  Are you running any non-jboss mbean servers or jndis?
My impression was that jboss jndi was 100% non persistent, when you stop
your jboss instance everything goes away, and this is what I observe.

Have you written your own mbean? How do you deploy it?

What exactly is your configuration, what you are doing, and the result you
don't like?

david jencks

On 2001.07.29 11:07:17 -0400 Frederick N. Brier wrote:
  The second time a server comes up the console is showing
  NameAlreadyBoundException(s) when an MBean name in its JNDI bind()
  call.  Now unbind() is called within the stopService() method, but my log
 
  message never shows that the stopService() method is ever called.   The
  MBean extends org.jboss.util.ServiceMBeanSupport.  Now I could catch the
  NameAlreadyBoundException and try to rebind() it, but that seems like a
  hack or a preventative measure.  What do I need to do to get the
  stopService method to be called?
 
  Lastly, is there an easy way to clear all the names out of the JBoss JNDI
 
  namespace, such as editing a flat text file,  or deleting a binary file
  sitting in a JBoss directory?
 
 
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
  http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] MBean NameAlreadyBoundException

2001-07-29 Thread David Jencks

Hi,

Glad it worked.

If you want to see an example of a junit test for mbean functionality, see
jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryTest.java.

There is something odd going on if your stopService method isn't logging
properly.  I'd try throwing an exception or something to make sure it isn't
being called, and find out why.  When I have problems like that it usually
turns out I made a typo or capitalization mistake.

Out of curiousity, what is the relationship between the ejbs and the
mbeans?

Thanks
david jencks

On 2001.07.29 19:34:26 -0400 Frederick N. Brier wrote:
 Jim, David, thank you.  I think you are both correct about the 
 jboss-auto.jcml file.  Delete it and no duplicate messages.  I guess I 
 should probably put the rebind in there in case the server gets restarted
 
 and the jboss-auto.jcml file has still references.
 
 My configuration is JBoss 2.2.1 with Tomcat 3.2.1 in a single Sun 1.3.1
 JVM 
 running on Redhat Linux 7.0.  Only one JVM runs at any given time.  My 
 reference was to Ctrl-C'ing the server, and then restarting it a second 
 time.  Although I haven't gotten to the point where I am integrating
 JSPs 
 and Servlets, I do have Apache set up as the httpd server with mod_jserv.
 
 I've written 3 MBean(s) so far.  Ant builds their code in a jar and I
 then 
 copy it into jboss/lib/ext (haven't tried to make ant do that yet), and 
 make the appropriate entries in jboss.jcml.  Two of the MBean(s) are
 single 
 instance and the last has multiple instances and entries in the
 jboss.jcml 
 file.  I haven't fully tested them yet.  All the instances load without 
 error, and appear to do what they are supposed to in startService().  Is 
 this what you were asking?  Am I doing anything wrong?
 
 I'm just learning all this EJB/JMX/JNDI/Castor(XML and JDO) and figuring 
 out how all the pieces play with each other.  I've created 4 entity beans
 
 that are supported by the MBean(s).  Those also need to be tested.  I'd 
 like to see my stopService log.debug() message (other debug messages are 
 being displayed).
 
 So far so good.  Thank you again.
 
 Frederick N. Brier
 
 At 12:53 PM 7/29/2001, you wrote:
 I'm highly confused by trying to guess what you might be doing.  What
 configuration are you running? What do you mean by the second time a
 server comes up?  Are you running any non-jboss mbean servers or jndis?
 My impression was that jboss jndi was 100% non persistent, when you stop
 your jboss instance everything goes away, and this is what I observe.
 
 Have you written your own mbean? How do you deploy it?
 
 What exactly is your configuration, what you are doing, and the result
 you
 don't like?
 
 david jencks
 
 On 2001.07.29 11:07:17 -0400 Frederick N. Brier wrote:
   The second time a server comes up the console is showing
   NameAlreadyBoundException(s) when an MBean name in its JNDI bind()
   call.  Now unbind() is called within the stopService() method, but my
 log
  
   message never shows that the stopService() method is ever called.  
 The
   MBean extends org.jboss.util.ServiceMBeanSupport.  Now I could catch
 the
   NameAlreadyBoundException and try to rebind() it, but that seems like
 a
   hack or a preventative measure.  What do I need to do to get the
   stopService method to be called?
  
   Lastly, is there an easy way to clear all the names out of the JBoss
 JNDI
  
   namespace, such as editing a flat text file,  or deleting a binary
 file
   sitting in a JBoss directory?
  
  
   ___
   JBoss-user mailing list
   [EMAIL PROTECTED]
   http://lists.sourceforge.net/lists/listinfo/jboss-user
  
  
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user