Is it possible to deploy a EJB in runtime?

I wanna develope a program in java wich deploy a bean at runtime, having the .ear, and all the other files, the container running on, and so on.
Are API's available for performing this func ?

Hi ,
I think u need to deploy an EJB without stopping your application server. Is that what u precisely meant by "deploying an EJB in runtime" ?
If yes , I guess , you might wish to see your app server documentation for "hot deployment for EJBs". Some application servers support hot deployment of EJBs . I guess Weblogic supports.
-amit

Similar Messages

  • Possible to deploy EJB with REPLICATE_BINDINGS == false?

    Is there a way to deploy an EJB with WLContext.REPLICATE_BINDINGS == false?
              There does not seem to be a way to do this using deployment descriptors? Is
              it possible to deploy the EJB programmatically so I can explicitly specify
              REPLICATE_BINDINGS for InitialContext?
              Btw, I'm running WLS 5.1.
              Thank you.
              Marko.
              

    <Sep 9, 2003 9:39:46 AM SGT> <Warning> <EJB> <EJB
    Deployment: Ecommerce.OrderLineItemHome cannot be
    redeployed while the server is running.
    com.igine.apps.ecommerce.OrderLineItemBean is located
    in the server's classpath.>
    <Sep 9, 2003 9:39:46 AM SGT> <Warning> <EJB> <EJB
    Deployment: Ecommerce.OrderLineItemHome cannot be
    redeployed while the server is running.
    com.igine.apps.ecommerce.OrderLineItemHome is located
    in the server's classpath.>
    <Sep 9, 2003 9:39:46 AM SGT> <Warning> <EJB> <EJB
    Deployment: Ecommerce.OrderLineItemHome cannot be
    redeployed while the server is running.
    com.igine.apps.ecommerce.OrderLineItem is located in
    the server's classpath.>
    <Sep 9, 2003 9:39:46 AM SGT> <Warning> <EJB> <EJB
    Deployment: Ecommerce.OrderLineItemHome cannot be
    redeployed while the server is running.
    com.igine.apps.ecommerce.OrderLineItemPK is located in
    the server's classpath.>This is where you've messed up. Your EJB-jar should NEVER be in the JVM ClassPath.

  • Is it possible to deploy EJBs onto Tomcat server

    Hi all,
    Please advice me if it is possible to deploy EJBs on the Tomcat Server.
    If so how to go about it?
    Thanks
    Ranjan

    No , it is not possible.Tomcat does not have a
    Ejb container.It only has a web container.
    Try using free servers like Sun One application server for
    deploying your ejb's.
    Get back in case of any issues

  • Is it possible to deploy two different EJBs in one single descriptor file?

    Hi, I'm working with two EJBs I wanna deploy them in one single jar, so my question here is, is it possible to deploy two or more EJBs within the same xml descriptor file?, if so, could you please give me an example of it?, I'm working with Stateless session beans, thanks in advance.

    You can have as many beans in an EJB deployment descriptor as you like - i think, i have not run into a limit yet...
    <ejb-jar>
    <enterprise-beans>
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>BEanOne</display-name>
    etc...
    </session>
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>BeanTwo</display-name>
    etc...
    </session>
    </enterprise-beans>
    </ejb-jar>
    m

  • Exception during deployment of EJB application

    Hi Experts,
    I'm deploying one EJB application which is giving following warning.
    What's the cause of it?
    Caught exception during application startup from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Error occurred while starting application asianpaints.com/bsApp and wait.
    Reason: Clusterwide exception: server ID 8216350:com.sap.engine.services.ejb.exceptions.deployment.EJBDeploymentException: The DataSource for PersistenceManager J2EDB is not created.
         at com.sap.engine.services.ejb.entity.pm.PersistenceManager.initDataSource(PersistenceManager.java:217)
         at com.sap.engine.services.ejb.EJBAdmin.commitLoad(EJBAdmin.java:1112)
         at com.sap.engine.services.ejb.EJBAdmin.prepareStart(EJBAdmin.java:2428)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:239)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:187)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:327)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:111)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:230)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4700)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4605)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4578)
         at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1163)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name ejbContainer/cmp/tx/asianpaints.com/bsApp/J2EDB, cannot resolve object reference. [Root exception is com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "J2EDB" does not exist. Possible reasons: the connector in which ConnectionFactory "J2EDB" is defined is not deployed or not started.]
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:529)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:639)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sap.engine.services.ejb.entity.pm.PersistenceManager.initDataSource(PersistenceManager.java:185)
         ... 21 more
    Caused by: com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "J2EDB" does not exist. Possible reasons: the connector in which ConnectionFactory "J2EDB" is defined is not deployed or not started.
         at com.sap.engine.services.connector.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:207)
         at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl._getObjectInstance(ObjectFactoryBuilderImpl.java:72)
         at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl.access$100(ObjectFactoryBuilderImpl.java:31)
         at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl$DispatchObjectFactory.getObjectInstance(ObjectFactoryBuilderImpl.java:210)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:280)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:414)
         ... 25 more
    Pls help as im waiting for your reply...
    regards,
    Amey

    Hi Yordan,
    This is where im specifying my datasource in persistent.xml file(that is  in "General tab"  of EJB DC)
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">
    <persistent-ejb-map>
         <locking
              type="Table"/>
         <db-properties>
              <data-source-name>J2EDB</data-source-name>
         </db-properties>
         <entity-beans>
              <entity-bean>
                   <ejb-name>OEMBean</ejb-name>

  • Deploying Session EJB From Jdev9i(Beta) - OC4J 9i

    Hi All ,
    I wanted from u , i have recently Upgraded to Oracle 9i 1.0.2.2.1 (OC4J) . Now i want a simple Step wise process as how can i deploy my Ejb (Session Bean ) into the OC4J container and Use its DataSource .
    Is it possible to deploy using Jdev 9i (Beta) .
    Can any one please help me out to point to a Documentaion , give me a breif process .
    Regards
    Asif

    Asif -
    Yes you can use Jdeveloper 9i beta to deploy your session ejb.
    Step 1 should be setting up your Data Source. In the System
    Navigator Panel expand the "Connections" listing. Right-click
    on "Database" and select "New Connection..." - follow the
    wizard's instructions to set up your data source. Step 2 should
    be setting up a connection to the OC4J container - again on the
    System Navigator Panel ->Connections->Application Servers -
    follow the instructions there. I am assuming that you have
    developed your session ejb using Jdeveloper, right click on
    your .jpr entry (or wherever suits you) and choose "New..." then
    Deployment Profiles. You need to package your session ejb into a
    jar file and I would recommend packaging your jar file into an
    ear file (it really helps for clean deployment). If you have a
    web portion, package that and make it dependent on the jar file
    just to keep it straight. Once you have these, you will be able
    to right click on the jar or web file and deploy to an ear file,
    or straight to the server. If this is what you are looking for,
    you will then just select this and away you go.
    Apparently there are some howtos here:
    http://otn.oracle.com/docs/products/jdev/howto.html
    although I don't know how good they are.
    I wasn't quite sure what you were looking for so this post is
    vague. If you have specific questions, let me know and I will
    try and answer them!
    Cheers
    Ray

  • Is there an MBean for a deployed entity EJB?

    Hi,
    I need to access the method invocation times, availability, remove count, create count etc. of a deployed entity EJB through JMX MBean, in JBoss.
    I have deployed the entity bean and the stateless DAO bean that operates on the entity bean. I do find an MBean for this DAO in the JMX-console of JBoss, but not an MBean for the entity EJB.
    a) Why do I not find an MBean for the same?
    b) How is it possible to get the MBean created for the entity EJB?
    Speedy help solicited.
    Thanks a bunch in advance guys !

    When executing an operation via JMX using JConsole, I get the following error:
    Problem invoking getManifest : java.rmi.UnmarshallException: Error unmarshalling return: nested is: java.lang.ClassNotFoundException: foo.bar.InernalServiceException (no security manager: RMI class loader disabled)
    Code snippet:
    public ArrayList getManifest(String s) throws InternalServiceException, MBeanException{
    String path = ".\\foo_services.jar"; // Invalid path on purpose to test exception...
    File file = new File(path);
    FileInputStream fileInput;
    try {
    fileInput = new FileInputStream(file);
    } catch (FileNotFoundException e) {
    String msg = "The manifest file is not found in the given path";
    if (logger.isErrorEnabled()) logger.error(msg);
    throw new InternalServiceException(msg, ErrorConstants.JMX_FILE_NOT_FOUND);
    If I throw new RuntimeException(msg, e) instead of InternalServiceException(msg, ErrorConstants.JMX_FILE_NOT_FOUND), it works and I get the appropriate exception.
    What is the reason for this?

  • Deploy multiple EJBs

    Hi there,
    after I got my first session bean running, I want it to make use of an entity bean. I want to deploy all beans at once, so the can share parts in the xml-deployment descriptor.
    Unfortunately 'deployebj' (or in detail ejbdescriptor) complains saying :
    'Can not deploy multiple beans in one deployment descriptor'
    Has anybody an idea how to fix this as this is required for ejb1.1 and j2ee conformance, about which oracle says IAS9i complies to - so it should be possible.
    Stefan

    Hi,
    I have a doubt here while deploying multiple EJBs in one instance of Oracle 10g Application Server (either in OC4J standalone or in complete suite).
    In my case, I have multiple jars and each jar has its own ejb-jar.xml and in this case, I was not able to figure out how to write my jndi.properties.
    We want to have only one jndi.properties file. We do a look-up using RMIInitialContextFactory. Is it ok, if I give the following in my jndi.properties for provider url?
    java.naming.provider.url= opmn:ormi://<opmn_host>:<opmn_port>:<oc4j_instance>/<application-name1>, opmn:ormi://<opmn_host>:<opmn_port>:<oc4j_instance>/<application-name2>, opmn:ormi://<opmn_host>:<opmn_port>:<oc4j_instance>/<application-name3>, [and so on (till application-name[b]n) for all the EJBs present.]
    Will this work, and if it is so, is it correct?
    If not, can some one please help me out for this particular scenario.
    Thanks a lot for participation.
    Regards,
    Prashanth Babu.

  • Cannot deploy a EJB 3.0 Session bean to the OAS 10.1.3.4

    Hi All,
    I am unable to deploy a EJB 3.0 Session bean with no deployment descriptors to OAS 10.1.3.4 App server.This Session bean is also exposed as a web service using annotations. I am able to deploy this bean to a standalone oc4j 10.1.3.x containers and test it successfully.
    i have written a simple stateless session bean ( exposed as webservice) and every bean is having issues with deployment having the same exception stated below
    Can some one please help as i need to deploy this urgently.
    below is the session bean code:
    import javax.ejb.Stateless;
    @Stateless(name="SiebelQuoteEJB")
    public class SiebelQuoteEJBBean implements SiebelQuoteEJBLocal,
    SiebelQuoteEJBWebService {
    public SiebelQuoteEJBBean() {
    public String publishMessage(String message,String type) throws java.rmi.RemoteException {
    client.publishMessage(message,type);
    return "SUCCESS";
    Below is the error while deploying:
    11/01/06 15:03:49 WARNING: Application.setConfig Application: javasso is in failed state as initialization failed.
    java.lang.NullPointerException
    11/01/06 15:03:50 WARNING: Application.setConfig Application: SiebelQuoteEJB is in failed state as initialization failed.
    java.lang.InstantiationException: Error initializing ejb-modules: null Error parsing application-server config file: null
    11/01/06 15:03:50 java.lang.NullPointerException
    at com.evermind.server.ObjectReferenceCleaner.cleanupApplicationLogLevels(ObjectReferenceCleaner.java:166)
    at com.evermind.server.ObjectReferenceCleaner.loaderDestroyed(ObjectReferenceCleaner.java:88)
    at oracle.classloader.EventDispatcher.loaderDestroyed(EventDispatcher.java:248)
    at oracle.classloader.PolicyClassLoader.close(PolicyClassLoader.java:1113)
    at oracle.classloader.PolicyClassLoader.close(PolicyClassLoader.java:1041)
    at com.evermind.server.ApplicationStateRunning.destroyClassLoaders(ApplicationStateRunning.java:1171)
    at com.evermind.server.Application.stateCleanUp(Application.java:3635)
    at com.evermind.server.Application.setConfig(Application.java:506)
    at com.evermind.server.Application.setConfig(Application.java:355)
    at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1895)
    at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1651)
    at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1034)
    at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
    at java.lang.Thread.run(Thread.java:736)

    which jdk version? Had this with 1.6 and had to install an up-to-date jdbc.

  • Getting error while deploying the ejb in jboss3.2.3

    i m getting following error msg while deploying my ejb in jboss-3.2.3. i m deploying the same code available at
    http://www.ftponline.com/javapro/2003_01/online/j2ee_bkurniawan_01_09_03/
    04:30:48,955 INFO [MainDeployer] Starting deployment of package: file:/home/ami
    tt/jboss-3.2.3/server/default/deploy/StringProcessor.jar
    04:30:48,972 ERROR [MainDeployer] could not create deployment: file:/home/amitt/
    jboss-3.2.3/server/default/deploy/StringProcessor.jar
    org.jboss.deployment.DeploymentException: ejb-jar.xml must define a valid DOCTYP
    E!
    at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMet
    aData.java:206)
    at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:141)
    at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:436)
    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
    at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea nDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
    at $Proxy6.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen tScanner.java:302)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS canner.java:476)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread. doScan(AbstractDeploymentScanner.java:201)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread. loop(AbstractDeploymentScanner.java:212)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread. run(AbstractDeploymentScanner.java:191)
    Please reply me bak the required solution.......

    looks like your xml files are not done.

  • Steps to deploy an ejb application and running an ejb client in weblogic server6.1

    steps to deploy an ejb application and steps to run an ejb client in weblogic server6.1
    if the client is an simple java application and if the client is a servlet

    Hi.
    Check out the beanManaged example that ships with WLS and read the accompanying docs. This
    is a simple EJB with a servlet that invokes it.
    Michael
    shekhar sachdev wrote:
    steps to deploy an ejb application and steps to run an ejb client in weblogic server6.1
    if the client is an simple java application and if the client is a servlet--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Is it possible to deploy a process in "OFF" state?

    Is it possible to deploy a process in "OFF" state?

    Hi Chris,
    Looking through the BPEL client API, I think it might be possible to change the process state via java code. I say might, because the documentation is not that splendid. The IBPELProcessHandle interface has a method updateMetaData which allows you to change the state, among other things. I have not tried this yet so the solution a little theoretical.Sorry for that :-\
    Then, when you have your java class working, you can create an Ant task for it and invoke your Ant task in the build.xml, right after the deployment target.
    Kind regards,
    Harm

  • Urgent: Is it possible to deploy a web service EAR/JAR to a container other than WebLogic?

    Hi,
    Is it possible to deploy an EAR/JAR created using JwsCompile to any J2EE container?
    Ideally, I would like to make use of the features that are only provided by WebLogic
    Workshop, like State Management, Callbacks too. If possible, what are the steps
    involved?
    There is an example for interoperability included in the samples that demonstrates
    the use of a WebLogic Workshop web service from an ASP.NET web service, participating
    in a conversation and accepting a callback. Is it possible to do the same using
    a normal C# windows or webforms app instead of using an ASP.NET web service? So,
    I would like to access the WebLogic workshop generated web service with state
    management and callbacks from a C# windows app.
    Thanks in anticipation,
    August

    [att1.html]

  • How deploy the EJB in security on the Sun Java System Application Server 9?

    I hava deploied a simple Hello EJB Object on PE 9(Sun Java System Application Server Platform Edition 9). I can use this EJB object without user name an password On any client. See the following code section:
         public static void main(String[] args) {
              try{
                   Properties props = System.getProperties();
                   props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
                   props.put(Context.PROVIDER_URL,"iiop://localhost:3700");
                   Context ctx = new InitialContext(props);
                   Hello h = (Hello) ctx.lookup("ejb/test/Hello");
                   System.out.println(h.sayHello());
              }catch(Exception e){
                   e.printStackTrace();
    Please tell me how deploy the EJB in security on the Sun Java System Application Server 9? So that, The client must set the user name and password when lookup the ejb object. Like the following:
    props.put(Context.SECURITY_PRINCIPAL,"admin")
    props.put(Context.SECURITY_CREDENTIALS,"1234");

    Guys,
    I too have the same issue. If anyone has an answer, please let me know.
    Is this GlassFish problem? or Prgram issue?
    Find below the source code
    package TransactionSecurity.bean;
    import javax.annotation.Resource;
    import javax.annotation.security.DeclareRoles;
    import javax.annotation.security.PermitAll;
    import javax.annotation.security.RolesAllowed;
    import javax.ejb.Remote;
    import javax.ejb.SessionContext;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    @Stateless
    @Remote(TSCalculator.class)
    @DeclareRoles({"student", "teacher"})
    public class TSCalculatorBean implements TSCalculator {
         private @Resource SessionContext ctx;
         @PermitAll
    //     @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
         public int add(int x, int y) {
              System.out.println("CalculatorBean.add  Caller Principal:" + ctx.getCallerPrincipal().getName());
              return x + y;
         @RolesAllowed( { "student" })
         public int subtract(int x, int y) {
              System.out.println("CalculatorBean.subtract  Caller Principal:" + ctx.getCallerPrincipal().getName());
              System.out.println("CalculatorBean.subtract  isCallerInRole:" + ctx.isCallerInRole("student"));
              return x - y;
         @RolesAllowed( { "teacher" })
         public int divide(int x, int y) {
              System.out.println("CalculatorBean.divide  Caller Principal:" + ctx.getCallerPrincipal().getName());
              System.out.println("CalculatorBean.divide  isCallerInRole:" + ctx.isCallerInRole("teacher"));
              return x / y;
    package TransactionSecurity.bean;
    import javax.ejb.Remote;
    @Remote
    public interface TSCalculator {
            public int add(int x, int y);
            public int subtract(int x, int y);
            public int divide(int x, int y);
    package TransactionSecurity.client;
    import java.util.Properties;
    import javax.ejb.EJBAccessException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import TransactionSecurity.bean.TSCalculator;
    public class TSCalculatorClient {
         public static void main(String[] args) throws Exception {
              // Establish the proxy with an incorrect security identity
              Properties env = new Properties();
              env.setProperty(Context.SECURITY_PRINCIPAL, "kabir");
              env.setProperty(Context.SECURITY_CREDENTIALS, "validpassword");
            env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
            env.setProperty(Context.PROVIDER_URL,"iiop://127.0.0.1:3700");
            env.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
            env.setProperty("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
            env.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            env.setProperty("org.omg.CORBA.ORBInitialHost", "127.0.0.1");
            env.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
              InitialContext ctx = new InitialContext(env);
              TSCalculator calculator = null;
              try {
                   calculator = (TSCalculator) ctx.lookup(TSCalculator.class.getName());
              } catch (Exception e) {
                   System.out.println ("Error in Lookup");
                   e.printStackTrace();
                   System.exit(1);
              System.out.println("Kabir is a student.");
              System.out.println("Kabir types in the wrong password");
              try {
                   System.out.println("1 + 1 = " + calculator.add(1, 1));
              } catch (EJBAccessException ex) {
                   System.out.println("Saw expected SecurityException: "
                             + ex.getMessage());
              System.out.println("Kabir types in correct password.");
              System.out.println("Kabir does unchecked addition.");
              // Re-establish the proxy with the correct security identity
              env.setProperty(Context.SECURITY_CREDENTIALS, "validpassword");
              ctx = new InitialContext(env);
              calculator = (TSCalculator) ctx.lookup(TSCalculator.class.getName());
              System.out.println("1 + 1 = " + calculator.add(1, 1));
              System.out.println("Kabir is not a teacher so he cannot do division");
              try {
                   calculator.divide(16, 4);
              } catch (javax.ejb.EJBAccessException ex) {
                   System.out.println(ex.getMessage());
              System.out.println("Students are allowed to do subtraction");
              System.out.println("1 - 1 = " + calculator.subtract(1, 1));
    }The user kabir is created in the server and this user belongs to the group student.
    Also, I have enabled the "Default Principal To Role Mapping"
    BTW, I'm able to run other EJB3 examples [that does'nt involve any
    security features] without any problems.
    Below is the ERROR
    Error in Lookupjavax.naming.NamingException: ejb ref resolution error for remote business interfaceTransactionSecurity.bean.TSCalculator [Root exception is java.rmi.AccessException: CORBA NO_PERMISSION 0 No; nested exception is:
         org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.NO_PERMISSION:   vmcid: 0x0  minor code: 0  completed: No
         at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.handle_null_service_context(SecServerRequestInterceptor.java:407)
         at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:429)
         at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeServerInterceptorIntermediatePoint(InterceptorInvoker.java:627)
         at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIIntermediatePoint(PIHandlerImpl.java:530)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.getServantWithPI(CorbaServerRequestDispatcherImpl.java:406)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:224)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    ----------END server-side stack trace----------  vmcid: 0x0  minor code: 0  completed: No]
         at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:425)
         at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:74)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:403)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at TransactionSecurity.client.TSCalculatorClient.main(TSCalculatorClient.java:35)
    Caused by: java.rmi.AccessException: CORBA NO_PERMISSION 0 No; nested exception is:
         org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.NO_PERMISSION:   vmcid: 0x0  minor code: 0  completed: No
         at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.handle_null_service_context(SecServerRequestInterceptor.java:407)
         at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:429)
         at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeServerInterceptorIntermediatePoint(InterceptorInvoker.java:627)
         at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIIntermediatePoint(PIHandlerImpl.java:530)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.getServantWithPI(CorbaServerRequestDispatcherImpl.java:406)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:224)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    ----------END server-side stack trace----------  vmcid: 0x0  minor code: 0  completed: No
         at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:277)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
         at com.sun.ejb.codegen._GenericEJBHome_Generated_DynamicStub.create(com/sun/ejb/codegen/_GenericEJBHome_Generated_DynamicStub.java)
         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:585)
         at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:372)
         ... 5 more
    Caused by: org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.NO_PERMISSION:   vmcid: 0x0  minor code: 0  completed: No
         at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.handle_null_service_context(SecServerRequestInterceptor.java:407)
         at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:429)
         at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeServerInterceptorIntermediatePoint(InterceptorInvoker.java:627)
         at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIIntermediatePoint(PIHandlerImpl.java:530)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.getServantWithPI(CorbaServerRequestDispatcherImpl.java:406)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:224)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    ----------END server-side stack trace----------  vmcid: 0x0  minor code: 0  completed: No
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:913)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:131)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:685)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:472)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:363)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:219)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:192)
         ... 13 moreAny help is appreciated.
    Regards!
    Nithi.
    Edited by: EJB3 on Aug 17, 2008 8:17 PM

  • Problem deploying entity ejb CMP

    hello
    when i deploy CMP entity bean in weblogic 5.1
    i get an error "could not make connection to pool"
    i am using oracle thin driver. connection pool
    is created when i start the server but bean could not deploy
    please help
    thanx

    First, set the server to display all logging messages (not just errors), then when you deploy the ejb see what messages happen. I had similar problems when we were deploying on Weblogic 7.0 (with thin Oracle driver).
    Also, be sure you have downloaded the latest Oracle driver classes12.zip file and put it into the weblogic server directory - that can cause problems too.

Maybe you are looking for

  • HT1688 how can I tell if my iphone 4 has a virus

    does my phone have a virus?

  • Set operations usecase

    hi, I am a new bee and would like to understand the use of SET operations ( UNION, UNIONALL, MINUS, INTERSECTION) can't we do the same with the use of JOINS ? Am I wrong ? please correct me....and few examples where there is no alternate except using

  • Can't import .scc file into premiere

    I am trying to import a closed captions file into Premier CC I am getting  'The file cannot be opened because of a header error.' each time I have tried every format I can for closed captions to try and import I have also re-exported versions frm two

  • Would you recommend an imac 27" or a Macbook Pro 15" retina display?

    Portability does not matter at all in this case. Would you recommend buying a Macbook pro 15" or an imac 27".  Can you list some pro's and con's? Thank you very much!

  • Slow and slugish Gui with any app

    window resizing: the bigger the window, the slower the resizing in logic 7, window resizing, event resizing or looping can get below 1 fps Resizing Finder will even crash on bigger finder windows the mac was bought in June2004 Graphics Card is an RV3