Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with ejbc

Status
Not open for further replies.

nkmb

Programmer
May 10, 2006
33
US
Hi,

I am developing simple hello world ejb applition using
statelesssession bean.I wrote all the code for it,and compiled it and packed in a jar file.


for deployment i am weblogic.ejbc.......it is generating the
following error

<error>


ava weblogic.ejbc test.jar
Exception in thread "main" java.lang.SecurityException: Prohibited package name:
java.util.logging
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
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 weblogic.ejbc20.<init>(ejbc20.java:82)
at weblogic.ejbc.main(ejbc.java:29)
</error>

Anybody please help me,to get through this problem.

thanks,
nkmb
 
Have you defined any package called java.util.logging or a class inside it?

Cheers,
Dian
 
Hi,


No,i don't have any package java.util.logging


<code>
<highlight>Hello.java</highlight>
package examples;
public interface Hello extends javax.ejb.EJBObject
{

public String hello() throws

java.rmi.RemoteException;

}
<highlight>HelloHome.java</highlight>


package examples;
public interface HelloHome extends javax.ejb.EJBHome
{
Hello create() throws java.rmi.RemoteException,
javax.ejb.CreateException;
}

<highlight>HelloBean.java</highlight>

package examples;
import javax.ejb.SessionContext;

public class HelloBean implements javax.ejb.SessionBean
{

public void ejbCreate()
{
System.out.println("ejbCreate()");
}

public void ejbRemove()
{
System.out.println("ejbRemove()");
}

public void ejbActivate()
{
System.out.println("ejbActivate()");
}

public void ejbPassivate()
{
System.out.println("ejbPassivate()");
}

public void setSessionContext(SessionContext ctx)
{
System.out.println("setSessionContext()");
}


public String hello()
{
System.out.println("hello()");
return "Hello, World!";
}
}
</code>

please help me,to get through this problem.

thanks
bhavani
 
Hi,

Even after changing my classpath to bea tools.jar and rt.jar,still i am getting the same error.



Exception in thread "main" java.lang.SecurityException: Prohibited package name:
java.util.logging
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
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 weblogic.ejbc20.<init>(ejbc20.java:82)
at weblogic.ejbc.main(ejbc.java:29)
 
I'd check the JVM version running the server and then the classpath. I'd remove from classpath the conflicting entried, as they're supposed to be included by default.

Cheers,
Dian
 
Hi,

Now i am getting problem with Client.My client.java is compiling,by running the client,i am getting this error


Exception in thread "main" java.lang.UnsupportedClassVersionError: javax/securit
y/auth/callback/CallbackHandler (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
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.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:131)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at examples.HelloClient.main(HelloClient.java:25)

my HelloClient.java

<code>

package examples;

import javax.naming.*;
import javax.ejb.*;
import java.util.*;
import javax.rmi.*;
public class HelloClient {

public static void main(String[] args) throws Exception {
Hashtable h=null;
Context ctx=null;
try{


h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001/");
ctx = new InitialContext(h);
// UNDU.......
}catch(Exception e)
{
e.printStackTrace();
}
Object obj = ctx.lookup("HelloHome");
HelloHome home = (HelloHome)
javax.rmi.PortableRemoteObject.narrow( obj, HelloHome.class);

Hello hello = home.create();

System.out.println(hello.hello());
hello.remove();
}
}

</code>

somebody please reply me,i am stuck with this since two days.

thanks,
bhavani.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top