• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Jdeveloper - Stateless Session Bean + OC4J Exception - Urgent Please Help

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a stateless Session Bean EJBs deployed on the OC4J Application Server that calls this method:

public String getCurrentTime()
{
return ""+ new java.util.Date();
}

I try to access it from a client running on the same machine(windows nt).

DateEJBClient dateEJBClient = new DateEJBClient();
try
{
Context context = getInitialContext();
DateEJBHome dateEJBHome = (DateEJBHome)PortableRemoteObject.narrow(context.lookup("DateEJB"), DateEJBHome.class);
DateEJB dateEJB;

// Use one of the create() methods below to create a new instance
dateEJB = dateEJBHome.create();

// Call any of the Remote methods below to access the EJB
System.out.println("Date & Time >>> "+dateEJB.getCurrentTime());

}
catch(Throwable ex)

Any idea why I get this error?

com.evermind.server.rmi.OrionRemoteException: jazn.com/admin is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role-mapping in orion-application.xml).
at DateEJBHome_StatelessSessionHomeWrapper3.create(DateEJBHome_StatelessSessionHomeWrapper3.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
at connection to localhost/127.0.0.1 as admin
at DateEJBHome_StatelessSessionHomeWrapper3.create(DateEJBHome_StatelessSessionHomeWrapper3.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Process exited with exit code 0.
 
author & internet detective
Posts: 41250
849
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kola,
It sounds like you have security turned on for the EJB. If you don't need it on for testing, you can turn it off.

Otherwise, you need to pass the user id to run with to your client.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kola,
If you would care to provide some more information, I may be able to provide you with an answer to your question.
  • What OC4J version are you using?
  • Are you using OC4J stand-alone, or Oracle Application Server?
  • Are you using a JDK version that is compatible with your OC4J version?
  • What kind of client are you using? A simple java class? A servlet? A JSP? A J2EE client module?

  • Good Luck,
    Avi.
     
    Kayman
    Ranch Hand
    Posts: 40
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    What OC4J version are you using?
    I am using the OC4j that is packaged with Jdeveloper10g build - 9.0.5.1

    Are you using OC4J stand-alone, or Oracle Application Server?
    stand-alone

    Are you using a JDK version that is compatible with your OC4J version?
    Java 1.4.2_03

    What kind of client are you using?
    A simple java class

    I also have the following application resources in the meta-inf
    DateApp-jazn-data.xml
    DateApp-oc4j-app.xml
    ejb-jar.xml
    orion-ejb-jar.xml
     
    Avi Abrami
    Ranch Hand
    Posts: 1143
    1
    Eclipse IDE Oracle Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Kola,
    Fell into the trap of using the JDeveloper wizards, did we?
    Have you tried the JDeveloper forum (at Oracle's OTN Web site)?

    Personally, I don't use JDeveloper, I use OC4J stand-alone, but I don't use the JAZN security, I use the "principals" security, so I don't think I can help you. However, you will find documentation and sample code at the OTN Web site.

    Good Luck,
    Avi.
     
    Kayman
    Ranch Hand
    Posts: 40
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Avi. I think I'll take your advice and only use the
    OC4J stand alone. I will not be defeated on my quest to
    learn about EJBs

    K
     
    I'm doing laundry! Look how clean this tiny ad is:
    the value of filler advertising in 2021
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic