Using LanguageMap in an MBean
Hi all,
I posted a similar question to weblogic.developer.interest.security but somebody suggested that this post would be better suited for this forum:
We're developing an Authentication provider for WebLogic 8.1. We would like to have our Authentication Provider MBean support multiple languages. I've experimented with the LanguageMap attribute (a BEA-specific attribute, apparently) but with no success. Has anybody been able to get these to work?
The spec states that the path should be fully qualified, which I take to mean that it needs to be an absolute path. I found this to be a bit unreasonable but tried it nonetheless. Unfortunately, it did not work.
I've also tried specifying the path in Java-style resource bundle form (eg// com.mycompany.mypackage.myresources) and relative paths but, again, with no success.
I pack the resource file with the authentication mbean jar.
Some examples of what I've done:
(absolute path case, where I just copied my resources file to somewhere on my comp):
<MBeanAttribute
Name = "BDOption"
LanguageMap = "c:/dev/BDResources.properties"
DisplayName = "option.bdoption"
Type = "java.lang.String"
Writeable = "true"
Default = ""Default Value""
/>
(java resource bundle case):
<MBeanAttribute
Name = "BDOption"
LanguageMap = "com.mycompany.mypackage.BDResources"
DisplayName = "option.bdoption"
Type = "java.lang.String"
Writeable = "true"
Default = ""Default Value""
/>
My resource file has only the following entry:
option.bdoption=Brian's Option
But the option will always appear as "BDOption" rather than "Brian's Option"
Any help would be appreciated,
Brian
Hi Satya, thanks for the response.
So, despite the fact that LanguageMap is a documented property for BEA-specific MBeans, it's not actually supported? That'd be odd and disappointing but, so far, I haven't seen anything that would indicate otherwise.
The reference is here:
http://e-docs.bea.com/wls/docs81/dvspisec/mdf_ref.html#1047007
Anybody have any suggestions as to what would be a good method to support multiple languages in my MBean?
Similar Messages
-
How to use LanguageMap attribute for Authentication Providers?
Hi all,
I couldn't find a BEA MBean-specific forum, so I'll post this here and hope you can point me to the correct people to talk to.
We're developing an Authentication provider for WebLogic 8.1. We would like to have our Authentication Provider MBean support multiple languages. I've experimented with the LanguageMap attribute but with no success. Has anybody been able to get these to work?
The spec states that the path should be fully qualified, which I take to mean that it needs to be an absolute path. I found this to be a bit unreasonable but tried it nonetheless. Unfortunately, it did not work.
I've also tried specifying the path in Java-style resource bundle form (eg// com.mycompany.mypackage.myresources) and relative paths but, again, with no success.
I pack the resource file with the authentication mbean jar.
Some examples of what I've done:
(absolute path case, where I just copied my resources file to somewhere on my comp):
<MBeanAttribute
Name = "BDOption"
LanguageMap = "c:/dev/BDResources.properties"
DisplayName = "option.bdoption"
Type = "java.lang.String"
Writeable = "true"
Default = ""Default Value""
/>
(java resource bundle case):
<MBeanAttribute
Name = "BDOption"
LanguageMap = "com.mycompany.mypackage.BDResources"
DisplayName = "option.bdoption"
Type = "java.lang.String"
Writeable = "true"
Default = ""Default Value""
/>
My resource file has only the following entry:
option.bdoption=Brian's Option
But the option will always appear as "BDOption" rather than "Brian's Option"
Any help would be appreciated,
Brianrefer the following links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/092dddc6-0701-0010-268e-fd61f2035fdd
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2a56861-0601-0010-bba1-e37eb5d8d4a9
please let me know if u dont find relevant information -
Accessing Work Managers Using MBeans forum
hi all,
I am trying to write code using JMX that gives me all work manager that I've created on WLS 9.0 but when trying to retrieve it using getMBeansByType() shows me MBean size as zero and with getRuntimeMBean() it shows me instance not found in short it doesn't return MBeans so i am not able to get name of workmanager.
Intially problem seems with workmanager configuration but i am sure i have configured properly
waitting for your reply
thanx
NihilNevermind... It works but not with the old Jive SBS app. There is a newer one called Jive Mobile.
-
Can I use a userKeyFile/userConfigFile as credentials for a JMX connection?
All,
Using a wlst script I created a userKeyFile and userConfigFile so that I can run weblogic scripts without providing the weblogic password. I'd like to use these for my MBean calls from Java as well but I cannot find documentation on using creds other than username/password. All examples I found are similar to (example taken from oracle documentation):
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
in wlst scripts, to use the key files I call (example taken from http://blogs.oracle.com/bala/entry/encrypt_the_credentials_when_r):
connect(userConfigFile='/usr/home/user1/configfile.secure', userKeyFile='/usr/home/user1/keyfile.secure', url='t3://host:port')
So how to I provide these in the Map used by JMXConnectorFactory?
thanksYes, it can be made to work. The Mini would become a media server on your local network.
-
Problems displaying MBeans in wlss 4.0
I've problems in displaying MBeans in wlss 4.0 using jconsole jdk5.
I usually use Jconsole to display MBeans without problem with wlss previous releases
thanks in advanceWhat essentially is the problem .
You can use following procedure i believe
1. Use the following JMX connection URL:
service:jmx:iiop://<host>:<port>/jndi/weblogic.management.mbeanservers.domainruntime
Substitute the adminserver listen host and port in above url.
2. Provide administrative username and password (e.g. weblogic/weblogic or whatever credentials you specified while creating domain) when connecting.
3. Invoke JConsole with a specific classpath and JVM args e.g
jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:$MW_HOME/wlserver_10.3/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
Substitute $JAVA_HOME and $MW_HOME variables accordingly as per your setup.
Hope it helps.
Anurag bahl -
Updating a Property in my Custom Authenticator MBean
I have created a custom AuthenticationProvider. It is configured through an
MBean produced by WebLogicMBeanMaker from my XML file. I have a custom
property in the XML file with a default value. My AuthenticationProvider is
able to get the bean and read back the default value.
Now, I wish to change that value to something else to allow uses to
configure the provider. The documentation clearly says that I will be
unable to use the Weblogic Console to do this and will have to use the
command line "weblogic.Admin" application to do it. This is fine, but I
cannot figure out how to access or modify my MBean.
How do I know the MBeans name or type? The MBean generated is called
WeblogicCarbonAuthenticatorMBean.java
I have tried (I have not include username/password in this post for brevity)
java weblogic.Admin GET -type WeblogicCarbonAuthenticator
No MBeans found
java weblogic.Admin GET -type Authenticator
No MBeans found
No success.
I also deployed a pair of JSPs called listMBeans.jsp and showMBean.jsp,
which claim to show me all the MBeans deployed. Searching through the list
I see nothing with the world "Carbon" or "Authenticator" in it.
How can I find/configure my Authenticator MBeans?
Thanks
-jordanJordan Reed wrote:
Getting there! I can now look at my bean, but I cannot seem to update it.
There is a string property on the MBean called "UserManagerLocation" that I
need the end user to be able to update to their appropriate location.
I am able to use the weblogic.Admin utility to query the MBean, but not to
update.
So here is my query:
java weblogic.Admin -pretty GET -mbean
Security:Name=myrealmWeblogicCarbonAuthenticator
MBeanName: "Security:Name=myrealmWeblogicCarbonAuthenticator"
ControlFlag: REQUIRED
Description: Carbon Authentication Provider adapts authentication
behavior to the User Manager Service
ProviderClassName:
com.sapient.services.security.auth.weblogic7.WeblogicCarbonAuthenticationPro
vider
Realm: Security:Name=myrealm
UserManagerLocation: /security/management/test/RdbmsUserManager
Version: 4.2
But here is my failing update:
java weblogic.Admin SET -mbean
Security:Name=myrealmWeblogicCarbonAuthenticator -property
UserManagerLocation "/security/management/RdbmsUserManager"
MBean not specified for setting of attributes. Value UserManagerLocation for
parameter ["9"]Get rid of the "'s around the Value. If that does not work, try
something like this,
java weblogic.Admin SET -mbean
Security:Name=myrealmWeblogicCarbonAuthenticator -commotype -property
UserManagerLocation /security/management/RdbmsUserManager
If that does not work, please open a support case with BEA.
Thanks,
-satya
>
>
>
But, inside my MBean descriptor I've got it set as writable:
<MBeanType
Name = "WeblogicCarbonAuthenticator"
DisplayName = "WeblogicCarbonAuthenticator"
Package = "com.sapient.services.security.auth.weblogic7"
Extends =
"weblogic.management.security.authentication.Authenticator"
PersistPolicy = "OnUpdate"
Writable = "true"
>
<MBeanAttribute
Name = "UserManagerLocation"
Type = "java.lang.String"
PersistPolicy = "OnUpdate"
Readable = "true"
Writeable = "true"
Default =
""/security/management/test/RdbmsUserManager""
/>
</MBeanType>
Any clue why I am unable to update the attribute from the command line?
Thanks
-Jordan
"Satya Ghattu" <[email protected]> wrote in message
news:[email protected]...
Jordan,
You can use weblogic.Admin utility to change values of your custom MBean
if you know the object name of your MBean.
Jordan Reed wrote:
I have created a custom AuthenticationProvider. It is configured
through an
MBean produced by WebLogicMBeanMaker from my XML file. I have a custom
property in the XML file with a default value. MyAuthenticationProvider is
able to get the bean and read back the default value.
Now, I wish to change that value to something else to allow uses to
configure the provider. The documentation clearly says that I will be
unable to use the Weblogic Console to do this and will have to use the
command line "weblogic.Admin" application to do it. This is fine, but I
cannot figure out how to access or modify my MBean.
How do I know the MBeans name or type? The MBean generated is called
WeblogicCarbonAuthenticatorMBean.java
I have tried (I have not include username/password in this post forbrevity)
java weblogic.Admin GET -type WeblogicCarbonAuthenticator
No MBeans foundyou should use the fully qualified MBean name. i.e
java weblogic.Admin GET -type foo.blah.WeblogicCarbonAuthenticator
java weblogic.Admin GET -type Authenticator
No MBeans found
No success.
I also deployed a pair of JSPs called listMBeans.jsp and showMBean.jsp,
which claim to show me all the MBeans deployed. Searching through the
list
I see nothing with the world "Carbon" or "Authenticator" in it.
How can I find/configure my Authenticator MBeans?I assume that you are using 7.0sp1, if not please upgrade to sp1. You
should see a file called CommoConfig.xm.booted file under your domain
directory, this file contains all the security MBeans that the server
found. You should be able to get the object names of your custom mbeans
from this file.
Hope it helped,
-satya
Thanks
-jordan -
Time constrain in Core Java...not using Threads
Hi All,
I m designing a very small practice application in Java. I am running the program thru command prompt. Once the program starts, I want user t respond in certain amount of time, lets say 3 seconds.
I tried looking for some "TIMER" classes in java api docs.
most classes are used with Thread or MBean. I dont want to implement it this way.
Could anyone pls help me identify how can this be implemented in core java without any fency classes like Thread being used.
Looking forward for response.shilpadahiya wrote:
Hi All,
I m designing a very small practice application in Java. I am running the program thru command prompt. Once the program starts, I want user t respond in certain amount of time, lets say 3 seconds. You need to be clearer. When the three seconds are over do you want the program to output "times up!" and proceed, or do you want the program to wait for as long as it takes the user to answer and only after they answer the program responds, "you took 7.9 seconds!"
I tried looking for some "TIMER" classes in java api docs.
most classes are used with Thread or MBean. I dont want to implement it this way.Why not? -
Need Help - Custom Identity Assertor using MBenMaker known issue CR207766
I am facing below WL 9 knwon issue in WebLogic 10. How to resolve it , do I need to create constructor in identity Asserter IMPL classes ? If yes, what goes inside constructor. Pls help as there is no reference for this issue in WebLog release after WL 9. Below is as in WL 9 site at
http://edocs.bea.com/wls/docs90/issues/known_resolved.html
CR207766
The intermediate files that the WebLogic Server 9.0 BETA MBeanMaker generates erroneously includes two types of constructors for you to complete. One type is based on ModelMBean and the other type is based on RequiredModelMBean.
The constructors that are based on ModelMBean will no longer be generated or supported after this Beta release.
Workaround:
When using MBeanMaker to create MBeans for custom security providers, supply content only for the constructors that are based on RequiredModelMBean.Not related to the issue. How do you build your project containing provider? Do you use workshop IDE build? Thanks
-
JMX jconsole -- where is my MBean?
I'm missing something here in 5.0b2's JMX. I've put together a rudimentary standard MBean together, and want to view the data from jconsole (on the MBeans tab). Here's the code I used below to register the MBean.
String domain = "UserDomain";
String mbeanClassName = "iccs.support.utilities.corba.ConnectionManagementInfo";
MBeanServer mbs = MBeanServerFactory.createMBeanServer();
ObjectName mbeanObjectName = new ObjectName(domain + ":type=" + mbeanClassName);
mbs.createMBean(mbeanClassName, mbeanObjectName);
This compiles and runs without error. I can connect to the process with jconsole successfully, but nothing shows up on the tab. I'm finding little documentation to help me out with this very simple case. Am I missing something?It seems your MBean server has no RMI connector or protocol adaptor attached.
If you don't want the trouble to create an RMI connector use the JVM platform MBean server:
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); -
Call to JDBCConnectionPoolRuntime MBean hangs
I have written a program to get hold of a number of MBeans and periodically
call their getXXX() methods.
All is working OK apart from I intermittently have my program hang on calls
to JDBCConnectionPoolRunTime. The call never returns and as such the
thread I am using to monitor that MBean hangs and needs to be killed.
Does anyone have any ideas why this may be happening or has anyone else
experienced this?
WLS6.1 sp2
Windows2000
Oracle thin driver
Regards
EdSome information I forgot:
The MBean for the pool then is completely unusable until WLS is bounced! I
presume that although I am killing my monitoring program, the call is still
held somewhere?
This is very frustrating as monitoring the JDBC pools was one of the reason
for writing the code.
Regards
Ed
"Ed Barrett" <[email protected]> wrote in message
news:ab90ir$q94$[email protected]..
I have written a program to get hold of a number of MBeans andperiodically
call their getXXX() methods.
All is working OK apart from I intermittently have my program hang oncalls
to JDBCConnectionPoolRunTime. The call never returns and as such the
thread I am using to monitor that MBean hangs and needs to be killed.
Does anyone have any ideas why this may be happening or has anyone else
experienced this?
WLS6.1 sp2
Windows2000
Oracle thin driver
Regards
Ed -
How can I discover the MBeans in the JVMs in the local host?
I'm new to the JMX world and am trying to figure out how to get my JMX client to discover the MBeanServers in the local host, just like jconsole does.
In more detail, I have a JMX client running in machineA that I want to use to talk to MBeans in 4 other JVMs also running in machineA. I can get the system to work if I use the -Dcom.sun.management.jmxremote and -Dcom.sun.management.jmxremote.port options specifying an RMI port for access. However, I would like to have it work the same way it does with jconsole, where only the -Dcom.sun.management.jmxremote flag is necessary and it seems to automagically discover all the MBeanServers in the local machine.
I've waded through a few tutorials, the API and searched this forum but could not find any hints on how to do this.
Any help would be appreciated,
- AlexHi,
JConsole uses the attach API to connect to the platform MBeanServer of a local java process.
See the ConnectionArgs class shown here for an example of using the Attach API:
[http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm |http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm ]
-- daniel
[http://blogs.sun.com/jmxetc|http://blogs.sun.com/jmxetc] -
Has anyone used configmbean - for instance the declaration could be like this in orion-application.xml -
<jmx-config-mbean
objectname=":type=test,name=testconf"
class="demo.oc4j.jmx.wc.TestConf"
location="simplembeans.jar">
<description> The config MBean that controls the main screens customization </description>
<config-file path="webcache.xml" injection-name="configfile" />
</jmx-config-mbean>
I am facing 2 problems , not able to locate the jar file which contains - oracle.as.config.MutableRepositoryFile and there is a compilation error for @inject annotation ...Could some one give some inputs if they have used configMBean ?
The MBean looks like follows -
package demo.oc4j.jmx.standard;
import oracle.as.config.*;
import javax.management.*;
import java.io.*;
* The MBean implementation class which demonstrates configuration mBean
public class TestConf
private MutableRepositoryFile wcConf = null;
public TestConf()
public void load()
System.out.println("%%%%%%%%%% Inside load of WebCache %%%%%%%%%%%%%%");
public void store()
System.out.println("%%%%%%%%%% Inside store of WebCache %%%%%%%%%%%%%%");
@inject("configfile")
public void setConfigScreen(MutableRepositoryFile myConf)
throws IOException {
this.wcConf = myConf;
System.out.println("%%%%%%%% trigger configuration reload %%%%%%%%%%");
}Has anyone used configmbean - for instance the declaration could be like this in orion-application.xml -
<jmx-config-mbean
objectname=":type=test,name=testconf"
class="demo.oc4j.jmx.wc.TestConf"
location="simplembeans.jar">
<description> The config MBean that controls the main screens customization </description>
<config-file path="webcache.xml" injection-name="configfile" />
</jmx-config-mbean>
I am facing 2 problems , not able to locate the jar file which contains - oracle.as.config.MutableRepositoryFile and there is a compilation error for @inject annotation ...Could some one give some inputs if they have used configMBean ?
The MBean looks like follows -
package demo.oc4j.jmx.standard;
import oracle.as.config.*;
import javax.management.*;
import java.io.*;
* The MBean implementation class which demonstrates configuration mBean
public class TestConf
private MutableRepositoryFile wcConf = null;
public TestConf()
public void load()
System.out.println("%%%%%%%%%% Inside load of WebCache %%%%%%%%%%%%%%");
public void store()
System.out.println("%%%%%%%%%% Inside store of WebCache %%%%%%%%%%%%%%");
@inject("configfile")
public void setConfigScreen(MutableRepositoryFile myConf)
throws IOException {
this.wcConf = myConf;
System.out.println("%%%%%%%% trigger configuration reload %%%%%%%%%%");
} -
MBean registered in MBeanServer automatically?
Hi,
After I create an Coherence object using new ObejctName(), will this object be automatically registered to the MBeanServer?
Thanks,
MikeHi Mike,
I think I finally understand what you're trying to do. Correct me if my assumptions are wrong:
(1) The process that you are launching with the first script is a Coherence Command Line Utility. You would like to expose all MBeans registered by this node remotely, including your custom MBean.
(2) The Tomcat process that you are launching with the second script is serving as an admin server. Its purpose is to use JMX to render MBeans exposed by the first process.
If my assumptions are correct, you'll need to do the following:
(1) Remove the code that registers your custom MBean from your admin web application.
(2) Create a CacheFactory "wrapper" class that registers your custom MBean and then calls CacheFactory.main(). For example:
package com.tangosol.examples;
import com.tangosol.net.CacheFactory;
import com.tangosol.net.Cluster;
import com.tangosol.net.management.Registry;
public class MyCacheFactory extends CacheFactory
public static void main(String[] asArg)
throws Exception
Cluster cluster = CacheFactory.ensureCluster();
Registry registry = cluster.getManagement();
registry.register(registry.ensureGlobalName("type=JvmLabel"), new JvmLabel());
CacheFactory.main(asArg);
}(3) Substitute your CacheFactory "wrapper" class for com.tangosol.net.CacheFactory in your first script.
Regards,
Jason Howes -
MBeanServer location in JNDI tree
Hello,
I'm testing methods that use a MBeanServer from JConsole and MBean browser in EM console. I launch the JConsole using this parameters:
jconsole -J-Djava.class.path=/home/user/wlfullclient-10.3.5.0.jar:/usr/java/jdk1.6.0_30/lib/jconsole.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
When I use the JConsole for testing I obtain the MBeanServer in this way:
InitialContext ctx = new InitialContext();
server = (MBeanServer)ctx.lookup("java:comp/jmx/runtime");
And when I use the MBean browser I have to to use this code:
server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
I'm following the next Oracle documentation, but I want to know if there is other way to use only once String to found the MBeanServer in the JNDI tree.
Does anybody know a different way to do this?
Thanks in advance,
Make Local Connections to the Runtime MBean Server+
Local clients can access a WebLogic Server instance’s Runtime MBean Server through the JNDI tree instead of constructing a JMXServiceURL object. Only the Runtime MBean Server registers itself in the JNDI tree.+
When accessed from JNDI, the Runtime MBean Server returns its javax.management.MBeanServer interface. This interface contains all of the methods in the MBeanServerConnection interface plus additional methods such as registerMBean(), which local process can use to register custom MBeans. (See MBeanServer in the J2SE 5.0 API Specification.)+
If the classes for the JMX client are located at the top level of an enterprise application (that is, if they are deployed from the application’s APP-INF directory), then the JNDI name for the Runtime MBean Server is:+
java:comp/jmx/runtime
If the classes for the JMX client are located in a Java EE module, such as an EJB or Web application, then the JNDI name for the Runtime MBeanServer is:+
java:comp/env/jmx/runtime
For example:
InitialContext ctx = new InitialContext();
server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");Hi,
I have same problem.
I have developed some libs (with common functionality to be used in many places, utils, and so) which I deploy in $DOMAIN/lib. I also have an ear, with ApplicationLifecycleListener to register some MBeans in the MBeanServer and they make use of this shared libs.
The thing is that if I access on of my MBeans from JConsole and if I access the same MBean from within em console, my app needs to look at different locations in the JNDI tree for the MBeanServer. Shouldn't this code, as it is running in the same location need to locate the MBeanServer the same way? Or because the client application in one case is remote, and in the other is local, need to look for the MBeanServer in one location and if not found in the other.
Think that code is deployed as a Util class in the DOMAIN/lib directory.
Thanks, -
Suspending JMS event generator
Hi,
How do I suspend a jms event dynamically?
I know that this can be done with WLI Admin Console but is there another way to do this without user intervention?
Help appreciated.Hello,
event generators are in most cases EJBs (the HTTP event generator may be the only exeption).
Suspending is actually equal to undeploying.
I do not know, if you can use the event generator MBeans, but you can always use the weblogic.Admin command to undeploy/redeploy a JMS event generator.
-Kai
Maybe you are looking for
-
I initially tried to do this at 11:39pm last night. I cleaned up my apps, backed up to my computer and then took the plunge. It downloaded fine, everything went ok until I tried to restore backup. I received a message that there was an error in iTune
-
Automatic clearing for G/L account
Hi Experts, the program is SAPF124, T-code is F.13. i have one requirment, please provide valuable solutions.... my object current functionality is the program checks tolerance limit and it will post this amt into perticular account.in this program
-
I have tried many of the suggested solutions from online communities, like uninstalling and reinstalling, but I still have the same problem - Firefox disappears from my dock, when I click on the 'question mark' in the dock to open it, I'm asked to co
-
Can't install BBdesktopsoftware DEP in windows XP
I can't install the BB Desktop software on my PC, Windows XP. Windowsinstaller is every time stopped this instalation., by DEP= Data Execution Prevention. Is ther a DEP compitable version Of the desktopsoftware?? I hope someone knows what I have to d
-
What is Execute to Parse % and how to tune it when it lower?
What is Execute to Parse % and how to tune it when it is lower?