You don't indicate which version of jboss you are using. For rabbithole,
you can find a working example in testsuite/src/org/jboss/test/JBossTestServices.java.
For previous versions, the ..../test/util/Deploy.java may provide a working
example.
david jencks
On 2001.09.18 22:29:16 -0400 Sheng Zou wrote:
> Hi,
>
> I am trying to access one MBean, which is deployed on JBoss at localhost,
> via JMXConnector. The code is like:
>
> _JMXConnector = new RMIClientConnectorImpl("localhost");
>
> and I have jndi.properties in my classpath as well. However, I got this
> exception:
>
> javax.naming.NoInitialContextException: Need to specify class name in
> environment or system property, or as an applet parameter, or in an
> application resource f
> ile: java.naming.factory.initial
> at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:646)
> at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
> at
> javax.naming.InitialContext.getEnvironment(InitialContext.java:475)
> at
> org.jboss.jmx.client.RMIClientConnectorImpl.start(RMIClientConnectorImpl.jav
> a:92)
> at
> org.jboss.jmx.client.RMIClientConnectorImpl.<init>(RMIClientConnectorImpl.ja
> va:78)
> at HeartBeat.appHeartBeat(HeartBeat.java:26)
> at HeartBeat.run(HeartBeat.java:54)
> at java.lang.Thread.run(Thread.java:484)
>
> Please help!
>
> Thanks,
> Sheng
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
> <TITLE></TITLE>
>
> <META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
> <BODY>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001>Hi,</SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001></SPAN></FONT></FONT></FONT> </DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001>I am trying to access one MBean, which is
> deployed on
> JBoss at localhost, via JMXConnector. The code is
> like:</SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001></SPAN></FONT></FONT></FONT> </DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001>_JMXConnector = new
> RMIClientConnectorImpl("localhost");</SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001></SPAN></FONT></FONT></FONT> </DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001>and I have jndi.properties in my classpath as
> well.
> However, I got this exception: </SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001></SPAN></FONT></FONT></FONT> </DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT
> size=2>javax.naming.NoInitialContextException: Need to specify class name
>
> in<SPAN class=156502602-19092001> </SPAN><SPAN
> class=156502602-19092001> </SPAN>environment or system property, or
> as an
> applet parameter, or in an application<SPAN
> class=156502602-19092001> </SPAN>resource f<BR>ile:
> java.naming.factory.initial<BR>
>
> at<SPAN
>
>class=156502602-19092001> </SPAN>javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:646)<BR>
>
> at<SPAN
>
>class=156502602-19092001> </SPAN>javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)<BR>
>
> at<SPAN
>
>class=156502602-19092001> </SPAN>javax.naming.InitialContext.getEnvironment(InitialContext.java:475)<BR>
>
> at<SPAN
>
>class=156502602-19092001> </SPAN>org.jboss.jmx.client.RMIClientConnectorImpl.start(RMIClientConnectorImpl.java:92)<BR>
>
> at<SPAN
>
>class=156502602-19092001> </SPAN>org.jboss.jmx.client.RMIClientConnectorImpl.<init>(RMIClientConnectorImpl.java:78)<BR>
>
> at
>
>HeartBeat.appHeartBeat(HeartBeat.java:26)<BR>
>
> at
> HeartBeat.run(HeartBeat.java:54)<BR>
>
> at java.lang.Thread.run(Thread.java:484)<BR><BR><SPAN
> class=156502602-19092001>Please help!</SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001></SPAN></FONT></FONT></FONT> </DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001>Thanks,</SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001>Sheng </SPAN></FONT></FONT></FONT></DIV>
> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
> class=156502602-19092001> </SPAN></FONT></FONT></FONT></DIV></BODY></HTML>
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user