• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamically Creating Topics On JMS ..... Want Expert's Guidence

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ");
}
}
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you are obtaining the initial context you are providing the Security credentials which consist of user name and passsword and that gives you right for the WLS server( what you can and can't do), You are creating context as the guest user and guest don't have the privileges to create Topic's.
Two solutions are
1. When you are creating context change guest to system and provide the right password for system.
2. Or change the rights of guest and give it privileges for creating Topics.
Hope it helps,
------------------
Vijay shrivastava
Consultant - ObjectNetTechnologies ,Atlanta USA.
SCJP2, WLS5.1,SCJEA (Part I)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic