Hi,
I am using Weblogic 6.0 & wanna create topic dynamically...
and using following program ...
On execution it give the noAccessRunTimeException and in the weblogic log it is giving
***weblogic.management.NoAccessRuntimeException: User guest does not have access permission on weblogic.admin.mbean.MBeanHome***
i don't know how to give permission's.....
Waiting for Valuable Suggestions ...
Regards
Nand
package tms.com.ejb;
import weblogic.management.*;
import weblogic.jms.extensions.*;
import weblogic.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
/**
Author :- Nand Keswani
GlobalSoft Ptv Ltd.
Email
nandkeswani@indiatimes.com **/
public class DynamicTopic
{
public Context m_context;
String jmsServerName = "MyJMSServer";
public String m_url="t3://localhost:7001";
public String topicName = "DynamicTopic";
public String JNDIName = "nandTopic";
public void initParam()
{
try
{
//jmsServerName = ;
m_context = getInitialContext();
}
catch(Exception e)
{
System.out.println("Exception is " + e);
e.printStackTrace();
}
}
public void crtTopic()
{
System.out.println("This class will create Dynamically Topic");
try
{
JMSHelper.createPermanentTopicAsync(m_context,jmsServerName,topicName,JNDIName);
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception e is " + e);
}
}
private Context getInitialContext() throws NamingException {
try {
// Get an InitialContext
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, m_url);
return new InitialContext(h);
}
catch (NamingException ex) {
System.out.println("We were unable to get a connection to the WebLogic server at "+m_url);
System.out.println("Please make sure that the server is running.");
throw ex;
}
}
public static void main(String arg[])
{
DynamicTopic dTpc = new DynamicTopic();
dTpc.initParam();
System.out.println("After Initializing the Parameters");
dTpc.crtTopic();
System.out.println("Success ....");
System.out.println("Success ........");
System.out.println("Success ............");
System.out.println("After Creating Topic ");
}
}