EJB-sample

Hi buddies,
I have installed oracleappserver.
i would like to run some ejb samples.
h to do that.i am new for ejb and oracleapserver.
can anyone give me the steps for that.
thanks and regards
siva

Hey Siva, Buddy!
How are you? Remind me where we know each other from!
Have you looked through the sample code available for download
from:
http://technet.oracle.com/sample_code/tech/java/oc4j/content.html
There is also documentation available at:
http://technet.oracle.com/docs/tech/java/oc4j/content.html
The documentation also contains sample code.
If you have looked through the above, and are still unclear as to
how to proceed, then please ask specific questions about the
aspects of OC4J that you are unclear on.
Please note also the following site:
http://kb.atlassian.com/content/tutorials/
also contains tutorials explaining how to set up and execute an
EJB application using OC4J.
If you are also new to EJB, go visit
http://www.theserverside.com
They have a digital book (PDF format) available for downloading
about EJB, "Mastering Enterprise Java Beans" by Ed Roman.
Good Luck,
Avi.

Similar Messages

  • Unable to Compile EJB Sample

    Environment: Windows NT4, sp5, WLS 5.1/sp 2, Sun JDK1.2.2
    As illustrated in 'Introduction to BEA Weblogic Server', pp 101-102, I'm
    compiling the Emp EJB sample. I successfully compiled the java programs,
    moved the XML files, and created the initial JAR file. Next the sample says
    to run ejbc on the JAR file. When I do I get the following error:
    G:\weblogic\examples\intro\ejbtemp>java -Dweblogic.home=%WL_HOME%
    weblogic.ejbc Emp.jar -d %WL_HOME%\myserver\Emp.jar
    java.lang.ClassCastException
    at
    weblogic.xml.dom.DOMUtils.getOptionalElementsByTagName(DOMUtils.java,
    Compiled Code)
    at
    weblogic.xml.dom.DOMUtils.getOptionalElementByTagName(DOMUtils.java:170)
    at
    weblogic.xml.dom.DOMUtils.getOptionalValueByTagName(DOMUtils.java:97)
    at
    weblogic.ejb.deployment.dd.EJBReadDOM.getDescriptionValue(EJBReadDOM.java:40
    4)
    at
    weblogic.ejb.deployment.dd.DescriptorLoader.createDeploymentUnit(DescriptorL
    oader.java:200)
    at weblogic.ejbc.runBody(ejbc.java, Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:80)
    at weblogic.ejbc.main(ejbc.java:353)
    ERROR: java.lang.ClassCastException
    Any idea what may be causing this?

    try to use the build script in the examples directory..
    It is available for all examples.
    so after running setenv
    go the example u want and run the build.cmd
    it should work
    Steve Vago wrote:
    Environment: Windows NT4, sp5, WLS 5.1/sp 2, Sun JDK1.2.2
    As illustrated in 'Introduction to BEA Weblogic Server', pp 101-102, I'm
    compiling the Emp EJB sample. I successfully compiled the java programs,
    moved the XML files, and created the initial JAR file. Next the sample says
    to run ejbc on the JAR file. When I do I get the following error:
    G:\weblogic\examples\intro\ejbtemp>java -Dweblogic.home=%WL_HOME%
    weblogic.ejbc Emp.jar -d %WL_HOME%\myserver\Emp.jar
    java.lang.ClassCastException
    at
    weblogic.xml.dom.DOMUtils.getOptionalElementsByTagName(DOMUtils.java,
    Compiled Code)
    at
    weblogic.xml.dom.DOMUtils.getOptionalElementByTagName(DOMUtils.java:170)
    at
    weblogic.xml.dom.DOMUtils.getOptionalValueByTagName(DOMUtils.java:97)
    at
    weblogic.ejb.deployment.dd.EJBReadDOM.getDescriptionValue(EJBReadDOM.java:40
    4)
    at
    weblogic.ejb.deployment.dd.DescriptorLoader.createDeploymentUnit(DescriptorL
    oader.java:200)
    at weblogic.ejbc.runBody(ejbc.java, Compiled Code)
    at weblogic.utils.compiler.Tool.run(Tool.java:80)
    at weblogic.ejbc.main(ejbc.java:353)
    ERROR: java.lang.ClassCastException
    Any idea what may be causing this?

  • ■■I can't debug the xml_xslt_content EJB sample in the examplesWebApp !!

    ■■I can't debug the xml_xslt_content EJB sample in the examplesWebApp
    start the Example Server
    http://localhost:7001/console
    among the deployed EJB ,the xml_xslt_content EJB how to run
    Is the related jsp page in \bea\wlserver6.0\samples\examples\xml\xslt ?????
    in the
    \bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\web.xml
    there are
    <taglib-location>
    /WEB-INF/lib/xmlx-tags.jar
    </taglib-location>
    </taglib>
    in line471
    but i did not find the xmlx-tags.jar
    in the \bea\wlserver6.0
    who can help me ??????????

    As this is your 3rd post on this subject, Please tell us what the problem is, I did reply to both your 1st and 2nd post, and whilst I agree that my 1st post did not give an adequate reply (I misunderstood the problem), I think my second reply was adequate and I did offer to help further if you had problems, (please remember that I have to work as well as trying to help other users on the forum).
    My 2nd reply was as follows:
    If you wish to use the IIS server then go to: http://www.microsoft.com/Web/
    and download the Microsoft web platform.
    This 2nd option here is best if you are using php or are a beginner -
    If you wish to use an apache server try: http://httpd.apache.org/download.cgi
    or for a fuller installation (server/mysql/php)
    http://www.wampserver.com/en/download.php
    Don't forget to get the documentation as well!
    HTH
    PZ
    Once you have one of these working (or have a problem with), then please return.
    Message was edited by: pziecina
    If there is anything you do not understand, or require help with please reply to the original post, but as David Powers says any abusive language will prevent me (and others), from replying (I did not see the previous moderated post).
    PZ

  • Urgently!!!I can't debug the xml_xslt_content EJB sample in the examplesWebApp !!

    I can't debug the xml_xslt_content EJB sample in the examplesWebApp !!
    start the Example Server
    http://localhost:7001/console
    among the deployed EJB ,the xml_xslt_content EJB how to run
    Is the related jsp page in \bea\wlserver6.0\samples\examples\xml\xslt ?????
    in the
    \bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\web.xml
    there are
    <taglib-location>
    /WEB-INF/lib/xmlx-tags.jar
    </taglib-location>
    </taglib>
    in line471
    but i did not find the xmlx-tags.jar
    in the \bea\wlserver6.0
    who can help me ??????????

    As this is your 3rd post on this subject, Please tell us what the problem is, I did reply to both your 1st and 2nd post, and whilst I agree that my 1st post did not give an adequate reply (I misunderstood the problem), I think my second reply was adequate and I did offer to help further if you had problems, (please remember that I have to work as well as trying to help other users on the forum).
    My 2nd reply was as follows:
    If you wish to use the IIS server then go to: http://www.microsoft.com/Web/
    and download the Microsoft web platform.
    This 2nd option here is best if you are using php or are a beginner -
    If you wish to use an apache server try: http://httpd.apache.org/download.cgi
    or for a fuller installation (server/mysql/php)
    http://www.wampserver.com/en/download.php
    Don't forget to get the documentation as well!
    HTH
    PZ
    Once you have one of these working (or have a problem with), then please return.
    Message was edited by: pziecina
    If there is anything you do not understand, or require help with please reply to the original post, but as David Powers says any abusive language will prevent me (and others), from replying (I did not see the previous moderated post).
    PZ

  • JSP/EJB sample-problem

    Hi,
    I'm having difficulties to get the Oracle JSP sample to wrok.
    I deployed the JSP App and also the StackDemo app and changed the envrionment variables as requested .
    But each time I try to use the DemoStack bean by submitting a 'create stack' I get the message :
    "The requested access method is not allowed for that object"
    Can anybody help me with this problem?
    Michel.

    Alex,
    I use OAS 4.0.8.1.
    I also reloaded the application after deployment.
    I used a clinet snippet that is compiled in JDevelope 3.0 and I run it from there .
    It finds THE EJB , ic reated and deployed without giving any error messages. The problem rises the moment I try to use one of the functions of the remote interface of the EJB. In these functions I try to use functionality of viewObjects that are provided by a bussines component that I generated using JDeveloper 3.0.
    The wrb log file mentions a 'null pointer exeption'.
    I think that I do something wrong when initializing the application module that wraps the business component, but I can't see what is wrong.
    This is the code I use in my EJB :
    String theAM = "EDMpackage.EDMAppModule";
    ApplicationModule root = null;
    String sessionDefName = ApplicationModule.DEFAULT_DEF_FULL_NAME;
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    try
    Context ic = new InitialContext(env);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(sessionDefName);
    root = home.create();
    catch(Exception e)
    e.printStackTrace();
    localAppMod = root.createApplicationModule( "EDMAppMod",theAM );
    This works fine , but when I try to get a ViewObject through the localAppMod, I get the error. So I think I am wrong somewhere here.
    Michel.

  • JDeveloper 2.0 EJB Samples

    I am trying to run the AcmeVideo (EJB & Servlet) sample that came
    with JDeveloper2.0. Using Oracle8i, Java Web Server and IE4.
    Followed everything in the documentation from creating the
    database up to deploying the fiels to the web server. But when I
    was running it through the browser (using
    http://<servername>/acmevideo.html) this is the error that comes
    out...
    Not Found (404)
    The file that you requested could not be found....
    Again, I followed the documentation to the smallest detail. And
    another thing couldn't find the acmevideo.html anywhere, not even
    in the compressed files.
    I would very much appreciate a reply, thanks in advance.
    null

    I am trying to run the AcmeVideo (EJB & Servlet) sample that came
    with JDeveloper2.0. Using Oracle8i, Java Web Server and IE4.
    Followed everything in the documentation from creating the
    database up to deploying the fiels to the web server. But when I
    was running it through the browser (using
    http://<servername>/acmevideo.html) this is the error that comes
    out...
    Not Found (404)
    The file that you requested could not be found....
    Again, I followed the documentation to the smallest detail. And
    another thing couldn't find the acmevideo.html anywhere, not even
    in the compressed files.
    I would very much appreciate a reply, thanks in advance.
    null

  • Problem with Oracle9iAS SOAP EJB Sample

    I have tried testing the stateless/stateful EJB soap services sample in Oracle9iAS SOAP server.
    I have changed the provider.xml. Deployed that and the service.xml and put the sample.jar in the lib directory.
    when i run the testit.bat, I get the following error :
    Ouch, the call failed:
    Fault Code = SOAP-ENV:Server
    Fault String = Error in connecting to EJB [java.lang.SecurityException]
    Can anyone help me out in this ??
    Thanks in advance,
    Chhimi

    Chhimi, could you check the providers.xml you are using. Here is mine for a local OC4J:
    <deployedProviders>
    <isd:provider xmlns:isd="http://xmlns.oracle.com/soap/2001/04/deploy/provider"
    id="stateless-ejb-provider"
    class="oracle.soap.providers.ejbprov.StatelessEJBProvider">
    <isd:option key="ContextProviderURL" value="ormi://localhost:23791" />
    <isd:option key="SecurityPrincipal" value="admin" />
    <isd:option key="FullContextFactoryName" value="com.evermind.server.rmi.RMIInitialContextFactory" />
    <isd:option key="SecurityCredential" value="welcome" />
    </isd:provider>
    </deployedProviders>
    When deploying to Oracle9iAS you will likely have to change the RMI port, hostname and password. For example,
    a default 9iAS install has EJB's listening on RMI ports 3101 - 3200. For this to hook up you need to pick a port (e.g. 3102) with the appropriate host and password and it should hang together.
    What some people do is change the ports to not be dynamic and set it to a specific port as it is with the OC4J stand-alone instance. You can check out the opmnctl command in the <Oracle9iAS_home>\opmn\bin directory to reload the opmn.xml file located in the <Oracle9iAS_home>\opmn\conf directory to do this or more safely use Enterprise Manager to change the RMI ports for the OC4J instance you are using.
    Hope this helps. I have been offline for nearly a week but should be checking again regularly if you have problems.
    Mike.

  • BC4J + XSQL, XSQL+EJB Sample Code

    I'm new to the XML/Java thing. Does anyone have sample code which uses BC4J or EJB components with XSQL (or other XML template files)?

    Sharon,
    Take a look at the XML wireless sample on this site.
    - Select Products from the menu on the left of this page
    - Select the JDeveloper link
    - Select Sample Code (at the top of the page)
    - Select the XML Wireless Sample link
    Blaise
    null

  • Oracel9iAS EJB samples on Win NT server.

    Hi,
    I am able to run deploy purchase entity bean using makeit batch file provided with it. While runnig using runit, it gives error
    Running client
    PO price $72.0
    Exception in thread "main" java.lang.ClassCastException: oracle.aurora.ejb.Auror
    aEntityHandle
    at Client.main(client.java:81)
    From above, it is clear that application is able to connect to RDBMS. Only container is failing at getByPrimaryCode().
    To solve this I have even created purchasePK class so that there is no cast problem but this also didn't solved the problem.
    Thanks.

    This is a bug in VisiBroker skeleton generator. And it shows only when JDK 1.3 HotSpot JVM is used when deploying the bean.
    You can insert "-classic" after "java" in %ORACLE_HOME%\bin\deployejb.bat. The line should look like:
    java -classic -classpath ....

  • WL 8.1 EJB sample tutorial troubles..

    Hello Everyone,
    I am just learning WL 8.1 and decided to run through the included tutorials. I have followed the WebLogic tutorial instructions to the detail and tried and tried and tried to build and deploy part 1 of the EJBProjectTutorial/myEJBProject/examples.ejb20.relationships.bands
    My project builds but I am getting a runtime error. I placed the local-ejb-ref tag in the weblogic.xml and double checked the link name w/no luck. What am I missing? If anyone can point me in the right direction, I really would appreciate it.
    Thanks in advance!
    I get the following exceptions in my WebLogic Server Console.
    weblogic.management.DeploymentException:
    Exception:weblogic.management.ApplicationException: activate failed for WebAppStepOne_Standard
    Module: WebAppStepOne_Standard Error: weblogic.management.DeploymentException: Could not setup environment - with nested exception:
    [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'MyEJBProject.jar#Music' declared in the ejb-ref or ejb-local-ref 'ejb/MusicLink' in the application module 'WebAppStepOne_Standard' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.]
    weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'MyEJBProject.jar#Music' declared in the ejb-ref or ejb-local-ref 'ejb/MusicLink' in the application module 'WebAppStepOne_Standard' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
    at weblogic.deployment.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:657)
    at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:466)
    at weblogic.servlet.internal.CompEnv.init(CompEnv.java:123)
    at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:5616)
    at weblogic.servlet.internal.WebAppServletContext.setActive(WebAppServletContext.java:5588)
    at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:841)
    at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    --------------- nested within: ------------------
    weblogic.management.DeploymentException: Could not setup environment - with nested exception:
    [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'MyEJBProject.jar#Music' declared in the ejb-ref or ejb-local-ref 'ejb/MusicLink' in the application module 'WebAppStepOne_Standard' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.]
    at weblogic.servlet.internal.CompEnv.init(CompEnv.java:133)
    at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:5616)
    at weblogic.servlet.internal.WebAppServletContext.setActive(WebAppServletContext.java:5588)
    at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:841)
    at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2517)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    No Exception Messages

    Hi Ram,
    WebAppStepOne_Standard
    web.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd" >
    <!-- The web.xml file is a configuration file used to control the behavior of WebLogic server.
    In most cases, you will not need to modify this file. For more information on web.xml, please
    consult the Web.xml Deployment Descriptor Elements chapter of the "Developing WebLogic Server
    Applications" documentation on edocs.bea.com. -->
    <web-app>
    <display-name>Workshop Application</display-name>
    <filter>
    <filter-name>PageFlowJspFilter</filter-name>
    <filter-class>com.bea.wlw.netui.pageflow.PageFlowJspFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>PageFlowJspFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <listener>
    <listener-class>
    com.bea.wlw.runtime.core.servlet.WebappContextListener
    </listener-class>
    </listener>
    <ejb-local-ref>
    <ejb-ref-name>ejb/BandLink</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
    <local>examples.ejb20.relationships.bands.Music</local>
    <ejb-link>MyEJBProject.jar#Music</ejb-link>
    </ejb-local-ref>
    <!-- Standard Action Servlet Configuration (with debugging) -->
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>com.bea.wlw.netui.pageflow.PageFlowActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>config/-global</param-name>
    <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config--global.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Struts Action Servlet Mappings -->
    <!-- Note that because Struts takes the last mapping here as the extension to add to
    actions posted from forms, we must have *.do come after *.jpf. -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.jpf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <error-page>
    <error-code>500</error-code>
    <location>/error.jsp</location>
    </error-page>
    <!-- Define the NetUI tag library TLDs -->
    <taglib>
    <taglib-uri>netui-tags-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/netui-tags-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>netui-tags-databinding.tld</taglib-uri>
    <taglib-location>/WEB-INF/netui-tags-databinding.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>netui-tags-template.tld</taglib-uri>
    <taglib-location>/WEB-INF/netui-tags-template.tld</taglib-location>
    </taglib>
    </web-app>
    Thanks,
    S

  • EJB sample links

    hi,i have practiced upto session beans with tiny programs,but i dont have any module knowledge,can u give any links in order to practice sample applications using weblogic8.1.....

    hi,i have practiced upto session beans with tiny programs,but i dont have any module knowledge,can u give any links in order to practice sample applications using weblogic8.1.....

  • EJB Sample Question

    Hi there,
    My questions here referred to WebLogic server 6.1 examples.ejb20.basic.statelessSession
    and I m yet not attended any J2EE classes yet.
    1. What does the method ejbPassivate() and setSessionContext(SessionContext ctx)
    invoked inside TraderBean class does? Since I can't find any codes called the setSessionContext
    that needs a input parameter?
    2. Under ejbCreate(), the line statd Integer tl = (Integer) ic.lookup("java:/comp/env/tradeLimit");,
    where do i get java:/comp/env/tradeLimit? Is that stated inside the ejb-jar.xml under
    the entry <env-entry>?
    3. Can explain what are the steps invoked inside the build.xml after compiling the
    class files?
    4. What does the weblogic-ejb-jar.xml does?
    Thanks
    Neo

    For 1 & 2 You need to read a EJB Book. There is a free one available at
    www.theserverside.com.
    for 4, look at
    http://e-docs.bea.com/wls/docs61/ejb/index.html
    "Neo Gigs" <[email protected]> wrote in message
    news:3cbe4ab1$[email protected]..
    >
    Hi there,
    My questions here referred to WebLogic server 6.1examples.ejb20.basic.statelessSession
    and I m yet not attended any J2EE classes yet.
    1. What does the method ejbPassivate() andsetSessionContext(SessionContext ctx)
    invoked inside TraderBean class does? Since I can't find any codes calledthe setSessionContext
    that needs a input parameter?
    2. Under ejbCreate(), the line statd Integer tl = (Integer)ic.lookup("java:/comp/env/tradeLimit");,
    where do i get java:/comp/env/tradeLimit? Is that stated inside theejb-jar.xml under
    the entry <env-entry>?
    3. Can explain what are the steps invoked inside the build.xml aftercompiling the
    class files?
    4. What does the weblogic-ejb-jar.xml does?
    Thanks
    Neo

  • Deployed EJB Not Bound

    I deplyed a simple EJB on S17AS. The server.log tells me it is deployed successful.
    CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1017ca1
    CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@9d5793
    LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
    The relevant simpleEjb.jar_verified.txt is as follows
         Test Name : tests.ejb.ias.ASEjbJndiName
         Test Assertion :
         Test Description : PASSED [AS-EJB ejb] : jndi-name is simpleHome
    However, the server log did not indicate the EJB is bound even if I set the log level to finest.
    Therefore when I tried to access it, I get the following error
    Exception in thread "main" javax.naming.NameNotFoundException: No object bound f
    or java:comp/env/ejb/simpleHome
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
    ava:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at HelloClient.main(HelloClient.java:61)
    The client code is as follows
    String JNDIName = "java:comp/env/ejb/simpleHome";
    myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(
                   initContext.lookup(JNDIName), GreeterDBHome.class);
    The sun-ejb-jar.xml is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    -->
    <!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN' 'http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd'>
    <sun-ejb-jar>
    <enterprise-beans>
    <name>simpleEjb.jar</name>
    <ejb>
    <ejb-name>simpleEJB</ejb-name>
    <jndi-name>simpleHome</jndi-name>
    <is-read-only-bean>false</is-read-only-bean>
                   <bean-pool>
                        <steady-pool-size>2</steady-pool-size>
                        <resize-quantity>5</resize-quantity>
                        <max-pool-size>20</max-pool-size>
                        <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
                   </bean-pool>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    I tried to use lookup for both "java:comp/env/ejb/simpleHome" and "java:comp/env/simpleHome". None succeed.
    Does anyone know why the ejb is deployed successful but not bound?
    Sha

    Hi, Parsuram,
    I did restart the server and the error is the same.
    Here is the sample code. I did not change them. Only the names in deployment descriptors are modified.
    Below is the info.
    *************************Remote Interface
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    * Remote interface for the GreeterDBEJB. The remote interface defines all possible
    * business methods for the bean. These are the methods going to be invoked remotely
    * by the servlets, once they have a reference to the remote interface.
    * Servlets generally take the help of JNDI to lookup the bean's home interface and
    * then use the home interface to obtain references to the bean's remote interface.
    public interface GreeterDB extends javax.ejb.EJBObject {
    * Returns the greeting String such as "Good morning, John"
         * @return the greeting String
    public String getGreeting() throws java.rmi.RemoteException;
    *************************Home Interface
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    * Home interface for the GreeterDB EJB. Clients generally use home interface
    * to obtain references to the bean's remote interface.
    public interface GreeterDBHome extends javax.ejb.EJBHome {
    * Gets a reference to the remote interface to the GreeterDBBean.
         * @exception throws CreateException and RemoteException.
    public GreeterDB create() throws java.rmi.RemoteException, javax.ejb.CreateException;
    *************************Bean Class
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    import java.util.*;
    import java.io.*;
    * A simple stateless session bean which generates the greeting string for jdbc-simple
    * application. This bean implements the business method as declared by the remote interface.
    public class GreeterDBBean implements javax.ejb.SessionBean {
    private javax.ejb.SessionContext m_ctx = null;
    * Sets the session context. Required by EJB spec.
         * @param ctx A SessionContext object.
    public void setSessionContext(javax.ejb.SessionContext ctx) {
    m_ctx = ctx;
    * Creates a bean. Required by EJB spec.
    public void ejbCreate() {
    System.out.println("ejbCreate() on obj " + this);
    * Removes a bean. Required by EJB spec.
    public void ejbRemove() {
    System.out.println("ejbRemove() on obj " + this);
    * Loads the state of the bean from secondary storage. Required by EJB spec.
    public void ejbActivate() {
    System.out.println("ejbActivate() on obj " + this);
    * Keeps the state of the bean to secondary storage. Required by EJB spec.
    public void ejbPassivate() {
    System.out.println("ejbPassivate() on obj " + this);
    * Required by EJB spec.
    public void GreeterDBBean() {
    * Returns the Greeting String based on the time
    * @return the Greeting String.
    public String getGreeting() throws java.rmi.RemoteException {
    System.out.println("GreeterDB EJB is determining message...");
    String message = null;
    Calendar calendar = new GregorianCalendar();
    int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
    if(currentHour < 12) message = "morning";
    else {
    if( (currentHour >= 12) &&
    (calendar.get(Calendar.HOUR_OF_DAY) < 18)) message = "afternoon";
    else message = "evening";
    System.out.println("- Message determined successfully");
    return message;
    ************************ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    -->
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <display-name>simple</display-name>
    <ejb-name>simpleEJB</ejb-name>
    <home>samples.jdbc.simple.ejb.GreeterDBHome</home>
    <remote>samples.jdbc.simple.ejb.GreeterDB</remote>
    <ejb-class>samples.jdbc.simple.ejb.GreeterDBBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    ************************sun-ejb-jar.xml
    <sun-ejb-jar>
    <enterprise-beans>
    <name>simpleEjb.jar</name>
    <ejb>
    <ejb-name>simpleEJB</ejb-name>
    <jndi-name>ejb/simpleHome</jndi-name>
    <is-read-only-bean>false</is-read-only-bean>
                   <bean-pool>
                        <steady-pool-size>2</steady-pool-size>
                        <resize-quantity>5</resize-quantity>
                        <max-pool-size>20</max-pool-size>
                        <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
                   </bean-pool>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    ************************Assemble Info
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar cvf simpleEjb.jar *
    added manifest
    ignoring entry META-INF/
    adding: META-INF/ejb-jar.xml(in = 710) (out= 350)(deflated 50%)
    adding: META-INF/sun-ejb-jar.xml(in = 803) (out= 424)(deflated 47%)
    adding: samples/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/ejb/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/ejb/GreeterDB.class(in = 210) (out= 168)(deflated 20%)
    adding: samples/jdbc/simple/ejb/GreeterDBBean.class(in = 1441) (out= 734)(deflated 49%)
    adding: samples/jdbc/simple/ejb/GreeterDBHome.class(in = 257) (out= 177)(deflated 31%)
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar tf simpleEJB.jar
    META-INF/
    META-INF/MANIFEST.MF
    META-INF/ejb-jar.xml
    META-INF/sun-ejb-jar.xml
    samples/
    samples/jdbc/
    samples/jdbc/simple/
    samples/jdbc/simple/ejb/
    samples/jdbc/simple/ejb/GreeterDB.class
    samples/jdbc/simple/ejb/GreeterDBBean.class
    samples/jdbc/simple/ejb/GreeterDBHome.class
    ******************************** Deployment Info
    server1: Applications: EJB Modules: simpleEjb
    EJB Module Name: simpleEjb
    Location: C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1
    ******************************** simplEJB.jar_verified.txt
    STATIC VERIFICATION RESULTS
         NUMBER OF FAILURES/WARNINGS/ERRORS
         # of Failures : 0
    # of Warnings : 1
         # of Errors : 0
         Test Name : tests.ejb.ias.ASEjbJndiName
         Test Assertion :
         Test Description : PASSED [AS-EJB ejb] : jndi-name is ejb/simpleHome
         WARNINGS :
         Test Name : tests.ejb.businessmethod.BusinessMethodException
         Test Assertion : Enterprise bean business method throws RemoteException test
         Test Description : For [ module_simpleEjb#simpleEjb#simpleEJB ]
    For EJB Class [ samples.jdbc.simple.ejb.GreeterDBBean ] business method [ getGreeting ]
    Error: Compatibility Note: A public business method [ getGreeting ] was found, but EJB 1.0 allowed the business methods to throw the java.rmi.RemoteException to indicate a non-application exception. This practice is deprecated in EJB 1.1 ---an EJB 1.1 compliant enterprise bean should throw the javax.ejb.EJBException or another RuntimeException to indicate non-application exceptions to the Container.
    *********************** server log (no binding info)
    [05/Jan/2003:17:07:19] FINE ( 1760): [EJBClassPathUtils] EJB Class Path for [simpleEjb] is ...
    [C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1, C:\Sun\AppServer7\domains\domain1\server1\generated\ejb\j2ee-modules\simpleEjb]
    [05/Jan/2003:17:07:20] FINE ( 1760): Loading StatelessSessionContainer...
    [05/Jan/2003:17:07:20] FINE ( 1760): [BaseContainer] Registered EJB [simpleEJB] with MBeanServer under name [ias:instance-name=server1,mclass=stateless-session-bean,name=simpleEJB,root=root,standalone-ejb-module=simpleEjb,type=monitor]
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_RemoteHomeImpl_Tie", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_EJBObjectImpl_Tie", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDB_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): [Pool-ejb/simpleHome]: Added PoolResizeTimerTask...
    [05/Jan/2003:17:07:20] FINE ( 1760): Created container with uinque id: 68275827784351744
    [05/Jan/2003:17:07:20] FINE ( 1760): Application deployment successful : com.sun.ejb.containers.StatelessSessionContainer@1083717
    [05/Jan/2003:17:07:20] INFO ( 1760): LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
    [05/Jan/2003:17:07:22] FINE ( 1760): Started 48 request processing threads
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3274: successful server startup
    [05/Jan/2003:17:07:22] FINE ( 1760): The server is now ready to process requests
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@10613aa
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1f52460
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE5053: Application onReady complete.
    *********************** Client class
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.util.Properties;
    import java.util.Hashtable;
    import javax.ejb.*;
    import java.sql.*;
    import javax.sql.*;
    import samples.jdbc.simple.ejb.*;
    public class HelloClient {
         public static void main(String[] args) throws Exception {
    javax.ejb.Handle beanHandle;
    GreeterDBHome myGreeterDBHome;
    GreeterDB myGreeterDBRemote;
    InitialContext initContext = null;
    Hashtable env = new java.util.Hashtable(1);
    initContext = getContextInfo();
    String JNDIName = "java:comp/env/ejb/simpleHome";
    System.out.println("- Looking up: " + JNDIName);
    myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(initContext.lookup(JNDIName), GreeterDBHome.class);
    myGreeterDBRemote = myGreeterDBHome.create();
              String theMessage = myGreeterDBRemote.getGreeting();
    myGreeterDBRemote.remove();
         public static InitialContext getContextInfo() {
         InitialContext ctx = null;
         String url = "iiop://1st:3700";
         String fac = "com.sun.enterprise.naming.SerialInitContextFactory";
    try {
         Properties props = new Properties();
         props.put(Context.INITIAL_CONTEXT_FACTORY, fac);
         props.put(Context.PROVIDER_URL, url);
              ctx = new InitialContext(props);
         catch (NamingException ne){
    System.out.println("We were unable to get a connection to " +
    " the application server at " + url);
    ne.printStackTrace();
    return ctx;
    *********************** Running Client from command line
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>java HelloClient
    - Looking up: java:comp/env/ejb/simpleHome
    Exception in thread "main" javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/simpleHome
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at HelloClient.main(HelloClient.java:34)

  • NullPointerException during the deployment of ejb

    From JDeveloper, I rebuild the twoEjbHotelSample without any problem, but the deploying of HotelEjb bean caused the following exception. Any idea? Btw, I can depoly the ejb sample from javavm/demo/ejb without any problem. Thanks.
    java.lang.NullPointerException
    java.lang.Object java.util.Hashtable.put(java.lang.Object, java.lang.Object)
    void oracle.aurora.server.tools.sess_iiop.WindowsFSContext.<init>(java.util.Hashtable)
    void oracle.aurora.server.tools.sess_iiop.LocalWorkingDirectory.<init>(java.util.Properties)
    void oracle.aurora.server.tools.sess_iiop.ToolImpl.initializeLocal()
    java.lang.String[] oracle.aurora.server.tools.sess_iiop.ToolImpl.parseStdArgs(java.lang.String[])
    void oracle.aurora.server.tools.sess_iiop.ToolImpl.invoke(java.lang.String[], java.io.InputStream, java.io.PrintStream, java.io.PrintStream)
    void oracle.jdeveloper.wizard.deployment.EJBDeployMonitor.run()
    void oracle.jdeveloper.wizard.common.ProgressDialog.run()
    void java.lang.Thread.run()
    null

    Hi,
    the WebCenter forum is at: WebCenter Portal
    Frank

  • Deployment Error in EJB

    I have downloaded Hotel Reservation System using EJB sample and trying deploy OneEJBHotel-Web.deploy to the Application Server connection. Connection looks fine. I get the following error in deployment:
    **** The current project does not contain an EJB Module to deploy.
    #### Deployment incomplete. ####
    Am I missing any setups steps? I have extracted files from OneEJBHotel.jar and directory structure is:
    D:\oracle\samples\EJB\OneEJBHotel\...
    Appreciate your help.

    Apparently I found that the new release of JDeveloper 9.0.3.1 did at least try to deploy the EJB in this sample. The previous version kept failing to deploy. Now, I am getting other deployment error. Seems like the deployment doesn't recognise my site. The standalone OC4J has been running successfully on port 8888, the standalone connection in JDeveloper is fine also. I can even hit on 8888 port from other machines. But deployment gives the following messages. Am I missing anything here? Appreciate all the help.
    ---- Deployment started. ---- Feb 28, 2003 3:45:02 PM
    Wrote EJB JAR file to C:\oracle\JDeveloper_Sample\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel.jar
    Wrote WAR file to C:\oracle\JDeveloper_Sample\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel-Web.war
    Wrote EAR file to C:\oracle\JDeveloper_Sample\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel-Web.ear
    Invoking OC4J admin tool...
    C:\oracle\JDev9031\jdk\jre\bin\javaw.exe -jar C:\oracle\JDev9031\j2ee\home\admin.jar ormi://W2K038825/ admin **** -deploy -file C:\oracle\JDeveloper_Sample\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel-Web.ear -deploymentName OneEJBHotel
    Auto-unpacking C:\oracle\JDev9031\j2ee\home\applications\OneEJBHotel-Web.ear... done.
    Auto-unpacking C:\oracle\JDev9031\j2ee\home\applications\OneEJBHotel-Web\OneEJBHotel-Web.war... done.
    Auto-deploying OneEJBHotel (Assembly had been updated)...
    Exit status of OC4J admin tool (-deploy): 0
    C:\oracle\JDev9031\jdk\jre\bin\javaw.exe -jar C:\oracle\JDev9031\j2ee\home\admin.jar ormi://W2K038825/ admin **** -bindWebApp OneEJBHotel OneEJBHotel-Web http://W2K038825:8888/ /OneEJBHotel
    default-web-site (full name: file:/C:/oracle/JDev9031/j2ee/home/config/default-web-site.xml)
    http-web-site (full name: file:/C:/oracle/JDev9031/j2ee/home/config/http-web-site.xml)
    Unknown site: http://W2K038825:8888/
    Active sites are:
    Exit status of OC4J admin tool (-bindWebApp): 1
    Use the following context root(s) to test your web application(s):
    http://W2K038825:????/OneEJBHotel
    Note: JDeveloper was unable to determine the HTTP port number of the remote server for the above URL(s).
    Elapsed time for deployment: 38 seconds
    ---- Deployment finished. ---- Feb 28, 2003 3:45:40 PM

Maybe you are looking for

  • Crystal Report issue : Error in file.. .rpt . Error in formula

    Hi , I recently migrated a report from production to test environemnt and it throws me the following error: Error in File C:\DOCUME1\oe_user\LOCALS1\Temp\packing instructions {4058873B-9756-4052-B479-EBD2D0A08E7D}.rpt:Error in formula  <Object_Visibi

  • Finding the Serial Number for AppleCare Protection Plan

    I am trying to register my Laptop to the Protection Plan, but I can`t find the serial number. When I do, do I type everything? I thought I found it, but they say its not valid. Can someone please give me an example to me? Thank you very much!!

  • Output varies for group by  & where Clause

    Below are the two statements which i am comapring . 1) for this i get a output as it displays 0 because there are no rows matched to this criteria . select count(No) from T1 where No = 3" 1 0 1 record(s) selected. 2) Same way i am looking to get outp

  • Miro with Delivery note

    hi experts, I made Miro with respect to delivery note my query is that is it possible to miro should not create with that previous delivery note number which is given in migo ? how to achieve this? Regards ragini

  • MAB/802.1x and Alkatel IP Phones

    Hi All We have a distributed deployment where Alkatel ip-touch phones are authentictaed via MAB. Alkatel ip touch phones has 802.1x enabled by default and the phone tries eapol first and then switch authenticates via MAB which is fine. Once authentic