aspose file tools*
The moose likes BEA/Weblogic and the fly likes Security Exception in weblogic 8i with oracle 10g Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Security Exception in weblogic 8i with oracle 10g" Watch "Security Exception in weblogic 8i with oracle 10g" New topic
Author

Security Exception in weblogic 8i with oracle 10g

madhav changala
Ranch Hand

Joined: Dec 20, 2005
Posts: 57
Hello,

I have installed oracle10g and webloagic 8i in my system

i run the following program..

import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import java.util.*;
import java.sql.*;
import oracle.jdbc.pool.OracleDataSource;
import oracle.jdbc.*;

class DataSourceDemo
{
public static void main(String[] args)
{
Connection con;
Hashtable ht;
Context ctx;
DataSource ds;
try{
ht=new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
System.out.println("weblogic success 1");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
System.out.println("weblogic success 2");
ctx=new InitialContext(ht);
System.out.println("weblogic success 3");
ds=(DataSource)ctx.lookup("HASNA");
System.out.println("weblogic success 4");
con=ds.getConnection();
System.out.println("weblogic success 5");
Statement st=con.createStatement();
System.out.println("weblogic success 6");
ResultSet rs=st.executeQuery("select * from departments");
System.out.println("weblogic success 7");
while(rs.next())
{
System.out.println(rs.getInt(1)+" "+rs.getInt(2));}
con.close();
}
catch(Exception e){System.out.println(e);}



}
}

this is giving the following runtime error

java.lang.SecurityException: sealing viola
river: already loadedMicrosoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\madhav>f:

F:\>cd jdb*

F:\jdbcprgm>javac DataSourceDemo.java

F:\jdbcprgm>java DataSourceDemo
weblogic success 1
weblogic success 2
weblogic success 3
weblogic success 4
java.lang.SecurityException: sealing violation: can't seal package oracle.jdbc.d
river: already loaded
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at weblogic.rmi.utils.Utilities.getRemoteMethods(Utilities.java:278)
at weblogic.rmi.utils.Utilities.getRemoteRMIMethods(Utilities.java:258)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:105)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:80)
at weblogic.rmi.internal.StubClassFactory.generate(StubClassFactory.java
:17)
at weblogic.utils.classloaders.GenericClassLoader.findOrCreateSingleSour
ceClass(GenericClassLoader.java:653)
at weblogic.rmi.internal.StubGenerator.getStubOnClient(StubGenerator.jav
a:782)
at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:7
58)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:8
03)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:7
90)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObject
Replacer.java:222)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:111)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:244)
at weblogic.jdbc.common.internal.RmiDataSource_811_WLStub.getConnection(
Unknown Source)
at DataSourceDemo.main(DataSourceDemo.java:27)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Failed to generate
class for weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolCo
nnection_oracle_jdbc_driver_OracleConnection_811_WLStub ] - with nested exceptio
n:
[java.lang.SecurityException: sealing violation: can't seal package oracle.jdbc.
driver: already loaded]
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:8
07)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:7
90)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObject
Replacer.java:222)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:111)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:244)
at weblogic.jdbc.common.internal.RmiDataSource_811_WLStub.getConnection(
Unknown Source)
at DataSourceDemo.main(DataSourceDemo.java:27)
Exception in thread "main" java.lang.SecurityException: sealing violation: can't
seal package oracle.jdbc.driver: already loaded
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at weblogic.rmi.utils.Utilities.getRemoteMethods(Utilities.java:278)
at weblogic.rmi.utils.Utilities.getRemoteRMIMethods(Utilities.java:258)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:105)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:80)
at weblogic.rmi.internal.StubClassFactory.generate(StubClassFactory.java
:17)
at weblogic.utils.classloaders.GenericClassLoader.findOrCreateSingleSour
ceClass(GenericClassLoader.java:653)
at weblogic.rmi.internal.StubGenerator.getStubOnClient(StubGenerator.jav
a:782)
at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:7
58)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:8
03)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:7
90)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObject
Replacer.java:222)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:111)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:244)
at weblogic.jdbc.common.internal.RmiDataSource_811_WLStub.getConnection(
Unknown Source)
at DataSourceDemo.main(DataSourceDemo.java:27)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Failed to generate
class for weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolCo
nnection_oracle_jdbc_driver_OracleConnection_811_WLStub ] - with nested exceptio
n:
[java.lang.SecurityException: sealing violation: can't seal package oracle.jdbc.
driver: already loaded]
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:8
07)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:7
90)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObject
Replacer.java:222)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:111)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:244)
at weblogic.jdbc.common.internal.RmiDataSource_811_WLStub.getConnection(
Unknown Source)
at DataSourceDemo.main(DataSourceDemo.java:27)


Could you please find out why it is coming.



FYI: class path and path setting in my system are as below

classpath:.;E:\ORACLE10G\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;.;E:\ORACLE10G\app\oracle\product\10.2.0\server\jlib\orai18n.jar;.;C:\Program Files\Java\jdk1.5.0\lib;C:\bea\weblogic81\server\lib\weblogic.jar;.;C:\Program Files\jakarta-struts-1.1-lib\struts.jar;.;C:\Program Files\Java\j2re1.4.2_03\lib;.;C:\j2sdk1.4.2_03\lib;.;


path:E:\ORACLE10G\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Program Files\Java\jdk1.5.0\bin;.;C:\bea\weblogic81\server\lib\weblogic.jar;.;C:\Program Files\QuickTime\QTSystem;.;C:\Program Files\Java\j2re1.4.2_03\bin;.;C:\j2sdk1.4.2_03\bin;.;


could you please look into this

Thanks&Regards
Madhav


saivenumadhav
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security Exception in weblogic 8i with oracle 10g