No security on create() method for EJBs

 

How do we get a hold on 5.1.1??? We are evaluating the Weblogic for
possible purchase and security is a core functionality in our product
line.... Let me know asap..
Se Hee
"paul a. bauerschmidt" <[email protected]> wrote in message
news:[email protected]..
Good Bug in 5.1.0, it's fixed in 5.1.1.
contact support for more info.
.paul
Leon Wong wrote:
The method permissions for EJB methods do not work for create() methods.
I have used the EJBDeployerTool as well as the ejb-jar.xml file to try
to do this but it just does not work. Any other method in the EJb works
by either method. Also
tried securing all methods but this does not work either.
Thanks,
Leon Wong

Similar Messages

  • Edit entity object and use the Create() method for generating ID's

    Hello,
    I have and InserPage.jsp and defined the datasoucre correctly.
    <jbo:InputText datasource="ds" dataitem="Clientid" /> gives me
    the unique ClientID from the FIRST client-record in my table ,
    although this page is for inserting a NEW Client, with a new
    ClientID.
    So, on the Clients Entity i made a create() method and put the
    following code in it:
    public Number getClientid() {
    return (Number)getAttributeInternal(CLIENTID);
    public void create(AttributeList attributeList) {
    SequenceImpl seq = new SequenceImpl
    ("Clientid",getDBTransaction());
    Integer i=(Integer)seq.getData();
    setClientid(new Number(i.intValue()));
    super.create(attributeList);
    the getData() Returns a sequence value, but what sequence value?
    Do i have to create a sequence on the ClientID column in my
    Oracle Table in the DB too?
    The problem is, the first ClientID # is 819 and the current last
    one seems to be 2899, so how do i achieve that when opening the
    insert.jsp the new ClientID shows up (ie. 2900)?
    How can i achieve this?
    thx

    OK, managed to track down the HowTo on triggers? I created the
    trigger.
    create sequence client_seq
    start with 8900
    increment by 1
    nomaxvalue
    nocycle;
    I changed the create() method for the entity object to:
    public void create(AttributeList attributeList) {
    SequenceImpl seq = new SequenceImpl
    ("Clientid",getDBTransaction());
    SequenceImpl s = new SequenceImpl("client_seq",
    getDBTransaction());
    Integer next = (Integer)s.getData();
    setClientid(new Number(next.intValue()));
    and running the tester for the module works fine. ;-)
    But...
    The Insert.jsp page has to insert/show this sequenced value!
    After i defined the datasource and let us say:
    <jbo:InputText datasource="ds" dataitem="Clientid" />
    ...the number 819 shows up, which is the FIRST record, so i do
    not get the new ClientID with the correct number.
    Any help is always nice. ;-)

  • How to write a create method for a table Not null fields

    Hi all,
    I have a table with four columns,
    process
    prs_seqid NUMBER(4) NOT NULL,
    prs_sbs VARCHAR2(2) NOT NULL,
    prs_name VARCHAR2(64) NOT NULL,
    description VARCHAR2(128)
    Where prs_seqid is primary key and prs_sbs is foreign key.
    I tried to create a CMP bean for this table. I am unable to write a record in table while I can read
    Records from table. These are the create methods
    public Long ejbCreate() throws CreateException {
    return null;
    public Long ejbCreate(Long newPrs_seqid, String newPrs_sbs, String newPrs_name) throws CreateException {
    prs_seqid = newPrs_seqid;
    newPrs_sbs = prs_sbs;
    prs_name = newPrs_name;
    return null;
    public void ejbPostCreate() {
    public void ejbPostCreate(Long newPrs_seqid, String newPrs_sbs, String newPrs_name) {
    When I run the client code �home.create(pk, "AB", "ABC");�
    It throws
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.RemoteException: Transaction aborted (possibly due to transacti
    on time out).; nested exception is: javax.transaction.RollbackException; nested
    exception is:
    javax.transaction.RollbackException
    java.rmi.RemoteException: Transaction aborted (possibly due to transaction time
    out).; nested exception is: javax.transaction.RollbackException; nested exceptio
    n is:
    javax.transaction.RollbackException
    javax.transaction.RollbackException
    <<no stack trace available>>
    In log file I got
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("SCOTT"."PROCESSES"."PRS_SBS")
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
         at com.sun.ejb.persistence.PersistenceManagerImpl.createRow(PersistenceManagerImpl.java:630)
         at com.sun.ejb.persistence.PersistenceManagerImpl.storeRow(PersistenceManagerImpl.java:412)
         at com.sun.ejb.persistence.PartitionImpl.ejbStore(PartitionImpl.java:555)
         at com.telesenskscl.processes.ProcessesBean_PM.ejbStore(ProcessesBean_PM.java:103)
         at com.sun.ejb.containers.EntityContainer.callEJBStore(EntityContainer.java:1581)
         at com.sun.ejb.containers.EntityContainer.enlistResourcesAndStore(EntityContainer.java:868)
         at com.sun.ejb.containers.EntityContainer.beforeCompletion(EntityContainer.java:853)
         at com.sun.ejb.containers.ContainerSynchronization.beforeCompletion(ContainerSynchronization.java:65)
         at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:48)
         at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:108)
         at com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2289)
         at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:233)
         at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:208)
         at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:386)
         at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:208)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:434)
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:1460)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:1278)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:397)
         at com.telesenskscl.processes.ProcessesBean_PM_RemoteHomeImpl.create(ProcessesBean_PM_RemoteHomeImpl.java:41)
         at com.telesenskscl.processes._ProcessesBean_PM_RemoteHomeImpl_Tie._invoke(Unknown Source)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:519)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:204)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
         at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
         at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
         at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
    javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SCOTT"."PROCESSES"."PRS_SBS")
    javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SCOTT"."PROCESSES"."PRS_SBS")
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("SCOTT"."PROCESSES"."PRS_SBS")
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
         at com.sun.ejb.persistence.PersistenceManagerImpl.createRow(PersistenceManagerImpl.java:630)
         at com.sun.ejb.persistence.PersistenceManagerImpl.storeRow(PersistenceManagerImpl.java:412)
         at com.sun.ejb.persistence.PartitionImpl.ejbStore(PartitionImpl.java:555)
         at com.telesenskscl.processes.ProcessesBean_PM.ejbStore(ProcessesBean_PM.java:103)
         at com.sun.ejb.containers.EntityContainer.callEJBStore(EntityContainer.java:1581)
         at com.sun.ejb.containers.EntityContainer.enlistResourcesAndStore(EntityContainer.java:868)
         at com.sun.ejb.containers.EntityContainer.beforeCompletion(EntityContainer.java:853)
         at com.sun.ejb.containers.ContainerSynchronization.beforeCompletion(ContainerSynchronization.java:65)
         at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:48)
         at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:108)
         at com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2289)
         at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:233)
         at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:208)
         at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:386)
         at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:208)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:434)
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:1460)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:1278)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:397)
         at com.telesenskscl.processes.ProcessesBean_PM_RemoteHomeImpl.create(ProcessesBean_PM_RemoteHomeImpl.java:41)
         at com.telesenskscl.processes._ProcessesBean_PM_RemoteHomeImpl_Tie._invoke(Unknown Source)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:519)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:204)
         at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
         at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
         at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
         at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
    Please help me ASAP. Thanks in advance

    I found problem was with my code. I wrote
    newPrs_sbs = prs_sbs; instead of
    prs_sbs = newPrs_sbs;
    This solves my problem
    Thanks to all.....

  • What is the most secure password transfer method for POP3 supported by Thunderbird?

    I will receive eMail from a POP3-Server that support encrypted transfer of passwords with the SASL-Methods "SCRAM-SHA-1" and "SCRAM-SHA-256" (successful tested with the command line tool 'mpop') but Thunderbird say that the Server does not support encrypted transfer of Passwords. I think in real Thunderbird does not support the strong Methods offered by the POP3-Server.
    What is the most secure method for Password transfer on POP3 that is supported by Thunderbird?
    Greetings Erik

    I do not see SASL listed, do you?

  • Problem in creating jar for ejb

    hi,
    I want just to try to compile and deploy my ejb in the new version of bea weblogic
    server (version 8.1 trial version), but I have the problem when using weblogic.ejbc
    to create the jar file.
    There is no such problem when using weblogic 6.x, I can create the jar package
    of my ejb and deploy it within the server.
    I did this :
    java weblogic.ejbc stage/temp_myejb.jar stage/my_ejb.jar
    and I got the error message :
    ERROR: Error creating descriptor from jar file stage/temp_myejb.jar:
    ERROR: Error from ejbc: 1
    java.lang.ArrayIndexOutOfBoundsException: 1
    at weblogic.ejb20.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.java:222)
    at weblogic.ejb20.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.java:97)
    at weblogic.ejbc20.getDescriptorFromJar(ejbc20.java:698)
    at weblogic.ejbc20.runBody(ejbc20.java:459)
    at weblogic.utils.compiler.Tool.run(Tool.java:146)
    at weblogic.utils.compiler.Tool.run(Tool.java:103)
    at weblogic.ejbc.main(ejbc.java:29)
    ERROR: ejbc couldn't load descriptor from jar
    I do verify that the weblogic-ejb-jar.xml and ejb-jar.xml have been included in
    temp_myejb.jar but why the compiler cannot load the descriptor ?
    This is my weblogic-ejb-jar.xml :
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"
    "http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
         <weblogic-enterprise-bean>
              <ejb-name>MemberHome</ejb-name>
              <caching-descriptor>
                   <max-beans-in-free-pool>20</max-beans-in-free-pool>
                   <max-beans-in-cache>100</max-beans-in-cache>
                   <idle-timeout-seconds>10</idle-timeout-seconds>
              </caching-descriptor>
              <persistence-descriptor>
                   <is-modified-method-name>isModified</is-modified-method-name>
                   <delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>
              </persistence-descriptor>
              <jndi-name>MemberHome</jndi-name>
         </weblogic-enterprise-bean>
         <security-role-assignment>
              <role-name>EjbClient</role-name>
              <principal-name>RemoteUser</principal-name>
         </security-role-assignment>
    </weblogic-ejb-jar>
    Is there something I missed ?
    Many thanks in advance.
    best regards,
    Victorianus Kapuangan

    hi Deepak,
    Thanks for the answer.
    I do put the ejb-jar.xml and the weblogic-ejb-jar.xml in the META-INF dir of the
    temp_my_ejb.jar file. I use the bmp entity bean so I guess I do not need to put
    the weblogic-cmp-rdbms-jar.xml.
    Should I missed to put these deployment descriptors in the META-INF, I should
    not then be able to deploy my ejb in weblogic 6.x. But in fact I can deploy it
    using weblogic 6.x.
    TIA.
    regards,
    Victorianus
    "Deepak Vohra" <[email protected]> wrote:
    >
    The input jar file, temp_myejb.jar should have ejb-jar.xml, weblogic-ejb-jar.xml
    & weblogic-cmp-rdbms-jar.xml, for cmp entity bean, in the META-INF dir.
    "Victorianus Kapuangan" <[email protected]> wrote:
    hi,
    I want just to try to compile and deploy my ejb in the new version of
    bea weblogic
    server (version 8.1 trial version), but I have the problem when using
    weblogic.ejbc
    to create the jar file.
    There is no such problem when using weblogic 6.x, I can create the jar
    package
    of my ejb and deploy it within the server.
    I did this :
    java weblogic.ejbc stage/temp_myejb.jar stage/my_ejb.jar
    and I got the error message :
    ERROR: Error creating descriptor from jar file stage/temp_myejb.jar:
    ERROR: Error from ejbc: 1
    java.lang.ArrayIndexOutOfBoundsException: 1
    at weblogic.ejb20.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.java:222)
    at weblogic.ejb20.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.java:97)
    at weblogic.ejbc20.getDescriptorFromJar(ejbc20.java:698)
    at weblogic.ejbc20.runBody(ejbc20.java:459)
    at weblogic.utils.compiler.Tool.run(Tool.java:146)
    at weblogic.utils.compiler.Tool.run(Tool.java:103)
    at weblogic.ejbc.main(ejbc.java:29)
    ERROR: ejbc couldn't load descriptor from jar
    I do verify that the weblogic-ejb-jar.xml and ejb-jar.xml have beenincluded
    in
    temp_myejb.jar but why the compiler cannot load the descriptor ?
    This is my weblogic-ejb-jar.xml :
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic
    5.1.0 EJB//EN"
    "http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
         <weblogic-enterprise-bean>
              <ejb-name>MemberHome</ejb-name>
              <caching-descriptor>
                   <max-beans-in-free-pool>20</max-beans-in-free-pool>
                   <max-beans-in-cache>100</max-beans-in-cache>
                   <idle-timeout-seconds>10</idle-timeout-seconds>
              </caching-descriptor>
              <persistence-descriptor>
                   <is-modified-method-name>isModified</is-modified-method-name>
                   <delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>
              </persistence-descriptor>
              <jndi-name>MemberHome</jndi-name>
         </weblogic-enterprise-bean>
         <security-role-assignment>
              <role-name>EjbClient</role-name>
              <principal-name>RemoteUser</principal-name>
         </security-role-assignment>
    </weblogic-ejb-jar>
    Is there something I missed ?
    Many thanks in advance.
    best regards,
    Victorianus Kapuangan

  • Adding SAN through web-security and Creating CSR for Tomcat (CUCM 10.5) to be signed by Third Party CA

    Hi Guys,
    Wondering if Any one has done this or could suggest the needful,
    We are running CUCM 10.5 cluster and currently using self-signed certificate for Tomcat. Now, we would like to get it signed by Third party CA.
    Just to be clear that we are doing this for Jabber clients so they should not get prompted for certificate Invalid.
    Now the issue; The CUCM is using IP address as hostname and for that reason we had to add the desired IP address under SAN (alternate name) through set web-security command. We did that successfully and restarted the Tomcat service and when we run the Show web-security command, it does show the added SAN;
     altNames: 2 names
              1) UCS-CUCM-UB.domain (dNSName)
              2) 10.x.x.x (dNSName)
    But when we try to generate the new CSR, it didn't contain the modified SAN, just the first one i.e only 1) UCS-CUCM-UB.domain (dNSName)
    Is there anything we missed here to get the added SAN being populated in the new CSR ?
    Regards
    M

    Hi Gordon,
    Thank you for your prompt response. For recommendation, you are right but we don't want to initiate that change for now unless, there is no other option left.
    While Generating new CSR, under SAN, there is only Parent Domain field which is populated with our domain name. How should I add the IP address there ?
    Regards

  • I have question related ejb create method.

    hi pals
    i'm rookie about ejb.
    so i have a lot of wonders.
    i saw create method in ejb stateful session bean.
    but the create method have parameter like this "create(john)"
    the parameter "john" is not used in session bean.
    I really wonder parameter "john" s role.
    i'll expect reply. thanks for reading.
    P.S)when i delete this parameter in source, there were errors
    of course, i modified everyting related parameter "john".
    but there were errors still~

    The bean developer writes the create method for a Stateful Session Bean, so it's up to the developer
    to decide which (if any) parameters are needed at creation time. If a particular parameter is not used
    in the body of the ejbCreate method, that's a developer oversight. It's no different than writing any other
    plain Java method that ignores one of its parameters. It's not a fatal error but it's probably indicative of
    a mistake in the bean logic. All the EJB container cares about is that the signature of the create method
    in the Home/LocalHome interface matches a corresponding ejbCreate method in the bean class.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Regarding stateless bean create() method problem

    hi every body,
    I am Learning EJB now for this i created one StatelessBean with a eho functionality with jsp. it is working good for the first time but when i am trying to run that jsp once again it shows the following error in server console
    11:32:13,090 ERROR [LogInterceptor] EJBException in method: public abstract beans.StatelessRemote beans.StatelessHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException:
    javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract beans.StatelessRemote beans.StatelessHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException
    i am using Netbeans and J2EE 1.4 version and using Jboss 4.2.2.GA
    please help me in this regard
    yours,
    -sat-

    Bean :::::::::::::
    package beans;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessBean implements SessionBean {
    SessionContext context;
    // The public business method. This must be coded in the
    // remote interface also.
    public String getEchoString(String clientString) {
    return (clientString.toUpperCase() + " - from session bean");
    // Standard ejb methods
    public void ejbActivate() {
    System.out.println("ejb activate called");}
    public void ejbPassivate() {
    System.out.println("ejb passivate called");}
    public void ejbRemove() {
    System.out.println("ejb remove called");}
    public void ejbCreate() {
    System.out.println("ejb create called");}
    public void setSessionContext(SessionContext context) {
    System.out.println("setSessionContext called");
    this.context=context;
    Home interface::::::::::::::::::::::::::
    package beans;
    import java.rmi.RemoteException;
    import javax.ejb.EJBHome;
    import javax.ejb.CreateException;
    public interface StatelessHome extends EJBHome {
    // The create() method for the SimpleSession bean
    public StatelessRemote create()
    throws CreateException, RemoteException;
    Remote interface::::::::::::
    package beans;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface StatelessRemote extends EJBObject {
    // The public business method on the SimpleSession bean
    public String getEchoString(String clientString)
    throws RemoteException;
    client ie.. index.jsp
    <%@ page import="java.util.*,java.io.*,java.lang.*" %>
    <%@ page import="beans.*,javax.naming.InitialContext,javax.naming.Context,javax.rmi.PortableRemoteObject" %>
    <%--
    Document : index
    Created on : Dec 2, 2008, 11:33:10 AM
    Author : sathish.kumar
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <%
    Properties pro=new Properties();
    StatelessHome home;
    StatelessRemote simpleSession;
    String result=new String();
    try {
    // Get a naming context
    pro.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    pro.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");     
    pro.put(Context.PROVIDER_URL,"localhost:1099");
    InitialContext JContext = new InitialContext(pro);
    System.out.println("context::::::::::::::>"+JContext);
    // Get a reference to the SimpleSession JNDI entry
    Object ref =JContext.lookup("StatelessBean");
    // Get a reference from this to the Bean's Home interface
    home = (StatelessHome)PortableRemoteObject.narrow(ref, StatelessHome.class);
    // Create a SimpleSession object from the Home interface
    simpleSession = home.create();
    // Loop through the words
    for (int i = 0; i < 10; i++) {
    String returnedString = simpleSession.getEchoString("hello"+i+"::>>");
    System.out.println("sent string: " +"hello"+i+"::>>" +
    ", received string: " + returnedString);
    result+=returnedString;
    } catch(Exception e) {
    e.printStackTrace();
    %><form name="my" method=post>
    <h2>Hello World!<hr><br><%= result%><hr></h2></form>
    </body>
    </html>

  • Why there are overloaded create methods in Statful bean?

    Hi all,
    I have a question ...!
    Why there are overloaded create methods for Statefule beans? and why not for Stateless bean?
    because any way these create methods are for giving referneces of EJB objects.hence, what is use of overloaded methods in stateful bean?
    Thanks in advance.
    Regards,
    Rahul

    Hi Rahul,
    Each stateful session bean is tied to a particular client. That means whatever state is passed in during create() is guaranteed
    to be available on subsequent invocations. Allowing multiple create methods is a convenience.
    For stateless session beans there is no prescribed relationship between the caller and which bean instance is used to handle
    an invocation. It wouldn't make sense to allow creation parameters since there would be no guarantee that a subsequent
    invocation is handled by an instance containing that particular initialization state.
    All of this only applies to the EJB 2.1 and earlier API. Starting in EJB 3.0, there are no longer explicit create() methods.
    As you've seen there isn't any benefit to having them in the stateless case. For stateful session beans in EJB 3.0, the
    developer can perform initialization by just declaring a particular business method and calling that after first acquiring a
    new stateful session bean reference.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Configure security-role and method permission for EJB 3.0 using Jdev 11g

    The EJB 3.0 session bean created by Jdev 11g EJB wizard does not have ejb-jar.xml. Where and how can security-role and method permission for the EJB be configured?
    For example,
    <assembly-descriptor>
    <security-role>
    <role-name>managers</role-name>
    </security-role>
    <method-permission>
    <role-name>managers</role-name>
    <method>
    <ejb-name>Employees</ejb-name>
    <method-name>setSalary</method-name>
    <method-params>
    <method-param>java.lang.Long</method-param>
    </method-params>
    </method>
    </method-permission>
    </assembly-descriptor>

    user516954,
    By default annotations are used. However, you can create a new descriptor and that will take presidence over any declared annotation.
    --Ric                                                                                                                                                                                                                                                                                                                               

  • Difference between narrow() method usage and simple class cast for EJB

    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?
    P.S. I'm working with WL 6.1 sp2
    Any help would be appreciated.
    Thanks in advance,
    Orly

    [email protected] (Orly) writes:
    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?(1) is mandated by the spec. It is required because CORBA systems may
    not have sufficient type information available to do a simple case.
    P.S. I'm working with WL 6.1 sp2 You should always use PRO.narrow()
    andy

  • Creating Session Bean Facade Methods Off EJB QL

    Hello,
    I'm trying to follow the documentation for creating a Session Bean that has facade methods for various Entity Beans. When I add a named query:
    @NamedQuery(name = "Debtor.findDebtorById", query = "select o from Debtor o where o.debtorId = ?1")
    I end up with the following facade method:
    /** <code>select object(o) from Debtor o where o.DEBTOR_ID = ?1</code> */
    public List<Debtor> queryDebtorFindDebtorById(Object p1) {
    return em.createNamedQuery("Debtor.findDebtorById").setParameter(0, p1).getResultList();
    I see two issues here:
    1) The type of the input parameter is supposed to be a long, as the Entity Bean field looks like:
    @Id
    @Column(name="DEBTOR_ID", nullable = false)
    private Long debtorId;
    2) The parameter being set is '0' instead of '1'.
    Is there a known issue with generating this code in JDev? Or am I doing something wrong?

    another strange problem.
    i have an APplication server added ( JBOSS ).
    when i create deployment profile (EAR ) application server is showed in the ComboBox .
    But when i create Java Test Client for some EJB and when i check " Connect Remote Application server" there is 2 comboboxes
    J2EE Application
    App Server Connection.
    first combo is ok there is EJB applicaiton
    Secound is empty .. but i Have App Server.
    Another think is that when i create EJB 3.0 its BAD to see J2EE app it must be J EE 5 app or just Java EE app

  • Not seeing persistEntity or mergeEntity method when creating a session EJB

    Hi all,
    I am using JDev 11g to develop an ADF application. I have finished creating an entity EJB from database tables. Then I want to create a session EJB. In JDev, I do not see persistEntity or mergeEntity method in "<Core Facade Methods>"; rather, I am seeing another method
    public Object queryByRange(String jpqlStmt,int firstResult,int maxResults)
    listed there.
    Could you please let me know why? I am expecting to have persistEntity and mergeEntity methods included in the final created session EJB.
    Thank you.

    Hi,
    Thank you for your reply. But I am still not sure how to use the persist and merge methods from EntityManager. Either I want in the session EJB creation wizard to have persistEntity and mergeEntity to appear under "Core Facade methods", or I want to add these methods in the generated bean java file. I tried the latter by adding these two methods in the bean file, but I got an exception at runtime.
    Please privide some more information. Thank you very much.

  • My previous method for payment on itunes was debit card but now I dont have one.  How do I change to no card without creating a new apple id

    My previous method for payment on itunes was debit card but now I dont have one.  How do I change to no card without creating a new apple id?  It tells me to update payment details when I try to update apps but it only has visa, mastercard, amex and maesto.  I dont have any of them.  I did previously use visa but I dont have the card anymore and cant get another one.  Please can someone help me set it up so I dont need a payment method.  Thanks

    Thanks for you reply.  Is that the only way as it would cost me £15?

  • Creating Properties and Methods for an exe built in LabVIEW

    Hi all,
    How do we create properties and methods for an executable built in LabVIEW.
    I know when building an exe, the "Enable ActiveX server" option in advanced has to be enabled.
    But after that how do we create Properties and methods for the activeX component.
    Your help is greatly appreciated.
    Regards,
    Muthuraman S
    Regards,
    Muthuraman

    You cannot build your own COM specific properties and methods for the ActiveX interface in LabVIEW, the only thing exposed are the normal VI server properties and methods.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

Maybe you are looking for

  • Init 0 or shutdown -i0 on solaris 8 automatically reboots

    I have a solaris 8 server and when I issue init 0 or shutdown -i0 it automatically reboots. I was able to issue init 5 and it shutdown/power down, but not init 0. I looked at inittab and it shows s0:0:wait:/sbin/rc0 >/dev/msglog 2<>/dev/msglog </dev/

  • Set default grid artwork for composer grid view

    As the title I wanted to know if there is a way to set default grid artwork for composer grid view. Thanks.

  • Checkbox Behavior in new GUI Version

    We are currently testing GUI 7.1 , 710 Final Release File name saplogon.exe, File version 7100.1.2.1029, Build 908857 Patch Level 2 for implementation. A field change event is not being triggered consistently by double clicking on a checkbox. Works a

  • How to implement a Connection Pool?

    Hello. I need to create a class that implements a connection pool to an Oracle database, so that if from any other class someone ask for a connection then my new class has to supply it. The the jdbc driver I am trying is ""jdbc:oracle:thin" release "

  • Datalogging with options to retrieve subset of log file based on date/time

    I would like to thank this forum for useful advice so far in completing my LabVIEW software. I have a data logging challenge. I am supposed to log about 30 parameters every 5 seconds. Some of these parameters are digital (ON/OFF), some are values of