My first bean not working... is it classpath?

I am doing my first Javabean ever and it is a very basic one. I have uploaded the bean to a server but it is not running. I am pretty sure that the code is right. My guess is something about classpath but I am not sure. Please read this and let me know if I making a bean in right way???
1- In the first line in my java file (myBean.java) I write package user;
2- I put myBean.java in C:\Program Files\Java\jdk1.6.0_11\bin
3- From the console I run javac myBean.java and get BeanClass.class
4- I upload myBean.class to the server in directory WEB-INF\classes (I have already asked the web hotel and it should be there)
5- I run the file and get a org.apache.jasper.JasperException
Am I compiling in the right place in the right way??? Is it something with the classpath???
Thanks!!!

I am going to be straight and to the point with you. I would take a step back and start at the basics again because you seem horribly confused about several things, one of which is the basics of the basics (how to compile java classes).
You shouldn't even be thinking about web development before you have a firm grasp on Java itself. Have you gone through the introductory tutorial?
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
That should at least explain to you how to use the tools properly. When you have a little knowledge of how Java ticks and you can write command line programs with it, I would first study how java web applications work. Read about servlets and JSPs and how to deploy a web application properly.

Similar Messages

  • Ichat - getting started for first time NOT Working ..please help

    I opened the Ichat application for th every first time today. When I open the app a box pops up and asks you to enter your user name and password and with which type of account you want to log in with, etc. First, I chose my mobile me account ( I also have a mac.com account and teh same thing I am going to describe happens with it as well for it is not an apple id dependent problem). I do so and click continue. The next screen comes up in the box and it is titled " encrypted ". Then in the box it says you are now ready to use ichat" . At the bottom of the box it says click done to begin using ichat.
    Thus, is my problem. There is no "done" option to click on. The only button options to click on are: "learn more" , "go back" or "continue" . If I click "continue" nothing happens and I cannot do anything or begin using ichat. If I like "learn more" nothing happes at all - thus, the same result as clicking "continue". If I click back it will goto the previous screens but nothing changes.
    Has anyone experienced this before? It seems strange and odd for an apple software to be so deleterious. How do i fix it so I can use iChat?
    Any help is greatly appreciated. Thank you in advance. Jenna

    Hi
    Welcome to the    Discussions
    Unfortunately although very rare some people do find that iChat does this.
    Do this first.
    Open your Home Folder (Little House icon)
    Go to the Preferences Folder within and then find all the com.apple.iChat(xxx).plist items and delete them.
    Try iChat again.
    You should see several Start Up Screens.
    1) A Welcome Screen.
    2) A Valid AIM name (Includes options for MobileMe and @mac.com as well as AIM) plus confirming your Name (Your name maybe Prefilled from the Address Book)
    3) the Bonjour Enable (or not) screen.
    4) The Jabber option (Includes GoogleTalk) This Screen includes options to change Server Names and Ports under the text fields for the Jabber ID.
    5) A Video Preview pane. (You can use this to take a Snapshot for your Buddy Pic)
    6) a Details of Accounts you have set up screen.
    7) the Done Screen.
    More on this with Pictures here
    If this does not work we may have to get you to Reinstall iChat.
    How much work this entails depends how far your OS has been updated above the Install Disk Level.
    Could you tell me what OS version the Install Disk is (What came on your Computer when new) ?
    And what OS level you are currently using ?
    7:23 PM Friday; December 3, 2010
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • Bean not working in 9i ids

    hello,
    i have a prograss bar bean class and i saved this bean in
    /form90/java and set the property of beans item " implement class" with this bean name but not working or display.
    urgent help.
    thanks

    Syed,
    does it show in the demos ? It's unusual that something doesn't show without an error message. Its hard to guess what the prolem is, but since you don't get Java errors in the Jinitiator panel, the Jar file seems to be there or the Bean conatiner doesn't reference it in his implementation property. However, even if you have a misspelled reference of the Java class in teh implementation class property, the Jinitiator console would show a file not found error. Java Beans are initiated when the canvas that they are placed on shows. This means that setting Bean properties before initialization does not have an effect (as far as I know even this raises an error).
    Which Jintiator version do you have? I am having 1.3.1.13 and experience some problem with the bean demos. It used to work with 1.3.1.9, which is the recommended version. Maybe your problem is similar.
    Fran

  • Motion menu first play not working

    No matter what I do the first play motion menu either stops at the end or goes on to play a timeline on two different hardware players and in VLC (last two versions). The only player where it properly loops is PowerDVD 9 (which has its own problems with linked timelines). This is not a hardware problem. This is an Encore problem probably being caused by an inefficient layout of files on the disk.  There is a possibility (slight) that this is being caused by removing assets and "saving as" to create two DVD5's from a DVD9. Despite the deletion of assets the "saved as" project files are about the same size as the DVD9 project. I wish Encore ws like Pr in that it could rationalize a project by importing it into a new project. Then again with all the problems people report with motion menus it may not have anything to do with the work flow.
    Don't see any easy work around here except building the two projects up from scratch unless someone has a idea of what to try.
    I wish this software would work better. It really is the worst of the Production Suite (and I use Pr as my everyday editor)

    Sometimes the end action will get locked into an asset if you build the project. Changing the end action of the menu after you have gone through the build process may not work. You might have to delete the menu from the project, re-import it, relink the assets and buttons, and it should work.
    You are correct, Encore is not as polished of a program as Photoshop, but at least there are usually workarounds so you can successfully build a disc that works as it should.

  • Move to first page not working

    Am using DW CS3 and for some weird reason the "move to first
    page" under the recordset paging is NOT working. It doesn't do
    anything.
    I have the right text highlighted, the right recordset chosen
    and nothing.
    All the other paging options work just fine. The move to next
    page, the move to previous page and the move to last page ALL work.
    The first page option doesn't, no code is inserted.
    Should be putting in a link for that anchor text to move to
    the first record, but isn't.
    Any ideas? Anyone else with this?
    Thanks,
    Robert

    I f you are publishing to .mac, then this is often a caching issue, either at the server end or at your end, the nav bars seem to get messed up and time tends to heal (not what you wanted to hear).
    You could try clearing the cache in you browser, in Safari, go to Safari > Empty Cache.., also putting a ? at the end of the url in the address bar and then refreshing the page often does some good. Often you need to do both, more than once!
    Will
    1GHz G4, 15" PowerBook, Airport Network, 1G iPod Mini   Mac OS X (10.4.6)   www.willg4pb.com for iWeb tips

  • Bean not working in jsp

    OK, maybe I'm oversharing, but I want to be thorough. Note I asked this question a different way using very different code.
    Here's my jsp file - myq.jsp
    <%@ page language="java" import="java.util.*,com.serco.inquire.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="inq" tagdir="/WEB-INF/tags" %>
    <inq:displayCollection>
    <jsp:attribute name="mgr">Chris Novish</jsp:attribute>
    </inq:displayCollection>Here's displayCollection.tag used by that jsp:
    <%@ tag body-content="scriptless" import="com.serco.inquire.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ attribute name="mgr" required="true" %>
    <jsp:useBean id="irc" scope="session" class="com.serco.inquire.IrCollection">
      <jsp:setProperty name="irc" property="mgrid" value="${mgr}" />
    </jsp:useBean>
    ${irc.size} | ${irc.mgrid}Here's the java class IrCollection (used as a bean in the tag):
    package com.serco.inquire;
    import java.sql.*;
    import java.util.*;
    public class IrCollection {
         public ArrayList iRecords = new ArrayList<InquireRecord>();
         public int size;
         public String mgrid;
         public irCollection() {
              super();
         public void populateCollection() {
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String filename = "inquire.mdb";
                   String database = "jdbc:odbc:Driver={Microsof Access Driver (*.mdb)};DBQ=";
                   database+= filename.trim() + ";DriverID=22;READONLY=true}";
                   Connection con = DriverManager.getConnection( database ,"","");
                   Statement s = con.createStatement();
                   s.execute ("SELECT * FROM inquiries WHERE manager = '" + this.mgrid + "'");
                   ResultSet rs = s.getResultSet();
                   int cur;
                   while (rs.next()) {
                        cur = rs.getRow()-1;
                        InquireRecord localIR = new InquireRecord();
                        int curID = rs.getInt("ID");
                        localIR.setID(curID);
                        String cursub = rs.getString("submitter");
                        localIR.setSubmitter(cursub);
                        this.iRecords.add(cur, localIR);
                   con.close();
                   this.size = iRecords.size();
              catch (Throwable e) {
                   System.out.println(e);
         public int getSize () {
              return this.size;
         public void setMgrid(String datum) {
              this.mgrid = datum;
              this.populateCollection();
         public String getMgrid() {
              return this.mgrid;
    }and here's the InquireRecord java class used by IrCollection:
    package com.serco.inquire;
    public class InquireRecord {
         private int ID;
         private String submitter;
         public InquireRecord() {
              super();
         public InquireRecord(String asubmitter) {
              this.submitter = asubmitter;
         public int getID(){
              return this.ID;
         public void setID(int datum) {
              this.ID = datum;
         public String getSubmitter() {
              return this.submitter;
         public void setSubmitter(String datum) {
              this.submitter = datum;
    }The JSP does this: set the mgr variable, which is passes to the tag, the tag then creates an instance of IrCollection using that mgr variable. (Yes, putting that populateCollection() method call in the setMgrid() method is probably Bad Practice, but it works, usually). The IrCollection objects builds an ArrayList of InquireCollection objects from an Access database. It then sets it's size property based on how many InquireCollection instances it put into the ArrayList. Once that's all done, the tag spits out 2 things: The size property and the mgrid property.
    When I view the JSP, it gives me 0 for the size and Chris Novish for the mgrid.
    I think this could be one of the following:
    *Not finding any matching records of the database
    *Not actually executing the populateCollection() method
    *some how forgetting the information it put into that ArrayList?
    I"m sure there's another possibility, but I don't know.
    Here's what gets me. Here's a test class I made called TestCollection:
    {code}package com.serco.inquire;
    import java.util.*;
    import java.text.*;
    public class TestCollection {
         public static void main(String[] args) {
              IrCollection myCollection = new IrCollection();
              myCollection.setMgrid("Chris Novish");
              System.out.println(myCollection.getSize());
              System.out.println(myCollection.getMgrid());
    }{code}
    if I run that I get a size of 4 and a mgrid of Chris Novish.
    Same data in, and it works as expected.
    So... why won't JSP do it?

    You have defined a session scope for that bean. You have to make sure that the bean is instantiated by this jsp and not earlier. If the bean is located in the session because it was set earlier, then the body tags within useBean are not evaluated.
    Look here - http://java.sun.com/products/jsp/tags/syntaxref.fm14.html#8865
    An easy way to test it would be to change the scope of the bean to request.
    ram.

  • Payload Swap bean not working

    Hi All,
    We are working on PI 7.11. We are trying to retrieve the attachments from the mails and convert them into files. We have enabled Keep Attachments in sender mail adapter. For swapping the payload we used payload swap bean. We referred the below blog
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    We are just trying with XML attachments.
    The problem now is the payloads are not swapping. The file contains only the body of the mail not the attachment. I dont know what I'm missing. Please advice
    Regards,
    Malini

    Hi abhishek,
    Please find below the config done in adapters
    1     localejbs/AF_Modules/PayloadSwapBean                          Local Enterprise Bean     1
    2     sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail
    1     swap.keyName     Content-Description
    1     swap.keyName     Content-Disposition
    1     swap.keyValue     MailAttachment-1
    1     swap.keyValue     attachment;filename="MailAttachment-1.xml"
    Regards,
    Malini

  • Java Bean Not Working

    i am installing 10.1.2 on redhat3 update 7
    When i run my OCIConnectionPool bean or any bean following error occurs
    [oracle@appserver beansource]$ java OCIConnectionPool
    libgcj-java-placeholder.sh
    This script is a placeholder for the /usr/bin/java
    master link required by jpackage.org conventions. libgcj's
    rmiregistry, rmic and jar tools are now slave symlinks to these
    masters, and are managed by the alternatives(8) system.
    This change was necessary because the rmiregistry, rmic and jar tools
    installed by previous versions of libgcj conflicted with symlinks
    installed by jpackage.org JVM packages.
    This script was designed to be overridden by the supported RHEL3 JRE
    packages, java-1.4.2-bea and java-1.4.2-ibm. It is installed as an
    alternative symlink as /usr/bin/java. It will override a third-party
    (non-RHEL3) JRE's java command if the JRE's bin directory is listed
    after /usr/bin in PATH. In that case, it is recommended that the
    third-party JRE's bin directory be listed first in PATH instead.
    Exception in thread "main" java.lang.UnsatisfiedLinkError: ocijdbc9: file not found
    at 0x00bb6ca3: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x00ba9b1e: java.lang.Error.Error(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x00bab546: java.lang.LinkageError.LinkageError(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x00bb6f76: java.lang.UnsatisfiedLinkError.UnsatisfiedLinkError(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x00b99b97: java.lang.Runtime._load(java.lang.String, boolean) (/usr/lib/./libgcj.so.3)
    at 0x00bad329: java.lang.Runtime.loadLibrary(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x00bb46f6: java.lang.System.loadLibrary(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c4fa: JvInterpMethod.run_synch_object(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00c4aad8: java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/./libgcj.so.3)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00cd1007: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x00cd0fc7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x00b7e658: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7ef64: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x00b7c474: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x00cd0e7c: ?? (??:0)
    at 0x00b90d68: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/./libgcj.so.3)
    at 0x00bfae99: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)
    at 0x00b9daec: JvThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
    at 0x00b6a82c: JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/./libgcj.so.3)
    at 0x08048930: ?? (??:0)
    at 0x006a979a: __libc_start_main (/lib/tls/libc.so.6)
    at 0x080486e1: ?? (??:0)
    Chetan

    One way is to change the "break;" line to "return true;" and remove the current "return true;" line. Then move the "return false;" line outside the catch section. It seems whatever you are doing is not throwing an exception, so whatever else it does, it always falls thru to the return true line.

  • Sender adapter request response bean not working for calling a webservice

    Hi All,
    In PI 7.31, My scenario :  SOAP sender Asynch-> PI -> HTTP Receiver Sync ->take response to call another webservice  (SOAP)
    I have configured request response bean and response one way bean in the sender adapter to make this work.
    Attached the screenshot of the module config in  the sender soap adapter. The final response from HTTP has to be used to call another webservice (not sender webservice)
    This giving an error "couldn't retrieve binding values for sender to receiver etc etc ----------"
    Has anyone configured response one way bean to call a webservice to submit? If so, please share the configuration details. And let me know if I am doing anything wrong
    thx
    mike

    Hi Michael,
    I think the adapter type is for the receiver channel looking at the documentation SAP Library - SAP Exchange Infrastructure
    Have you checked your receiver channel doesn't belong to a party?
    I havent tried this bridge with the http_aae but looks to be problematic according with Michal comment here http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/01/28/generic-pi-async-sync-bridge-configuration-for-any-adapters#comment-454463
    Regards.

  • Bean not working

    when runing my disclaimer.jsp i get this compile error can someome tell me what i'm doing wrong thanks
    init:
    deps-jar:
    compile:
    compile-jsps:
    org.apache.jasper.JasperException: The value for the useBean class attribute cci.disclaimer is invalid.
    /root/build/web/disclaimer.jsp(5,0)
    /root/nbproject/build-impl.xml:233: Java returned: 1
    BUILD FAILED (total time: 0 seconds)
    Here is where i declare my bean
    <%@page import="cci.*"%>
    <jsp:useBean id="_DisclaimerBean" class="cci.disclaimer" scope="session"/>
    <jsp:setProperty name="_DisclaimerBean" property="*"/>
    Here is where my bean gets used
    <form name="frmDisclaimer" method=POST action="" onSubmit="return false;" >
    <p>
    <textarea name="textarea" class="disclaimer"><%=(((rsDisclaimer_data = rsDisclaimer.getObject("info"))==null || rsDisclaimer.wasNull())?"":rsDisclaimer_data)%></textarea>
    </p>
    <p align="right">I do not agree
    <input name="chkdisagree" type="checkbox" class="checks" id="disagree" value="disagree">
    I Agree
    <input name="chkagree" type="checkbox" class="checks" id="agree" value=<jsp:getProperty name="_DisclaimerBean" property="agree"/>>
    <input name="conti" type="submit" id="conti" value="Continue">
    Here is my disclaimer bean
    * disclaimer.java
    * Created on February 11, 2005, 9:06 AM
    package cci;
    * @author bilfo71
    import javax.servlet.http.*;
    import cci.jsputil.*;
    public class disclaimer {
    private String session_name;
    private String agree;
    private String disagree;
    HttpServletResponse res;
    public String getSession_name() {
    return this.session_name;
    public void setSession_name(String session_name) {
    this.session_name = session_name;
    public String getAgree() {
    if(agree == ""){
    try {
    res.sendRedirect("../login.jsp");
    catch (Exception e){}
    return this.agree;
    public void setAgree(String agree) {
    this.agree = agree;
    * Getter for property disagree.
    * @return Value of property disagree.
    public String getDisagree() {
    return this.disagree;
    * Setter for property disagree.
    * @param disagree New value of property disagree.
    public void setDisagree(String disagree) {
    this.disagree = disagree;
    public disclaimer(String cokie) {
    System.out.print("Creating cookie");
    String ckdisclaimer;
    ckdisclaimer = session_name ;
    Cookie cookie1 = new Cookie("CookieDisclaimer",ckdisclaimer);
    cookie1.setPath("/");
    cookie1.setMaxAge(60*60*247*52); //
    //cookie1.setValue(newValue);
    res.addCookie(cookie1);
    try{
    res.sendRedirect("index.jsp");
    catch(Exception e){}
    //////////////////////////////////////////////////////

    Your bean disclaimer uses which response? You cannot use response object out of context! Your JSP page has to pass the current response object to your disclaimer bean class and after that bean can use it in context. So you have to pass the response as a HttpServletResponse object to disclaimer bean first.

  • @EJB annotation in JSF managed beans not working

    Hi all,
    I've been trying to get the @EJB annotation to work in a JSF manged bean without success.
    The EJB interface is extremely simple:
    package model;
    import javax.ejb.Local;
    @Local
    public interface myEJBLocal {
    String getHelloWorld();
    void setHelloWorld(String helloWorld);
    and the bean code is simply:
    package model;
    import javax.ejb.Stateless;
    @Stateless
    public class myEJBBean implements myEJBLocal {
    public String helloWorld;
    public myEJBBean() {
    setHelloWorld("Hello World from myEJBBean!");
    public String getHelloWorld() {
    return helloWorld;
    public void setHelloWorld(String helloWorld) {
    this.helloWorld = helloWorld;
    When I try to use the above EJB in a managed bean, I only get a NullPointerException when oc4j tries to instantiate my managed bean. The managed bean looks like:
    package view.backing;
    import javax.ejb.EJB;
    import model.myEJBLocal;
    import model.myEJBBean;
    public class Hello {
    @EJB
    private static myEJBLocal myBean;
    private String helloWorld;
    private String helloWorldFromBean;
    public Hello() {
    helloWorld = "Hello from view.backing.Hello!";
    helloWorldFromBean = myBean.getHelloWorld();
    public String getHelloWorld() {
    return helloWorld;
    public void setHelloWorld(String helloWorld) {
    this.helloWorld = helloWorld;
    public String getHelloWorldFromBean() {
    return helloWorldFromBean;
    Am I missing something fundamentally here? Aren't you supposed to be able to use an EJB from a JSF managed bean?
    Thanks,
    Erik

    Well, the more I research this issue, the more confused I get. There have been a couple of threads discussing this already, and in this one Debu Panda states that:
    "Support of injection in JSF managed bean is part of JSF 1.1 and OC4J 10.1.3.1 does not support JSF 1.1"
    10.1.3.1 Looking up a session EJB with DI from the Web tier
    But if you look in the release notes for Oracle Application Server 10g R3, it is explicitly stated that JSF 1.1. is supported. So I'm not sure what to believe.
    I've also tried changing the version in web.xml as described here:
    http://forums.java.net/jive/thread.jspa?threadID=2117
    but that didn't help either.
    I've filed a SR on Metalink for this, but haven't got any response yet.
    Regards,
    Erik

  • Message Driven Bean Not Working

    I'm trying to make run in WebLogic 7 an MDB,
    it seems well configured,
    in the XML descriptor ,JNDI names of the destination and the ConnectionFactory
    correspond respectively to a destination wich I have created after having created a JMS server in WBL7 and to a ConnectionFactory
    in the client ,
    I have
    -first obtain an InitialContext
    -then a look-up on the QueueConnectionFactory
    -then createQueueConnectionFactory
    -after createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    -after a look-up on the Queue
    -and then .createSender(queue)
    - and finally createTextMessage();
    to have a simple Textmessagen
    in the administration console of Weblogic
    in "monitor all MDB du .jar"
    for this MDB there 0 bean in Pool,0bean in use
    and the JmsConnectionAlive indicate False,
    it seems curious
    and then in the doc they says something about permission
    an "run as principal" wich need to be put to "receive"
    but I didn't exactly understand where
    because the doc isn't completle up-to-date
    and refer to 6,it seems
    because int the WBL7 the ACL are suppressed
    somebody could help me,
    thanks in advance

    Arman & bzoler,
    Make that three of us. I, am using Weblogic 7 (patch 2) and JBuilder Weblogic edition 7.01. I have configured my JMS topic and can successfully send and receive messages with BEA's sample topic sender and receiver (found in
    C:\bea\weblogic700\samples\server\src\examples\jms\topic, but modified for my factory and topic).
    However, when I try to deploy my MDB and send messages to the topic via their client, no messages are received by the MDB. I know it is deploying OK, because I added a println to the ejbCreate method and it is getting displayed when the server is started.
    Any ideas from anyone out there of where we may be going wrong? Is it possible that you are forced to use Security when using MDB?
    -David

  • Custom event on a bean not working!

    I'm trying to set a beans properties by using the propertyEventsDescriptors method and have the 2 following classes 'Person' and 'PersonBeanInfo'.
    When I add a bean to my program I want to be able to select the nameChange event but at the moment nothing is coming up when I choose event.
    Its the getEventSetDescriptors() in PersonBeanInfo where I think something is wrong can you have a look.
    package explicit;
    import java.beans.EventSetDescriptor;
    import java.beans.IntrospectionException;
    import java.beans.PropertyDescriptor;
    import java.beans.SimpleBeanInfo;
    public class PersonBeanInfo extends SimpleBeanInfo {
         public Person person;
         public PropertyDescriptor[] getPropertyDescriptors() {
         try {
              PropertyDescriptor nameDescriptor = new PropertyDescriptor("name", Person.class);
              PropertyDescriptor addressDescriptor = new PropertyDescriptor("home address", Person.class, "getAddress", "setAddress");
              PropertyDescriptor[] propertyDescriptorArray = {nameDescriptor, addressDescriptor};
              return propertyDescriptorArray;
         } catch (IntrospectionException e) {
              System.out.println("error");
         return null;
         @Override
         public EventSetDescriptor[] getEventSetDescriptors() {
              Class sourceClass = Person.class;
              String eventSetName = "NameChangedEvent";
              Class listenerClassType = NameChangeListener.class;
              String[] listenerMethodName = { "nameChanged" };
              String addListenerMethodName = "registerNameChangeListener";
              String removeListenerMethodName = "deregisterNameChangeListener";                              
                   try {
                        EventSetDescriptor nameChangeEventDescriptor = new EventSetDescriptor(sourceClass, eventSetName, listenerClassType, listenerMethodName, "nameChanged", addListenerMethodName, removeListenerMethodName);
                        EventSetDescriptor[] descriptors = {nameChangeEventDescriptor};
                        return descriptors;
                   } catch (IntrospectionException e) {
                        return null;
    package explicit;
    import java.util.ArrayList;
    import java.util.List;
    public class Person {
         private String name;
         private String address;
         private int age;
         private List<NameChangeListener> listeners = new ArrayList<NameChangeListener>();
         public String getAddress() {
              return address;
         public void setAddress(String address) {
              this.address = address;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
              this.fireNameChangeEvent();
         public void registerNameChangeListener(NameChangeListener listener) {
              listeners.add(listener);
         public void deregisterNameChangeListener(NameChangeListener listener) {
              listeners.remove(listener);
         private void fireNameChangeEvent() {
              NameChangeEvent event = new NameChangeEvent(this, name);
              for(NameChangeListener listener : listeners)
                   listener.nameChanged(event);
    I can't get my head around it, thanks for any help.

    Sorry yeah everything complies perfectly. getEventSetDescriptors() is not being called in any other class no. What I want to do is when I put a bean on a window I want to be able to choose the event.
    I'll post the other 2 classes I have sorry i forgot them
    package explicit;
    import java.util.EventListener;
    public interface NameChangeListener extends EventListener {
         public void nameChanged(NameChangeEvent event);
    package explicit;
    import java.util.EventObject;
    public class NameChangeEvent extends EventObject {
         private String name;
         public NameChangeEvent(Object source, String name) {
              super(source);
              this.name = name;
         public String getName() {
              return name;
    }At the moment all the code compiles perfectly but its not doing what i want it to do. Thanks

  • Dynamic Configuratin Bean Not working in PI 7.0 (SP 9)

    Hi,
    According to service pack(SP9) it should work.  We can do your requirement by using simple java code, for more information find below link.
    Same filename from a sender to receiver :: DO we really need UDF ?

    Hi Stefan,
    Thanks for your reply.
    I accept this
    >The module is also available in your system, otherwise you would have an error message when you try to use it
    But the same configuration is working in XI 3.0 & SP 19. (The PI 7.0 configuration scenario exported/imported into XI3.0 as a TPZ file). So there is no chance for "trailing spaces".
    Any further help ..................
    Thanks,
    - Gujjeti.

  • Not working JavaBean

    hi, i'm getting problems with my javaBean in TOMCAT, i'm sure i place them in the right class folder,
    do i have to set any path with the command prompt first?

    Not working JavaBeanWhat do u means? Can u post the error message?
    Right place for JavaBean class in tomcat:
    1) WEB-INF/classes
    2) WEB-INF/lib/yourjar.jar, where ur java bean is jarred into yourjar.jar
    (Some time ago, i try to put it in classes directory instead of package in jar, the java bean is not regconized by the tomcat, but i forgot the tomcat version)

Maybe you are looking for