JMX Notification
Hi,
I am new to JMX,
I have written sample code after looking at the examples provided in CodeShare...
The requirement in my project is .. We need to recieve notifications from Weblogic MBeans like JDBCConnectionPoolRuntime, JVMRuntime etc,
I am able to add a NotificationListener to the above MBeans, but i am not able to get any notifications from the Listener.. even there is change in the attibutes of above MBeans.
I tried an example which registers to LogBroadcasterRuntime but the example code also did not throw any notifications.
Please help me out ..
Thanks and Regards,
Keerthi
( I have another thought using JMX notifications with spring 2.0. The easiest way to send notifications is to inherit from NotificationBroadcasterSupport, however trouble arises when inheritance is already in use.
Is there a nice way to avoid implementing addNotificationLister, removeNotificationListener and sendNotification which are part of the otificationBroadcaster ? )
......and at the expense of coupling to both spring and jmx the notificationPublisher is an excellent tool to satisfy my demands .........
Message was edited by:
Toxic
Message was edited by:
Toxic
Similar Messages
-
Org.omg.CORBA.MARSHAL exception For JMX Notification
I am running Weblogic 9.2 java version 1.5.0_04 and I am tring to recieve JMX Notifications from a Custom MBean running in Weblogic but I keep recieving the following exception:
Jan 5, 2007 12:55:25 PM ClientNotifForwarder NotifFetcher-run
SEVERE: Failed to fetch notification, stopping thread. Error is: java.rmi.MarshalException: CORBA MARSHAL 0 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: Maybe
java.rmi.MarshalException: CORBA MARSHAL 0 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: Maybe
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:197)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
at org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub.fetchNotifications(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs(RMIConnector.java:1285)
at com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchNotifs(ClientNotifForwarder.java:508)
at com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.run(ClientNotifForwarder.java:399)
at com.sun.jmx.remote.internal.ClientNotifForwarder$LinearExecutor$1.run(ClientNotifForwarder.java:83)
Caused by: org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: Maybe
I received this first by trying JConsole that comes with JDK 1.5. This only occurs with JMX Notifications because I am able to execute the MBean operation of the MBean and I can see my custome MBean being executed in WebLogic but my custom mbean sends out a JMX Notifications and that causes
the above exception.
I wrote my own NotificationListener program to make sure that it is not a JConsole problem and I got the same problem. I tried using t3 and rmi protocol to see if one of them would work but neither worked. See the code below for the Notification Listener:
// String protocol = "t3";
//String jndiroot = "/jndi/";
String protocol = "rmi";
String jndiroot = new String("/jndi/iiop://" + hostName + ":" + port + "/");
String myserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = null;
try {
serviceURL = new JMXServiceURL(protocol, hostName, port, jndiroot + myserver);
} catch (MalformedURLException e1) {
logger.debug("malformedURLexception caught");
e1.printStackTrace();
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");
try {
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
} catch (IOException e1) {
e1.printStackTrace();
logger.debug("The connection is : " + connection.toString());
ObjectName mbeanName = null;
try {
mbeanName = new ObjectName("Mbean:Name=com.test.bean,Type=TestMBean,Location=AdminServer");
logger.debug("Created MBeanObjectName: " + mbeanName.toString());
} catch (MalformedObjectNameException e) {
e.printStackTrace();
} catch (NullPointerException e) {
e.printStackTrace();
try {
logger.debug("The mbean is registered " + connection.isRegistered(mbeanName));
} catch (IOException e1) {
e1.printStackTrace();
try {
connection.addNotificationListener(mbeanName, this,null, null);
logger.debug("the connection is added a listener : " + connection.isInstanceOf(mbeanName, "com.test.bean.MBean"));
logger.debug("Listener registered ...");
//Keeping the remote client active.
System.out.println("waiting for notifications, got to log file for details....");
System.in.read();
} catch (InstanceNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
public void handleNotification(Notification n, Object arg1) {
logger.debug("******************************************");
logger.debug("* Notification count : " + counter++ + ", Notification received at "
+ new Date().toString());
logger.debug("* type = " + n.getType());
logger.debug("* message = " + n.getMessage());
logger.debug("* source = " + n.getSource());
logger.debug("* seqNum = "
+ Long.toString(n.getSequenceNumber()));
logger.debug("* timeStamp = " + new Date(n.getTimeStamp()));
logger.debug("* userData = " + n.getUserData());
logger.debug("*******************************************");
I commented out the t3 protocol but it doesn't work for both protocol types. I implemented a Notification Listener within WebLogic and that
worked right away using the following code below:
InitialContext ctx = new InitialContext();
rmbs = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
As the document "Developing Custom Management Utilities with JMX" on page 4-7 "Make Local Connections to the Runtime MBean Server" described.
Has anyone seem the above exception "Failed to fetch notification, stopping thread. Error is: java.rmi.MarshalException: CORBA MARSHAL 0" when a client is trying to receive JMX Notification? All help would be greatly appreciated.
Thanks,
AjayHi ajay,
How did u manage to access the mbeanserver in BEA ? Can u pls brief on that. Even I am trying the same. But, the MBEANSERVEROBJECT i create, eventhough has NO NULL value, is not able to acces the mbean. Any method access through this object creates an EXCEPTION. Please help me too. I will try solving ur problem too.:-)
Also, do i need to put my MBEAN CLASS in the weblogic server ? Should i create an APP SERVER in BEA ?
I appreciate ur early response, dude.. -
How JMX notifications could be sent and received remotely?
How JMX notifications could be sent and received remotely?
Sun has a product called JDMK which does just that. Its actually pretty good and not too expensive.
I believe latest versions of JBoss can do it as well. Don't know about other vendors.
As a last resort you could intercept the notifications yourself and forward then as ordinary RMI/EJB/whatever calls. -
Can a stateless session EJB register itself to receive notifications from a JMX
MBean? What are the pros/cons of doing this?
Thanks
RajaCan a stateless session EJB register itself to receive notifications froma JMX
MBean? What are the pros/cons of doing this?You probably want to write a thin adapter (non-EJB) to do that, and it can
call the EJB.
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com/coherence.jsp
Tangosol Coherence: Clustered Replicated Cache for Weblogic
"Raja Hayek" <[email protected]> wrote in message
news:[email protected]..
> -
There is
getNotificationInfo Successful
The operation [getNotificationInfo] was successfully invoked for the MBean [bean:name=test].
The operation returned with the value:
[Ljavax.management.modelmbean.ModelMBeanNotificationInfo;@1b9d4d8
in http://127.0.0.1:9292/ and
getNotificationInfo button in jconsole doesn't print any error. But there is
21-Feb-2006 17:39:11 RequiredModelMBean getAttributes(String[])
SEVERE: Failed to get "NewNumber": javax.management.AttributeNotFoundException: getAttribute failed: NewNumber is not readable
21-Feb-2006 17:39:11 RequiredModelMBean getAttributes(String[])
SEVERE: Failed to get "NotificationInfo": javax.management.MBeanException: An exception occured while trying to get an attribute value through a RequiredModelMBean
when making some operation on the bean in jconsole. Where should I check?
Tried to extend NotificationBroadcasterSupport class instead of NotificationBroadcaster interface implementation (like is many examples in web), but that gave absolutely no affect....
In general everything must be easy.
The steps seem to be such:
Server must be started, beans must be exported to the server.
The beans that must be listened should implement NotificationBroadcaster interface or extend NotificationBroadcasterSupport class.
On the client side Notification listener on a specific bean on the server must be registered via addNotificationListener. And that addNotificationListener defines the action when notification comes. And notification listener must implement NotificationListener interface.
And that seems to be all, right?Hi Nikolay,
If you're running on Sun's Tiger JVM you can enable the JMX logging traces:
- start your application with -Djava.util.logging.config.file=<logging.properties>
- use the logging.properties given below:
------------------------------------------logging.properties------------------------------------
handlers= java.util.logging.ConsoleHandler
.level=INFO
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
// Use FINER or FINEST for javax.management.remote.level - FINEST is
// very verbose...
javax.management.level=FINEST
javax.management.remote.level=FINER
------------------------------------------logging.properties------------------------------------
Alternatively you may also try to switch on the traces dynamically - see my
blog on the subject:
http://blogs.sun.com/roller/page/jmxetc?entry=tracing_jmx_what_s_going
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/roller/page/jmxetc
There is
getNotificationInfo Successful
The operation [getNotificationInfo] was successfully
invoked for the MBean [bean:name=test].
The operation returned with the value:
[Ljavax.management.modelmbean.ModelMBeanNotificationIn
fo;@1b9d4d8
in http://127.0.0.1:9292/ and
getNotificationInfo button in jconsole doesn't print
any error. But there is
21-Feb-2006 17:39:11 RequiredModelMBean
getAttributes(String[])
SEVERE: Failed to get "NewNumber":
javax.management.AttributeNotFoundException:
getAttribute failed: NewNumber is not readable
21-Feb-2006 17:39:11 RequiredModelMBean
getAttributes(String[])
SEVERE: Failed to get "NotificationInfo":
javax.management.MBeanException: An exception occured
while trying to get an attribute value through a
RequiredModelMBean
when making some operation on the bean in jconsole.
Where should I check?
Tried to extend NotificationBroadcasterSupport class
instead of NotificationBroadcaster interface
implementation (like is many examples in web), but
that gave absolutely no affect....
In general everything must be easy.
The steps seem to be such:
Server must be started, beans must be exported to
to the server.
The beans that must be listened should implement
nt NotificationBroadcaster interface or extend
NotificationBroadcasterSupport class.
On the client side Notification listener on a
a specific bean on the server must be registered via
addNotificationListener. And that
addNotificationListener defines the action when
notification comes. And notification listener must
implement NotificationListener interface.
And that seems to be all, right? -
HI,
I am running an application "A" which is a Client (or an Agent) registered to the notification service fo JMX and monitoring an attribute "DocumentCount.".
The MBean which emits the NOtification is the ABCMBean.
The notification is sent in a method which is listed under the MBean interface
If this method is called by the client(or the agent) then notification is received successfully.
I have another application [b]"B" which is modifying this attribute by calling this same method, but is not registered to the MBean server.
So i have a process which is local to the MBean Interface which is modifying this attribute.
But in this case application A is not receiving any notification.
My assumption goes this way......
-->The notification is emitted only when the method is called by the client (or the agent defined above)
---->any other method local or remote which is calling the same method and broadcasting the same notification is not cached by the client which is registered and listening to the notification
Is this argument true??
If not what could be the possible reasons for that??Hi,
As I understood your question, you want to know that if an monitored resource is modified by anyway other than via mbeanserver's invoke, registered listener will receive notification or not.
So as per my experience with JMX if manage resource is modified by any means, you (all the listener) will receive the notification. Since this notification is synchronous you have to check if any other listener is blocking the thread,if that is the case other listener's will not be intimated until & unless thread returns after notifying previous listener....
Hope this helps..
cheers -
I'm looking for a tool that can pull data from an RMI JMX connection and use it for generating alerts and storing historical JMX attributes. I've seen many solutions that want to "push" the data via a Java agent to their monitoring servers but I haven't seen many that try to pull data.
Any ideas of some good products out there?Hi,
The short answer is yes to all your questions.
The longer answer is that you should be careful when using custom types
in your MBeans, because 1) you will need to make them serializable, and
take care of compatibility issues when they evolve, and 2) you will need to
make the jar that contain them available on the manager side.
To overcome this, JMX defines the notion of Open MBeans and OpenTypes, that
is, generic data-types (CompositeData and TabularData) that can be used to
model custom types.
In JDK 6, we're also introducing the notion of MXBean (see the excellent article
on http://java.sun.com/developer/technicalArticles/J2SE/mxbeans/ ).
MXBeans are just like MBeans, except that the MBeanServer will automatically
transform your custom types into OpenTypes (not all custom types can be
automatically converted - but a great many of them).
In JDK 6 build 98 you will find a new advanced JMX example that demonstrate
configuration MXBeans using XML serializable beans as MBean attributes.
Concerning Notifications, the same concerns applies. We usually recommend
not to create any custom subclass of notification, but use one of the standard
base classes instead. A JMX notification has a user data field in which you
could embed an instance of a generic Open Type (CompositeData/TabularData)
if needed.
The new advanced JMX example also show how you can 'reuse' the base
notification classes.
See:
http://blogs.sun.com/jmxetc/entry/looking_for_jmx_overview_examples
for JMX tutorial, examples, etc...
and
http://blogs.sun.com/jmxetc/entry/an_advanced_jmx_example_for
for instruction on the new JDK 6 JMX example.
I hope this will get you started on JMX!
-- daniel
JMX, SNMP, Java, etc
http://blogs.sun.com/jmxetc -
The bean name is:
com.bea:ServerRuntime=WLS1_COMMON_MS1,
Name=DiagnosticsJMXNotificationSource,
Type=WLDFWatchJMXNotificationRuntime,WLDFRuntime=WLDFRuntime,WLDFWatchNotificationRuntime=WatchNotification
When I run jconsole I can see that this bean is not created early on in the clustered environment during restart and I get this exception:
SEVERE: javax.management.InstanceNotFoundException: com.bea:ServerRuntime=WLS1_COMMON_MS1,Name=DiagnosticsJMXNotificationSource,Type=WLDFWatchJMXNotificationRuntime,WLDFRuntime=WLDFRuntime,WLDFWatchNotificationRuntime=WatchNotification
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.addNotificationListener(DefaultMBeanServerInterceptor.java:1190)
at com.sun.jmx.mbeanserver.JmxMBeanServer.addNotificationListener(JmxMBeanServer.java:801)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$19.run(WLSMBeanServerInterceptorBase.java:511)
Here are the different tests I've done:
1. local windows machine, admin server, serverlet listener context initiazed - always works - I can see the bean and hook up a listener
2. linux cluster, app cycle listener - always works
3. linux cluster, serverlet listener context initiazed, mostly fails - can't find the com.bea... bean
For case #3 we have an older war project that will eventually be updated to an ear but for now I don't want to
do that because I will end up having to update around 10 of the war projects at the same time. I want to use
the servlet context initialized for now, if it's possible.
So, for some reason the servlet listener on linux runs early and I can't get the JMX notifications to work. I tried
adding a thread sleep but that seems to just block the bean creation and still I see the failure. So, how can I get
this to work?
thanks,
Paul.I converted the war project to an ear project and I'm still seeing the same problem - the bea.com beans don't show. I added some simple test code in postStart:
for ( String domain : beanServer.getDomains() )
logger.info( "domain: " + domain );
on my local machine I see:
INFO: domain: Security
INFO: domain: com.sun.management
INFO: domain: JMImplementation
INFO: domain: com.oracle.jdbc
INFO: domain: com.bea
and on the cluster w/ many managed servers I see:
INFO: domain: JMImplementation
INFO: domain: oracle.jrockit.management
INFO: domain: com.sun.management
INFO: domain: com.oracle.jrockit
INFO: domain: com.oracle.jdbc
INFO: domain: java.lang
INFO: domain: java.util.logging
So, the bea.com domain is missing? Is there some way to get this domain to be available?
thanks,
Paul. -
Writing a jmx monitor for a message driven bean
I've been reading about using jmx to monitor some jms resources I have deployed to my
WL server. This monitor would monitor "some" MBean to watch for some Stuck Threads which
cause a disconnect to the jms queue to which I listen.
The problem is I'm not sure which, I'm not exactly sure which MBean I need to monitor. My
JMS Listener is an MDB which listens to a queue on a remote weblogic server. What happens is
something on the remote end causes a connection reset. About 10 mins later, I get a stack trace
dump and after that happens I'm no longer able to pull messages off my jms queue. I see logged
events where it says I'm successfully reconnected to my queue, but no amount of wishing will
let the MDB pull a message off the queue.
When the monitor detects a Stuck Thread, I'd like to force an application restart/redeployment, whichever
will accomplish a reconnection to the queue to which I'm listening. The other day, I went in through
the console, did a Lock/Edit and simply updated the already deployed application. Monitoring the log
file, I saw the mdb successfully reastablish connection to my remote end.
However, with 600+ MBeans, I'm kinda stuck on where I should start! Since I see the
stack trace in the AdminServer.log file, I'm thinking I should monitor some LoggingMBean.
But, it is JMS related, so there exists some confusion on my part.
If anyone with JMX experience could point me in the right direction, I'd appreciate
it. I'm just learning jmx, so pls be patient.
Thanks,
JohnYou have a couple of options here. You could monitor the WorkManagerRuntimeMBean's StuckThreadCount using a JMX Counter monitor, and trigger the action when that goes above 0.
You could also use WLDF to configure a Log watch to look for the Stuck thread log message, or use a Collected Metrics watch on the WM attribute, and assign it a JMX Notification. You could then write a JMX Notification listener to capture this event and perform the necessary corrective actions. -
Using JMX to get rollback statistics
Has anyone used MBean monitoring to get WebLogic transaction rollback statistics? Is there any example code for this out there?
thanks,
Jake VogelaarHello Adam,
Adam Lunger wrote:
I have registered a notification listener with a JMSDestinationRuntimeMBean, but I don't get any notifications.
What notifications are sent from the JMSDestinationRuntimeMBean? All kinds of JMX Notifications like AttributeChangeNotifications.
>
Specifically I want to receive notifications when the MesssagesCurrentCount changes. Can I use JMX to get these notifications? Any help is appreciated.Yes, you can use JMX to get notifications when this attribute changes.
Check out
http://e-docs.bea.com/wls/docs81/jmx/notifications.html#1118345
Thanks,
-satya -
Why josso has no DataSource Credential Store?
Hello everyone,
Do you take care of studying the josso-gateway-config.xml and find the Credential Stroe block is lacking of a way to store the username/passport pairs by DataSource?
this is the josso-gateway-config.xml listed as below:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
~ Copyright (c) 2004-2006, Novascope S.A. and the JOSSO team
~ All rights reserved.
~ Redistribution and use in source and binary forms, with or
~ without modification, are permitted provided that the following
~ conditions are met:
~
~ * Redistributions of source code must retain the above copyright
~ notice, this list of conditions and the following disclaimer.
~
~ * Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in
~ the documentation and/or other materials provided with the
~ distribution.
~
~ * Neither the name of the JOSSO team nor the names of its
~ contributors may be used to endorse or promote products derived
~ from this software without specific prior written permission.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
~ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
~ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
~ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
~ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
~ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
~ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
~ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
~ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
~ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
~ POSSIBILITY OF SUCH DAMAGE.
-->
<domain>
<name>JOSSO</name>
<type>web</type>
<!--sso-web-config-->
<!-- Optional : The URL where the user will be redirected after a successfull login only if josso_back_to request parameter
is not present when accessing the login url
<loginBackToURL>http://localhost:8080/partnerapp/protected/</loginBackToURL>
-->
<!-- Optional : The URL where the user will be redirected after a logout only if josso_back_to is not present
when accessing the logout url
<logoutBackToURL>http://localhost:8080/partnerapp/protected/</logoutBackToURL>
-->
<!-- Session token properties -->
<!--session-token-->
<!-- Optional : Use a secure session token, a secure channel like SSL must be available for this to work
<secure>false</secure>
-->
<!--/session-token-->
<!--/sso-web-config-->
<authenticator>
<class>org.josso.auth.AuthenticatorImpl</class>
<authentication-schemes>
<!-- Basic Authentication Scheme -->
<authentication-scheme>
<name>basic-authentication</name>
<class>org.josso.auth.scheme.UsernamePasswordAuthScheme</class>
<!--
The message digest algorithm to be used when hashing passwords.
This must be an algorithm supported by the java.security.MessageDigest class
on your platform.
In J2SE 1.4.2 you can check :
Java Cryptography Architecture API Specification & Reference - Apendix B : Algorithms
Values are : MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512,etc.
To provide LDAP support, also CRYPT is available.
-->
<hashAlgorithm>MD5</hashAlgorithm>
<!-- Supported values are HEX, BASE64. Mandatory if hashAlgorithm was specified -->
<hashEncoding>HEX</hashEncoding>
<!-- Some hash algorithms, like CRYPT, use this property. The default value is 2.
<saltLength>2</saltLength>
-->
<ignorePasswordCase>false</ignorePasswordCase>
<ignoreUserCase>false</ignoreUserCase>
<!-- ========================================================= -->
<!-- JDBC Credential Store -->
<!-- -->
<!-- Always scape comma chars [,] in queries because -->
<!-- jakarta commons-configuration uses them to define arrays. -->
<!-- ========================================================= -->
<!--
<credential-store>
<class>org.josso.gateway.identity.service.store.db.JDBCIdentityStore</class>
<credentialsQueryString>
SELECT login AS username , password AS password FROM josso_user WHERE login = ?
</credentialsQueryString>
<connectionName>josso</connectionName>
<connectionPassword>josso</connectionPassword>
<connectionURL>jdbc:oracle:thin:@localhost:1521:josso_db</connectionURL>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
</credential-store>
<credential-store>
<class>org.josso.gateway.identity.service.store.db.DataSourceIdentityStore</class>
<credentialsQueryString>SELECT login AS username , password AS password FROM josso_user WHERE login = ?</credentialsQueryString>
<dsJndiName>java:jdbc/JossoSamplesDB</dsJndiName>
</credential-store>
-->
<!-- =============================================================== -->
<!-- LDAP Credential Store -->
<!-- -->
<!-- Chcek javadoc for configuration details : -->
<!-- org.josso.gateway.identity.service.store.ldap.LDAPIdentityStore -->
<!-- =============================================================== -->
<!--
<credential-store>
<class>org.josso.gateway.identity.service.store.ldap.LDAPIdentityStore</class>
<initialContextFactory>com.sun.jndi.ldap.LdapCtxFactory</initialContextFactory>
<providerUrl>ldap://ldaphost</providerUrl>
<securityPrincipal>cn=Manager,dc=my-domain,dc=com</securityPrincipal>
<securityCredential>secret</securityCredential>
<securityAuthentication>simple</securityAuthentication>
<ldapSearchScope>SUBTREE</ldapSearchScope>
<usersCtxDN>ou=People,dc=my-domain,dc=com</usersCtxDN>
<principalUidAttributeID>uid</principalUidAttributeID>
<rolesCtxDN>ou=Roles,dc=my-domain,dc=com</rolesCtxDN>
<uidAttributeID>uniquemember</uidAttributeID>
<roleAttributeID>cn</roleAttributeID>
<credentialQueryString>uid=username,userPassword=password</credentialQueryString>
<userPropertiesQueryString>mail=mail,cn=description</userPropertiesQueryString>
</credential-store>
-->
<!-- ================================================= -->
<!-- Memory Credential Store -->
<!-- ================================================= -->
<credential-store>
<class>org.josso.gateway.identity.service.store.MemoryIdentityStore</class>
<credentialsFileName>josso-credentials.xml</credentialsFileName>
</credential-store>
<!-- ================================================= -->
<!-- Credential Store Key adapter -->
<!-- ================================================= -->
<credential-store-key-adapter>
<class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
</credential-store-key-adapter>
</authentication-scheme>
<!-- Strong Authentication Scheme -->
<authentication-scheme>
<name>strong-authentication</name>
<class>org.josso.auth.scheme.X509CertificateAuthScheme</class>
<!-- ========================================================= -->
<!-- JDBC Credential Store -->
<!-- -->
<!-- Always scape comma chars [,] in queries because -->
<!-- jakarta commons-configuration uses them to define arrays. -->
<!-- ========================================================= -->
<!--
<credential-store>
<class>org.josso.gateway.identity.service.store.db.JDBCIdentityStore</class>
<credentialsQueryString>
SELECT login AS username , password AS password FROM josso_user WHERE login = ?
</credentialsQueryString>
<connectionName>josso</connectionName>
<connectionPassword>josso</connectionPassword>
<connectionURL>jdbc:oracle:thin:@localhost:1521:josso_db</connectionURL>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
</credential-store>
-->
<!-- =============================================================== -->
<!-- LDAP Credential Store -->
<!-- -->
<!-- Chcek javadoc for configuration details : -->
<!-- org.josso.gateway.identity.service.store.ldap.LDAPIdentityStore -->
<!-- =============================================================== -->
<!--
<credential-store>
<class>org.josso.gateway.identity.service.store.ldap.LDAPIdentityStore</class>
<initialContextFactory>com.sun.jndi.ldap.LdapCtxFactory</initialContextFactory>
<providerUrl>ldap://ldaphost</providerUrl>
<securityPrincipal>cn=Manager,dc=my-domain,dc=com</securityPrincipal>
<securityCredential>secret</securityCredential>
<securityAuthentication>simple</securityAuthentication>
<ldapSearchScope>SUBTREE</ldapSearchScope>
<usersCtxDN>ou=People,dc=my-domain,dc=com</usersCtxDN>
<principalUidAttributeID>uid</principalUidAttributeID>
<rolesCtxDN>ou=Roles,dc=my-domain,dc=com</rolesCtxDN>
<uidAttributeID>uniquemember</uidAttributeID>
<roleAttributeID>cn</roleAttributeID>
<credentialQueryString>uid=username,userCertificate;binary=userCertificate</credentialQueryString>
<userPropertiesQueryString>mail=mail,cn=description</userPropertiesQueryString>
</credential-store>
-->
<!-- ================================================= -->
<!-- Memory Credential Store -->
<!-- ================================================= -->
<credential-store>
<class>org.josso.gateway.identity.service.store.MemoryIdentityStore</class>
<credentialsFileName>josso-credentials.xml</credentialsFileName>
</credential-store>
<!-- ================================================= -->
<!-- Credential Store Key adapter -->
<!-- ================================================= -->
<credential-store-key-adapter>
<class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
</credential-store-key-adapter>
</authentication-scheme>
</authentication-schemes>
</authenticator>
<sso-identity-manager>
<class>org.josso.gateway.identity.service.SSOIdentityManagerImpl</class>
<!-- ========================================================= -->
<!-- DataSource Identity Store -->
<!-- -->
<!-- Always scape comma chars [,] in queries because -->
<!-- jakarta commons-configuration uses them to define arrays. -->
<!-- ========================================================= -->
<!--
<sso-identity-store>
<class>org.josso.gateway.identity.service.store.db.DataSourceIdentityStore</class>
<userQueryString>
SELECT login FROM josso_user WHERE login = ?
</userQueryString>
<userPropertiesQueryString>
SELECT 'user.description' AS name , description AS value FROM josso_user WHERE login = ?
UNION
SELECT name AS name , value AS value FROM josso_user_property WHERE login = ?
</userPropertiesQueryString>
<rolesQueryString>
SELECT josso_role.name FROM josso_role , josso_user_role , josso_user WHERE josso_user.login = ? AND josso_user.login = josso_user_role.login AND josso_role.name = josso_user_role.name
</rolesQueryString>
<dsJndiName>java:jdbc/JossoSamplesDB</dsJndiName>
</sso-identity-store>
-->
<!-- ========================================================= -->
<!-- JDBC Identity Store -->
<!-- -->
<!-- Always scape comma chars [,] in queries because -->
<!-- jakarta commons-configuration uses them to define arrays. -->
<!-- ========================================================= -->
<!--sso-identity-store>
<class>org.josso.gateway.identity.service.store.db.JDBCIdentityStore</class>
<userQueryString>
SELECT login FROM josso_user WHERE login = ?
</userQueryString>
You could use a UNION to select properties from different tables/columns :
SELECT 'user.lastName' AS name , lastName AS value FROM josso_user WHERE login = ?
UNION
SELECT 'user.name' AS name , name AS value FROM josso_user WHERE login = ?
UNION
SELECT name AS name , value AS value FROM josso_user_properties WHERE login = ?
<userPropertiesQueryString>
SELECT 'user.description' AS name , description AS value FROM josso_user WHERE login = ?
UNION
SELECT name AS name , value AS value FROM josso_user_property WHERE login = ?
</userPropertiesQueryString>
<rolesQueryString>
SELECT josso_role.name FROM josso_role , josso_user_role , josso_user WHERE josso_user.login = ? AND josso_user.login = josso_user_role.login AND josso_role.name = josso_user_role.name
</rolesQueryString>
<connectionName>josso</connectionName>
<connectionPassword>josso</connectionPassword>
<connectionURL>jdbc:oracle:thin:@localhost:1521:josso_db</connectionURL>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
</sso-identity-store-->
<!-- =============================================================== -->
<!-- LDAP Identity Store -->
<!-- -->
<!-- Chcek javadoc for configuration details : -->
<!-- org.josso.gateway.identity.service.store.ldap.LDAPIdentityStore -->
<!-- ================================================= -->
<!--
<sso-identity-store>
<class>org.josso.gateway.identity.service.store.ldap.LDAPIdentityStore</class>
<initialContextFactory>com.sun.jndi.ldap.LdapCtxFactory</initialContextFactory>
<providerUrl>ldap://ldaphost</providerUrl>
<securityPrincipal>cn=Manager,dc=my-domain,dc=com</securityPrincipal>
<securityCredential>secret</securityCredential>
<securityAuthentication>simple</securityAuthentication>
<ldapSearchScope>SUBTREE</ldapSearchScope>
<usersCtxDN>ou=People,dc=my-domain,dc=com</usersCtxDN>
<principalUidAttributeID>uid</principalUidAttributeID>
<rolesCtxDN>ou=Roles,dc=my-domain,dc=com</rolesCtxDN>
<uidAttributeID>uniquemember</uidAttributeID>
<roleAttributeID>cn</roleAttributeID>
<credentialQueryString>uid=username,userPassword=password</credentialQueryString>
<userPropertiesQueryString>mail=mail,cn=description</userPropertiesQueryString>
</sso-identity-store>
-->
<!-- ================================================= -->
<!-- Memory Identity Store -->
<!-- ================================================= -->
<sso-identity-store>
<class>org.josso.gateway.identity.service.store.MemoryIdentityStore</class>
<usersFileName>josso-users.xml</usersFileName>
</sso-identity-store>
<!-- ================================================= -->
<!-- Identity Store Key adapter -->
<!-- ================================================= -->
<sso-identity-store-key-adapter>
<class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
</sso-identity-store-key-adapter>
</sso-identity-manager>
<sso-session-manager>
<class>org.josso.gateway.session.service.SSOSessionManagerImpl</class>
<!--
Set the maximum time interval, in minutes, between client requests before the SSO Service will invalidate
the session. A negative time indicates that the session should never time out.
-->
<maxInactiveInterval>30</maxInactiveInterval>
<!-- Max number of sessions per user, default 1
A negative value indicates that an unlimited number of sessions per user is allowed.
-->
<maxSessionsPerUser>-1</maxSessionsPerUser>
<!--
If true, when the max number of sessions per user is exceeded,
an already existing session will be invalidated to create a new one.
If false, when the max number of sessions per user is exceeded,
an exception is thrown and the new session is not created.
-->
<invalidateExceedingSessions>false</invalidateExceedingSessions>
<!--
Time interval, in milliseconds, between exired sessions cleanup.
-->
<sessionMonitorInterval>10000</sessionMonitorInterval>
<!-- =================================================================== -->
<!-- Serialized Session Store -->
<!-- -->
<!-- Session Store implementation which uses Java Serialization to -->
<!-- persist Single Sign-On user sessions. -->
<!-- It allows to reconstruct the session state after a system shutdown. -->
<!-- =================================================================== -->
<!--
<sso-session-store>
<class>org.josso.gateway.session.service.store.SerializedSessionStore</class>
file where serialized sessions will be stored (optional)
<serializedFile>/tmp/josso_sessions.ser</serializedFile>
</sso-session-store>
-->
<!-- =============================================================== -->
<!-- DataSource Session Store -->
<!-- -->
<!-- This store persists SSO sessions in a RDBMS, it's usefull for -->
<!-- example when multiple SSO servers must share session information-->
<!-- like in a cluster. -->
<!-- -->
<!-- NOTE :Remember to escape spetial chars like < with < , etc -->
<!-- -->
<!-- -->
<!-- Chcek javadoc for configuration details : -->
<!-- org.josso.gateway.session.service.store.db.DataSourceSessionStore -->
<!-- =============================================================== -->
<!--
<sso-session-store>
<class>org.josso.gateway.session.service.store.db.DataSourceSessionStore</class>
<dsJndiName>java:jdbc/JossoSamplesDB</dsJndiName>
<sizeQuery>SELECT COUNT(*) FROM JOSSO_SESSION</sizeQuery>
<keysQuery>SELECT session_id FROM JOSSO_SESSION</keysQuery>
<loadAllQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION</loadAllQuery>
<loadQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE session_id = ?</loadQuery>
<loadByUserNameQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE username = ?</loadByUserNameQuery>
<loadByLastAccessTimeQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE last_access_time < ?</loadByLastAccessTimeQuery>
<loadByValidQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE valid = ?</loadByValidQuery>
<deleteDml>DELETE FROM JOSSO_SESSION WHERE session_id = ?</deleteDml>
<deleteAllDml>DELETE FROM JOSSO_SESSION</deleteAllDml>
<insertDml>INSERT INTO JOSSO_SESSION (session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid) VALUES (?, ?, ?, ?, ?, ?, ?) </insertDml>
<dsJndiName>java:jdbc/JossoSamplesDB</dsJndiName>
</sso-session-store>
-->
<!-- =============================================================== -->
<!-- Jdbc Session Store -->
<!-- -->
<!-- This store persists SSO sessions in a RDBMS, it's usefull for -->
<!-- example when multiple SSO servers must share session information-->
<!-- like in a cluster. -->
<!-- -->
<!-- NOTE :Remember to escape spetial chars like < with < , etc -->
<!-- -->
<!-- Chcek javadoc for configuration details : -->
<!-- org.josso.gateway.session.service.store.db.JdbcSessionStore -->
<!-- =============================================================== -->
<!--
<sso-session-store>
<class>org.josso.gateway.session.service.store.db.JdbcSessionStore</class>
<connectionName>josso</connectionName>
<connectionPassword>josso</connectionPassword>
<connectionURL>jdbc:oracle:thin:@localhost:1521:josso_db</connectionURL>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
<sizeQuery>SELECT COUNT(*) FROM JOSSO_SESSION</sizeQuery>
<keysQuery>SELECT session_id FROM JOSSO_SESSION</keysQuery>
<loadAllQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION</loadAllQuery>
<loadQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE session_id = ?</loadQuery>
<loadByUserNameQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE username = ?</loadByUserNameQuery>
<loadByLastAccessTimeQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE last_access_time < ?</loadByLastAccessTimeQuery>
<loadByValidQuery>SELECT session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid FROM JOSSO_SESSION WHERE valid = ?</loadByValidQuery>
<deleteDml>DELETE FROM JOSSO_SESSION WHERE session_id = ?</deleteDml>
<deleteAllDml>DELETE FROM JOSSO_SESSION</deleteAllDml>
<insertDml>INSERT INTO JOSSO_SESSION (session_id, userName, creation_time, last_access_time, access_count, max_inactive_interval, valid) VALUES (?, ?, ?, ?, ?, ?, ?) </insertDml>
</sso-session-store>
-->
<!-- =============================================================== -->
<!-- Memory Session Store -->
<!-- =============================================================== -->
<sso-session-store>
<class>org.josso.gateway.session.service.store.MemorySessionStore</class>
</sso-session-store>
<sso-session-id-generator>
<class>org.josso.gateway.session.service.SessionIdGeneratorImpl</class>
<!--
The message digest algorithm to be used when generating session
identifiers. This must be an algorithm supported by the
java.security.MessageDigest class on your platform.
In J2SE 1.4.2 you can check :
Java Cryptography Architecture API Specification & Reference - Apendix A : Standard Names
Values are : MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512
-->
<algorithm>MD5</algorithm>
</sso-session-id-generator>
</sso-session-manager>
<!-- SSO Audit Manager compoment -->
<sso-audit-manager>
<class>org.josso.gateway.audit.service.SSOAuditManagerImpl</class>
<!--
List of handlers that will process this request
Every handler must have its own unique name.
-->
<handlers>
<!-- This handler logs all audit trails using Log4J, under the given category -->
<handler>
<class>org.josso.gateway.audit.service.handler.LoggerAuditTrailHandler</class>
<name>LoggerAuditTrailHandler</name>
<category>org.josso.gateway.audit.SSO_AUDIT</category>
</handler>
<!--
<handler>
<class>MyOtherHandler</class>
<name>MyOhterHandlerName</name>
<myProperty>value</myProperty>
</handler>
-->
</handlers>
</sso-audit-manager>
<!-- SSO Event Manager component -->
<sso-event-manager>
<class>org.josso.gateway.event.security.JMXSSOEventManagerImpl</class>
<!--
JMX Name of the EventManager MBean that will send SSO Events as JMX Notifications
The MBean will be registered by the MBeanComponentKeeper.
-->
<oname>josso:type=SSOEventManager</oname>
<!-- You can add your own listeners here : -->
<!-- Every listener should have a unique name -->
<!--
<listeners>
<listener>
<class>com.myCompany.MyEventListener</class>
<name>MyEventListener</name>
<property1>MyListenerProperty1Value</property1>
</listener>
<listener>
<class>com.myCompany.MyOtherEventListener</class>
<name>MyOtherEventListener</name>
<propertyA>MyOtherListenerPropertyAValue</propertyA>
</listener>
</listeners>
-->
</sso-event-manager>
</domain>
Is it means there is only way in Josso to save the username/passport by use of JDBC?
If you find the datasource can be used, plz tell me how?oH, sorry , I found it !
there is no problem here! -
Hi,
I want to know if I set a system property "-Dweblogic.ThreadPoolSize", how will the
WLS get to know that the pool size has been changed, at run time?
E.g. I pass -Dweblogic.ThreadPoolSize=30 from the command-line. Then if I change
the pool size to 40 at runtime by setting system property by calling System.setProperty(String,
String);, is there any event that I can fire for the change in property through APIs?
Thnx in advance.
Best Regards
AliMonitoring system properties for change can be done with JMX I think.
But for ThreadPoolSize in WLS 6.0, I don't think there is a documented JMX
MBean. (Maybe it exists but it's undocumented.)
In 6.1, 7.0, there's the concept of ExecuteQueue.
http://e-docs.bea.com/wls/docs70/javadocs/weblogic/management/configuration/
ExecuteQueueMBean.html
You can monitor a change by using the notification mechanism:
http://e-docs.bea.com/wls/docs70/jmx/notifications.html
Good luck,
Emmanuel
"Ali" <[email protected]> wrote in message
news:3d0d27a4$[email protected]..
>
Hi,
I want to know if I set a system property "-Dweblogic.ThreadPoolSize", howwill the
WLS get to know that the pool size has been changed, at run time?
E.g. I pass -Dweblogic.ThreadPoolSize=30 from the command-line. Then if Ichange
the pool size to 40 at runtime by setting system property by callingSystem.setProperty(String,
String);, is there any event that I can fire for the change in propertythrough APIs?
>
Thnx in advance.
Best Regards
Ali -
Hi all,
in my Pub/Sub scenario, the subscribers should send a reply to the publisher through a temporary Topic. The publisher should receive all replies and treat all of them. It's no problem for me to gather the multiple replies (I have written my own Requestor that waits some seconds and during that time gathers the replies). However, this solution is improvable. There is a great chance that the waiting time is too short and the publisher misses some replies that could be very relevant. It would be great if the publisher could find out how many subscribers are currently subscribed and so find out for how many replies it should wait for. Has anyone an idea how to do that?
TIA, ChristianThis is not defined as part of the specification. Some vendors offer RuntimeMBeans that allow you to get the information. However, without tighter coupling to JMS there would be races. Even registering for JMX notifications would not be enough to close the race. JMS would need to return the number of matched consumers.
And in some cases the number would not be available. For instance, you send in a transaction. The message doesn't exist until you commit. So the vendor doesn't generally do any matching until commit time. By that time the send has long since completed. How would the count be returned to you. -
Want to print some string on jconsole
Hi,
I have some requirement in that I have to print some string value on jconsole, I dont know it is possible or not.
if possible please suggest me some way.
Thanks
CandraJConsole will show any registered MBeans that you have, so you can create an MBean with a String attribute and a "get" operation that returns a String. That String will then be readily displayed in JConsole under the MBeans tab. You can even expose objects more complex than a String as Strings in JConsole as long as those objects are Serializable, have an appropriate toString() method, and the class is included on JConsole's classpath. The blog entry at [http://marxsoftware.blogspot.com/2008/02/publishing-user-objects-in-jmx.html|http://marxsoftware.blogspot.com/2008/02/publishing-user-objects-in-jmx.html] talks about some of these issues. While it covers a custom object used with a JMX Notification, the idea is the same if you want to expose custom objects as Strings in JConsole. On the other hand, things are much simpler if your MBean that JConsole sees simply has an operation returning a String.
I am not sure if this answers your question. If it doesn't, you may want to add some clarification.
Dustin -
Mbean that listen for jms queue messages
Hi to all,
I must use a Jmx notification listener architecture to trap when a new message arrives (i must also handle the message content) in a weblogic jms queue.
Do you know which mbean could help me to observe the new ariving message?
In the javadocs i cant' find any useful mbean to do that..
ThanksHi to all,
I must use a Jmx notification listener architecture to trap when a new message arrives (i must also handle the message content) in a weblogic jms queue.
Do you know which mbean could help me to observe the new ariving message?
In the javadocs i cant' find any useful mbean to do that..
Thanks
Maybe you are looking for
-
Error when I push a button in an applet
hi, I created a class wich extends JApplet. I made several button objects and added actionlisteners to them. One button is supposed to create an object of the class Outcall. I wrote this Outcall class and put it into the directory. Now when I make an
-
I don't know what's wrong with my 3GS. It only shows the black screen with white apple. Home button and turning the phone off then on doesn't seem to do anything.
-
TOC, Index, Search content not loading in FireFox 3.0 +
Hi, I have created from RH 8 a merged Webhelp system (1 master, 2 children - based on Peter Grainge's posted procedure). It works fine from IE, and on my system, from FireFox 3.0 and up. The problem is, that when deployed at the customer's site, the
-
Multiple Exchange protocol accounts
Microsoft Exchange's protocol is being the standard protocol for email, contacts, calendar and task synchronization. Gmail, Hotmail, enterprise Exchange servers...all of then can work with this protocol. iPhone and Android phones can work with sever
-
Enabling iPod Touch to be a storage device - optimal 3rd party application
The ONLY disappointment I have had with my beloved iPod Touch 32 is that it is the ONLY iPod not recognised by Windows or Mac OS as a storage device!! In fact I only chose the 32GB version for that expected benefit - my dealer was shocked when I disc