Using JAAS with Weblogic 10.3
Hi all,
we're porting our application from oc4j r2 to weblogic 10.3 and the last piece of the puzzle seems to be jaas. There's a small problem in that we use our own security model, so we need jaas only to be able to use getCallerPrincipal() from an EJB. So we don't really want to perform authentication, only to save the principal.
We tried adding our own login module and callback handler and called weblogic.security.services.Authentication.login to get a subject and then weblogic.servlet.security.ServletAuthentication.runAs to save the user. From what I saw the server tries to use the embedded LDAP, so I started looking into security realms. It seems I need to create a dummy authentication provider? Is there an easier way for the dummy login?
Thanks
I'm not sure about Authentication Provider. I'll look into it. On the other hand I wrote 3 simple classes, one simple principal, one login module and one simple callback handler.
Even though I get no exception and finally I call loginContext.login(). But still getCallerPrincipal() from the ejb context returns weblogic's admin.
In my LoginModule's commit method, I have this:
public boolean commit() throws LoginException {
if (succeeded == false) {
return false;
} else {
// add a Principal (authenticated identity)
// to the Subject
// assume the user we authenticated is the SamplePrincipal
userPrincipal = new DummyPrincipal(username);
if (!subject.getPrincipals().contains(userPrincipal)) {
subject.getPrincipals().add(userPrincipal);
log.debug("Added principal " + username + " to the subject");
if (debug) {
log.debug("Login Module Principals:");
for (Iterator i = subject.getPrincipals().iterator(); i.hasNext();) {
log.debug("Principal: " + ((Principal)i.next()).getName());
// in any case, clean out state
username = null;
password = "";
password = null;
commitSucceeded = true;
return true;
}which is essentially taken from Sun's tutorial. It just seems that weblogic does not take into consideration the login I perform through jaas. Do I need to call runAs, doPrivilegedAction, each time an http request is made?
Similar Messages
-
Has anyone used JAAS with WebLogic?
Has anyone used JAAS with Weblogic? I was looking at their example, and I have a bunch of questions about it. Here goes:
Basically the problem is this: the plug-in LoginModule model of JAAS used in WebLogic (with EJB Servers) seems to allow clients to falsely authenticate.
Let me give you a little background on what brought me to this. You can find the WebLogic JAAS example (to which I refer below) in the pdf: http://e-docs.bea.com/wls/docs61/pdf/security.pdf . (I believe you want pages 64-74) WebLogic, I believe goes about this all wrong. They allow the client to use their own LoginModules, as well as CallBackHandlers. This is dangerous, as it allows them to get a reference (in the module) to the LoginContext's Subject and authenticate themselves (i.e. associate a Principal with the subject). As we know from JAAS, the way AccessController checks permissions is by looking at the Principal in the Subject and seeing if that Principal is granted the permission in the "policy" file (or by checking with the Policy class). What it does NOT do, is see if that Subject
has the right to hold that Principal. Rather, it assumes the Subject is authenticated.
So a user who is allowed to use their own Module (as WebLogic's example shows) could do something like:
//THEIR LOGIN MODULE (SOME CODE CUT-OUT FOR BREVITY)
public class BasicModule implements LoginModule
private NameCallback strName;
private PasswordCallback strPass;
private CallbackHandler myCB;
private Subject subj;
//INITIALIZE THIS MODULE
public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
try
//SET SUBJECT
subj = subject; //NOTE: THIS GIVES YOU REFERENCE
TO LOGIN CONTEXT'S SUBJECT
// AND ALLOWS YOU TO PASS
IT BACK TO THE LOGIN CONTEXT
//SET CALLBACKHANDLERS
strName = new NameCallback("Your Name: ");
strPass = new PasswordCallback("Password:", false);
Callback[] cb = { strName, strPass };
//HANDLE THE CALLBACKS
callbackHandler.handle(cb);
} catch (Exception e) { System.out.println(e); }
//LOG THE USER IN
public boolean login() throws LoginException
//TEST TO SEE IF SUBJECT HOLDS ANYTHING YET
System.out.println( "PRIOR TO AUTHENTICATION, SUBJECT HOLDS: " +
subj.getPrincipals().size() + " Principals");
//SUBJECT AUTHENTICATED - BECAUSE SUBJECT NOW HOLDS THE PRINCIPAL
MyPrincipal m = new MyPrincipal("Admin");
subj.getPrincipals().add(m);
return true;
public boolean commit() throws LoginException
return true;
}(Sorry for all that code)
I tested the above code, and it fully associates the Subject (and its principal) with the LoginContext. So my question is, where in the process (and code) can we put the LoginContext and Modules so that a client cannot
do this? With the above example, there is no Security. (a call to: myLoginContext.getSubject().doAs(...) will work)
I think the key here is to understand JAAS's plug-in security model to mean:
(Below are my words)
The point of JAAS is to allow an application to use different ways of authenticating without changing the application's code, but NOT to allow the user to authenticate however they want.
In WebLogic's example, they unfortunately seem to have used the latter understanding, i.e. "allow the user to authenticate however they want."
That, as I think I've shown, is not security. So how do we solve this? We need to put JAAS on the server side (with no direct JAAS client-side), and that includes the LoginModules as well as LoginContext. So for an EJB Server this means that the same internal permission
checking code can be used regardless of whether a client connects through
RMI/RMI-IIOP/JEREMIE (etc). It does NOT mean that the client gets to choose
how they authenticate (except by choosing YOUR set ways).
Before we even deal with a serialized subject, we need to see how JAAS can
even be used on the back-end of an RMI (RMI-IIOP/JEREMIE) application.
I think what needs to be done, is the client needs to have the stubs for our
LoginModule, LoginContext, CallBackHandler, CallBacks. Then they can put
their info into those, and everything is handled server-side. So they may
not even need to send a Subject across anyways (but they may want to as
well).
Please let me know if anyone sees this problem too, or if I am just completely
off track with this one. I think figuring out how to do JAAS as though
everything were local, and then putting RMI (or whatever) on top is the
first thing to tackle.Send this to:
newsgroups.bea.com / security-group. -
I would like to integrate JAAS with Weblogic 8
Hi,
I would like to integrate JAAS with Weblogic 8, but I noticed that BEA%u2019s documentation on JAAS doesn't make it clear whether Weblogic uses a non-standard way of invoking JAAS. Can I suggest someone at BEA post a clear example on how to integrate JAAS with weblogic 8.1?
Any help will be greatly appreciated.
Thanks,
AnaHi Ana,
I'm not understanding what you're trying to do:
a) write a fat client that uses JAAS to login to a WLS server?
If so, you should read the weblogic JAAS documentation for fat clients.
Basically, the fat client should use the JAAS login module supplied by
WLS that does a login to the server over the wire under the covers
(vs. writing your own login module). The server will use its
configured
atn providers to complete the login.
b) Write application code that runs inside WLS (e.g. a servlet) that uses
JAAS to log into another WLS server?
Similar to (a) above
c) Customize how a WLS server logs in users - ie. write a
login module that WLS will use whenever it needs to login
a user?
If so, you should read the weblogic documentation on how
to write security providers and start from the sample security
providers on the dev2dev center.
Basically, you need to write an authentication provider. Part
of writing an authentication provider is writing a login module.
-tm
"Ana" <[email protected]> wrote in message
news:40168bcf$[email protected]..
Hi,
I would like to integrate JAAS with Weblogic 8, but I noticed thatBEA%u2019s documentation on JAAS doesn't make it clear whether Weblogic uses
a non-standard way of invoking JAAS. Can I suggest someone at BEA post a
clear example on how to integrate JAAS with weblogic 8.1?
>
Any help will be greatly appreciated.
Thanks,
Ana -
How to use ADF with weblogic Portal 10.3.2
Hello All,
I want to use ADF with Weblogic Portal 10.3.2. Can anyone guide me ?
Thanks,
*(' ')sman*Hello,
To use ADF with WLP 10.3.2 you will need a WebCenter WSRP producer running the portlet, which you can then consume as a remote portlet in WLP. The documentation on how to do that is here:
http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14235/chap_webcenter_interop.htm#BABDBJBD
Kevin -
Using Flexlm with Weblogic 8.1
Hi all,
I am using Flexlm utility to get my license up for my web application on Weblogic 8.1 but its throwing the exception.
Is there any configuration issues in using Flexlm with Weblogic?
I will appreciate any help. Thanks.
The exact stack trace is
at com.macrovision.flexlm.lictext.PriKey.pubkeyVerify(PriKey.java:115)
at com.macrovision.flexlm.lictext.LicenseElement.doAuthenticate(LicenseElement.java:459)
at com.macrovision.flexlm.lictext.FeatureLine.authenticate(FeatureLine.java:85)
at com.macrovision.flexlm.lictext.LicenseCertificate.authenticateList(LicenseCertificate.java:206)
at com.macrovision.flexlm.lictext.LicenseCertificate.authenticate(LicenseCertificate.java:188)
at com.macrovision.flexlm.lictext.LicenseGroup.getCertificateData(LicenseGroup.java:198)
at com.macrovision.flexlm.lictext.LicenseGroup.<init>(LicenseGroup.java:106)
at com.macrovision.flexlm.licsource.LicenseFile.<init>(LicenseFile.java:78)
at com.macrovision.flexlm.LicenseSource.createLicenseSource(LicenseSource.java:128)
at com.macrovision.flexlm.License.<init>(License.java:216)
atthere is a thin driver problem when inserting a blob greater than 4k in oracle. this worked fo me:
// thing i want to store
Object myObject = new Object();
String SQL = "UPDATE mytableSET blobcolumn= ? "
+ "WHERE id= ? ";
String SQL2 ="SELECT blobcolumn FROM mytable "
+ "WHERE id= ? ";
try
// create an empty_lob
BLOB myBlob = BLOB.empty_lob();
statement = conn.prepareStatement(SQL);
statement.setBlob(1, myBlob);
statement.setBigDecimal(2, id);
// update with the empty_lob
result = statement.executeUpdate();
if(result == 1)
// get the blob back
statement = conn.prepareStatement(SQL2);
statement.setBigDecimal(1, id);
results = statement.executeQuery();
if(results.next())
// write the new value
myBlob = (BLOB)results.getBlob(1);
OutputStream w = myBlob.getBinaryOutputStream();
w.write(myObject);
w.flush();
} -
Hi,
I would like to know if anybody has used iFS with weblogic before. If so could you please share the information like how to make it work. I would like to know the classpath settings etc...
Any help will be greatly appreciated.while i don't work for Oracle, i would suggest this is not a supported configuration. ;)
having said that, it should be easy enough to accomplish. just make sure your classpath (better yet, your WAR or EAR file) includes the required runtime iFS jars (repos.jar, adk.jar, utils.jar and email.jar), and then use JDBC to get iFS service configuration information. (See my response to Satya in the "custom JSP in OC4J" thread.)
that should work just fine.
.rich -
Error while using TXDataSource with Weblogic 6.1 & Oracle 8.1.6
Hi,
I am using Weblogic 6.1 and Oracle 8.1.6.
I have configured JDBC XA Connection Pool with Oracle thin driver. These are my settings...
Connection Pool:
Name - myXAPool
URL - jdbc:oracle:thin:@myServer:1521:myDb
DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
TXDataSource:
Name - myXADS
JNDIName - myXADS
PoolName - myXAPool
I get the following error when I try to lookup the datasource. I am not sure where the problem is as I have configured Connection Pool and TXDataSource as mentioned in the documentation.
java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start() failed on resource 'myXAPool' Unexpected error during start for XAResource 'myXAPool': null
It would be really great if you can help me out.
Thanks in Advance,
Sudhir.Hi Sudhir,
If you do not know if upgrade or not, have a look here :
http://e-docs.bea.com/wls/docs61/notes/bugfixes2.html
Note that at the end of June SP3 will be released...
Sergi
"Sudhir Babu" <[email protected]> wrote:
>
Hi Sergi,
Thanks a lot for the class file, I figured out what the problem was. Actually
the
database version I was working with was 8.0.6.0. The Oracle driver doesn't
work with
this but the JDriver worked. This is the output of running CheckDriver..
DatabaseProductName : Oracle
DatabaseProductVersion : Oracle8 Enterprise Edition Release 8.0.6.0.0 -
Production
With the Partitioning and Objects options
PL/SQL Release 8.0.6.0.0 - Production
DriverName : Oracle JDBC driver
DriverVersion : 8.1.7.1.0
Then I tried on using the Oracle Driver on another instance which has the
version
8.1.7.1.0 and it worked. The JDriver and Oracle driver both work with this
database.
The output of CheckDriver for this Oracle instance is..
DatabaseProductName : Oracle
DatabaseProductVersion : Oracle8i Enterprise Edition Release 8.1.7.1.0 -
Production
With the Partitioning option
JServer Release 8.1.7.1.0 - Production
DriverName : Oracle JDBC driver
DriverVersion : 8.1.7.0.0
By the way I am working on WLS 6.1 SP1. What is the advantage of SP2 ? Should
I upgrade
Thanks once again,
Sudhir.
"Sergi Vaz" <[email protected]> wrote:
Hi Sudhir ,
JDriver works well, you can work with it.
Just for curiosity, can you run the class I attached using the "exact"classpath
of your WL instance (with Oracle drivers in front of weblogic.jar) ? What
is the
output ?
On which platform are you running your WLSP2 ?
Thanks
Sergi
"Sudhir Babu" <[email protected]> wrote:
Hi Sergi,
I just checked the things you mentioned. The connection pool starts correctly
without
any errors. I also made sure SELECT previlege was granted to DBA_PENDING_TRANSACTIONS.
I do have the JAVA_XA package installed and it has EXECUTE permission
to
PUBLIC.
I actually tried using the Weblogic JDriver (weblogic.jdbc.oci.xa.XADataSource)
and
it works perfect without any issue. The only consideration is that itis
a Type 2
Driver and needs to have the Oracle Client installed. But right now Ido
have it
installed on the same machine.
Do you know any known issues with Weblogic JDriver. Do you think it'sa
good idea
to go with it ?
Thanks,
Sudhir.
"Sergi Vaz" <[email protected]> wrote:
Hi Sudhir,
does your connection pool start correctly ?
Check the setup of your Oracle server too:
1) grant select on DBA_PENDING_TRANSACTIONS table to PUBLIC
2) package JAVA_XA installed (with grant execute to PUBLIC)
Sergi
"Sudhir Babu" <[email protected]> wrote:
Hi Sergi,
Thanks for the response. I downloaded the driver for 8.1.7 from Oraclesite
and put
it in classpath in front of weblogic.jar. I still get the same problem.
Is there
another location where we can download the Oracle driver with the bug
fixed
Regards, Sudhir.
"Sergi Vaz" <[email protected]> wrote:
Hi Sudhir,
I think you are using Oracle JDBC drivers 8.1.6.
They have a bug, they do not accept a foreign XID.
Use 8.1.7 or higher to solve this problem.
Sergi
Sudhir Babu <[email protected]> wrote:
Hi,
I am using Weblogic 6.1 and Oracle 8.1.6.
I have configured JDBC XA Connection Pool with Oracle thin driver.
These
are my settings...
Connection Pool:
Name - myXAPool
URL - jdbc:oracle:thin:@myServer:1521:myDb
DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
TXDataSource:
Name - myXADS
JNDIName - myXADS
PoolName - myXAPool
I get the following error when I try to lookup the datasource. I amnot
sure where the problem is as I have configured Connection Pool and
TXDataSource
as mentioned in the documentation.
java.sql.SQLException: XA error: XAER_RMERR : A resource manager errorhas
occured in the transaction branch start() failed on resource 'myXAPool'
Unexpected error during start for XAResource 'myXAPool': null
It would be really great if you can help me out.
Thanks in Advance,
Sudhir. -
Problem in Using Log4J with Weblogic 9.2
I am using Weblogic 9.2 and Log4j.
By using Admin console I set the Severity Level to WARNING and inside my java code is given below:
Logger logger = Log4jLoggingHelper.getLog4jServerLogger();
if (logger.isEnabledFor(Priority.DEBUG)){
logger.debug("DEBUG - Test Debug message");
logger.info("DEBUG - Test Info Message");
logger.warn("DEBUG - Test Warning Message");
logger.error("DEBUG - Test Error Message");
logger.fatal("DEBUG - Test Fatal Message");
Somehow the logger.isEnabledFor(Priority.DEBUG) returning 'TRUE' and the follwoing message is displayed.
<Nov 29, 2006 2:44:04 PM EST> <Warning> org.apache.log4j.Category> <000000> <DEBUG - Test Warning Message>
<Nov 29, 2006 2:44:04 PM EST> <Error> <org.apache.log4j.Category> <000000> <DEBUG - Test Error Message>
<Nov 29, 2006 2:44:04 PM EST> <Info> <org.apache.log4j.Category> <000000> <DEBUG - Test Fatal Message>
<b><i>NOTE - The logger.debug() and logger.info() methods are not invoked because of the severity level to 'WARNING' in the console.</i></b>
<b>I would like to know why the Somehow the logger.isEnabledFor(Priority.DEBUG) is having a value of 'TRUE'.</b>
I expected only the Somehow the logger.isEnabledFor(Priority.ERROR) will have the value of 'TRUE'.Did you get an answer to your question? I have the same problem with WebLogic 10.0.
-
Using p3p with Weblogic/CSS
I am trying to use p3p policy and compact privacy policy.
We have Weblogic as App server and a hardware CSS to maintain session on weblogic
clusters.
The browser on client end is accpeting cookie, but I dont see the actual cookie
being placed.
The cookie contains session info and is used by CSS to maintain sticky to the
same managed server.
Am sending cpmpact policy using Meta tag in my JSPs
ANyone had similiar problem.Hi.
Hmm, since WLS execute threads never die, I don't know that your threadlocal variables
will get cleaned up or gc'd until the server is shutdown.
Regards,
Michael
Kumar Ampani wrote:
> With weblogic thread pooling, When I use threadlocal variables in my application,
> how does it work as far as cleaning those variables after the request is completed.
>
> Thanks in advance.
Michael Young
Developer Relations Engineer
BEA Support
-
Using ThreadLocal with WebLogic App Server
With weblogic thread pooling, When I use threadlocal variables in my application,
how does it work as far as cleaning those variables after the request is completed.
Thanks in advance.
Hi.
Hmm, since WLS execute threads never die, I don't know that your threadlocal variables
will get cleaned up or gc'd until the server is shutdown.
Regards,
Michael
Kumar Ampani wrote:
> With weblogic thread pooling, When I use threadlocal variables in my application,
> how does it work as far as cleaning those variables after the request is completed.
>
> Thanks in advance.
Michael Young
Developer Relations Engineer
BEA Support
-
How to implement JAAS With Weblogic 10.3
I am working on a migration project. A project is to be migrated from JBOSS to Weblogic 10.3. JAAS has been used in JBOSS for security purpose.
Required classess like LoginModule, CallBackHandler are customized and put into a jar file. Next a Login page has been created with action=”j_security_check”, which is supposed to be called whenever protected resource has been requested. In web.xml Roles and Policies are defined. There is a jboss-web.xml in which roles are mentioned. In web.xml
There is a login-config.xml that has been put into Jboss server classpath. In this file, some sql queries are there.
In weblogic I am not able to understand that how to configure this login-config, how to map roles and policies. Exactly I am not able to find what are the steps needed to implement this JAAS in weblogic10.3. I also tried using the Read-Only SQL Authenticator Provider under security Realms but not sure how to use groups, because I have no Group related tables in my DB.
Kindly anyone share the knowledge.Hi,
I also want to do the same thing. Did you get any solution for this problem. If yes then please share it with me. I am struggling with this.
Thanks,
Sanjay -
Problems using JAAS with EJB 3.0 on JBoss 4.0.4-GA
Hello all,
I am trying to build a very simple JavaEE application with JAAS, but I getting mad.
I have an EAR packed with a WAR module an EJB JAR module and a JAR with other classes. Struts is the MVC framework and EJB 3.0 is been used.
First of all, I configured the "login-config.xml" file within /conf directory in JBoss, like this:
<application-policy name="exemplo1">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name="dsJndiName">java:jdbc/Infra_Seguranca</module-option>
<module-option name="principalsQuery">SELECT COD_USUARIO AS Password FROM USUARIO WHERE COD_USUARIO=?</module-option>
<module-option name="rolesQuery">SELECT NOME_ROLE AS Roles, 'Roles' AS RoleGroups FROM ROLE_USUARIO WHERE COD_USUARIO=?</module-option>
</login-module>
</authentication>
</application-policy>Next I configured the "web.xml" file like this:
<security-constraint>
<web-resource-collection>
<web-resource-name>Restricted</web-resource-name>
<description>Declarative security tests</description>
<url-pattern>*.do</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>xxx</role-name>
</auth-constraint>
<user-data-constraint>
<description>no description</description>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>exemplo1</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/loginErro.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>Role xxx</description>
<role-name>xxx</role-name>
</security-role>Notice that I am using the "xxx" role to protect the "*.do" URL pattern.
The "jboss-web.xml" is like this:
<?xml version="1.0"?>
<jboss-web>
<security-domain>java:/jaas/exemplo1</security-domain>
</jboss-web>As it is, it works perfectly, which means, every time I try to access a "*.do" URL it verifies whether I am authenticated and have authroization or not. If not, the login page shows up.
Now I wanna to be able to also protect my EJBs.
My Stateless Session Bean is implemented as follow:
@RolesAllowed("yyy")
@Stateless(name="UserManagement")
public class UserManagementBean implements UserManagement {
public void add(User user) {
}When I run all this, the container simply igoners the @RolesAllowed("yyy") annotation and allow the EJB execution.
If I add the "jboss.xml" file, like this:
<?xml version="1.0"?>
<jboss>
<security-domain>java:/jaas/exemplo1</security-domain>
</jboss>I start getting this stack trace:
ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
at org.jboss.security.auth.spi.Util.loadProperties(Util.java:313)
at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
... Am I missing something? What do I have to do to get JAAS working fine with my EJBs? Do I have to also configure and/or provide "ejb-jar.xml" ???
Thanks
DanielUsing @SecurityDomain("exemplo1") in my EJB and NOT providing jboss.xml, it works.
@SecurityDomain("exemplo1")
@RolesAllowed("yyy")
@Stateless(name="UserManagement")
public class UserManagementBean implements UserManagement {
public void add(User user) {
}Damn! This is some serious shit... I don�t want to configure this in every single EJB.
EJB 3.0 is nice, but some small trivial details like this and others, that was forgotten by Sun, piss me off! -
Using JNI with weblogic JSP & Servlets
I want to use native libraries from JSP and Servlets.
Everything works fine befire redeploying.
After redeploying there is an error:
Servlet failed with Exception
java.lang.UnsatisfiedLinkError: Native Library D:\WINNT\system32\XXXX.dll
already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1346)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
at java.lang.Runtime.loadLibrary0(Runtime.java:749)
at java.lang.System.loadLibrary(System.java:820)
at HelloWorld.<clinit>(HelloWorld.java:9)
at NativeTestServlet.doGet(NativeTestServlet.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
Can anybody solve it?
Best wishes, Oleg.
Java will not allow us to reload any class that is dependent on a native
library. I suggest that any classes that depend on native code should be
put in the system classpath. If you change these classes or the native
library you will need to restart your server.
Sam
"Jennifer Yin" <[email protected]> wrote in message
news:[email protected]...
> Oleg-
>
> I'm having the exact same problem and was wondering how you fixed it. I
ran
> javah -jni <classname> to verify the correct method call and have also
verified
> that the library file is included in the system path.
>
> Any other suggestions?
>
> Jennifer
>
> Oleg wrote:
>
> > I want to use native libraries from JSP and Servlets.
> > Everything works fine befire redeploying.
> > After redeploying there is an error:
> >
> > Servlet failed with Exception
> > java.lang.UnsatisfiedLinkError: Native Library
D:\WINNT\system32\XXXX.dll
> > already loaded in another classloader
> > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1346)
> > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
> > at java.lang.Runtime.loadLibrary0(Runtime.java:749)
> > at java.lang.System.loadLibrary(System.java:820)
> > at HelloWorld.<clinit>(HelloWorld.java:9)
> > at NativeTestServlet.doGet(NativeTestServlet.java:31)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> > :208)
> > at
> >
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
> > ntext.java:1127)
> > at
> >
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
> > :1529)
> > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> > >
> >
> > Can anybody solve it?
> >
> > Best wishes, Oleg.
>
-
Using Datasources with Weblogic 7.2
Hi everyone,
I am using Weblogic 7.2 with Db2 8.1 fp3(Type 4 Drivers). I am wanting
to set up a Datasource that would allow my application to connect to
DB2 using the JNDI lookup for that data-source.
My question is: what additions/changes I need to make to config.xml in
order to set this up.Looking at the Websphere Admin Doc, it seems to
me that I need to atleast add 2 elements to my domain in config.xml:
1. JDBCConnectionPool
2. JDBCDataSource(and link it to the above pool)
I have previously set-up datasources on WAS 5.0. What is confusing me
w.r.t Weblogic is that there seems to be no way to specify the
implementing class for the DataSource. e.g. WAS5.0 allows you to
specify the implementationClassName of the
datasource(com.ibm.db2.jcc.DB2ConnectionPoolDataSource in my case) while
defining the DataSource.JDBCConnectionPool element in Weblogic does
have an attribute called "DriverName" but per the documentation it
should be set to an implementor of java.sql.Driver interface: there
seems to be no way to set an implementor of javax.sql.DataSource
anywhere.
Could anyone please shed some light on how to set this up?
Thanks much in advance,
SachinMitesh,
Many thanks for the reply. If you don't mind, I have a couple of follow-up questions
for you.
1> Does this mechanism work with Type 4 Pure Java Drivers?
e.g. if I specified the connection pool as
<JDBCConnectionPool DriverName="com.ibm.db2.jcc.DB2ConnectionPoolDataSource" Name="IBM-db2"
Password="MYPASSWORD" Properties="user=USERNAME;DatabaseName=DATABASE" Targets="MYSERVER"
TestTableName="SQL SELECT COUNT(*) FROM SYSIBM.SYSTABLES" URL="jdbc:db2:DATABASE"/>
==> I changed the DriverName to "com.ibm.db2.jcc.DB2ConnectionPoolDataSource"
which
is what I believe is the Type-4 version
2> Setting the DriverName to a javax.sql.DataSource extension seems to suggest
that the documentation in the "BEA Server Configuration Reference" guide is incorrect:
-- For the DriverName attribute of the Connection Pool, the guide says that "DriverName
must be the name of a class that implements the java.sql.Driver interface"
Thanks again
Sachin
Mitesh Patel <[email protected]> wrote:
<JDBCConnectionPool DriverName="COM.IBM.db2.jdbc.DB2XADataSource"
Name="IBM-db2-xa"
Password="MYPASSWORD"
Properties="user=USERNAME;DatabaseName=DATABASE"
Targets="MYSERVER"
TestTableName="SQL SELECT COUNT(*) FROM SYSIBM.SYSTABLES"
URL="jdbc:db2:DATABASE"/>
<JDBCConnectionPool DriverName="COM.IBM.db2.jdbc.app.DB2Driver"
Name="IBM-db2"
Password="MYPASSWORD"
Properties="user=USERNAME;DatabaseName=DATABASE"
Targets="MYSERVER"
TestTableName="SQL SELECT COUNT(*) FROM SYSIBM.SYSTABLES"
URL="jdbc:db2:DATABASE"/>
Then setup your datasource using one of this connection pools in your
config.xml. Also, make sure your driver zip files are in the classpath.
Thanks,
Mitesh
Sachin Arora wrote:
Hi everyone,
I am using Weblogic 7.2 with Db2 8.1 fp3(Type 4 Drivers). I am wanting
to set up a Datasource that would allow my application to connect to
DB2 using the JNDI lookup for that data-source.
My question is: what additions/changes I need to make to config.xmlin
order to set this up.Looking at the Websphere Admin Doc, it seems to
me that I need to atleast add 2 elements to my domain in config.xml:
1. JDBCConnectionPool
2. JDBCDataSource(and link it to the above pool)
I have previously set-up datasources on WAS 5.0. What is confusingme
w.r.t Weblogic is that there seems to be no way to specify the
implementing class for the DataSource. e.g. WAS5.0 allows you to
specify the implementationClassName of the
datasource(com.ibm.db2.jcc.DB2ConnectionPoolDataSource in my case)while
defining the DataSource.JDBCConnectionPool element in Weblogic does
have an attribute called "DriverName" but per the documentation it
should be set to an implementor of java.sql.Driver interface: there
seems to be no way to set an implementor of javax.sql.DataSource
anywhere.
Could anyone please shed some light on how to set this up?
Thanks much in advance,
Sachin -
Does anyone use Python with WebLogic
We have a large group of Python developers. Currently they are using Apache for PSP. I can't find any good papers/documentation on PSP support in WebLogic. Can anyone suggest some ... or maybe we should stick with Apache.
Thanks for your help,
Bob Larsennot many here
try there
http://www.nforcershq.com/forum/viewforum.php?f=29
Maybe you are looking for
-
My ipod wont let me restore or update
I have gone to the website and got all the latest downloads but it still hasnt been able to restore. A message pops up saying "ipod updater 2004-04-28 can't install firmware on connected ipod's hardwater and the Updater firmware are not compatible" P
-
Error when filling the setup table
Hi, When i try to load the setup table,it is giving the error like "No Extract structure active or no bw Connected" .So can anyone suggest me to solve this problem. regards, meiy
-
How to create a text field box that saves and reveals content within PDF?
I cannot seem to find a way (at least within Indesign) to allow users to enter content, and then to later have that content revealed within the PDF at a later point. Example: User enters name: "Jon" PDF: "Welcome Jon!"
-
Updating firmware on used X1900 xt
I recently bought a used ATI Radeon X1900 XT to replace my "heat fried" OEM one. The card that I installed into my Mac Pro, running 10.6.8. shows a firmware of 113-A52027-140. I turns out the latest firmware should be 113-A52027-202. The card runs fi
-
Why does my lock screen glow green?
Why does my lock screen glow green? It does it quite often, no affects on the phone.