Instance of bean

hi
how do you create instance of bean in action. i am getting error when i try to do it. can you please suggest.
thanks
jayashree

the coding is this
package com.mycompany.messages.action;
import java.io.IOException;
public class samaction
     sambean bea =  new sambean();
     public String getSuc(){
          System.out.println("hi");
          return "success";
}2 error are
cannot resolve symbol sambean and the bean declaration is
sambean.java
package com.mycompany.messages.bean;
import java.util.*;
import javax.servlet.ServletContext;
import javax.faces.context.FacesContext;
public class sambean{
     private String sam;
     public javax.faces.model.SelectItem[] getSam(){
          javax.faces.model.SelectItem[] sam = {
               new javax.faces.model.SelectItem(new Integer(1),"Peas"),
               new javax.faces.model.SelectItem(new Integer(2),"Cheese")
               return sam;
     public void setSam(String sam){
          this.sam=sam;
}this is combo.jsp
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
     <h:form id="myform">
          <h:selectOneMenu id="combo">
               <f:selectItems value="#{sambean.sam}"/>
          </h:selectOneMenu>
          <h:commandButton id="button" value="click" action="#{samaction.getSuc}"/>
     </h:form>
</f:view>this commo.jsp
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
     <h:form id="myform">
          <h:outputText id="combo" value="#{sambean.sam}"/>
     </h:form>
</f:view>the faces config is
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
     <h:form id="myform">
          <h:outputText id="combo" value="#{sambean.sam}"/>
     </h:form>
</f:view>the web.xml file is
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <!-- Faces Servlet -->
    <servlet>
        <servlet-name>FacesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
  <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
</web-app>even not able to navigate. please assist

Similar Messages

  • To create an instance class Bean

    Interested in knowing to create an
    instance of class which extends TieDocument.
    The required values to be given to the
    constructur arguments.
    public Myclass extends Tiedocument
    public MyClass(LibrarySession ifs, java.lang.Long id,
    java.lang.Long classId, S_LibraryObjectData data)
    throws IfsException {
    super(ifs,id,classId,data);}
    What should be the values to be given to the
    classId,Id,S_LibraryObjectData.
    Looking forward for your reponses.

    Here is an example
    package ifs.demo.typeDefinition;
    import oracle.ifs.beans.TieDocument;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.server.S_LibraryObjectData;
    import oracle.ifs.common.IfsException;
    public class SimpleImage extends TieDocument
    public SimpleImage(LibrarySession ifs,
    java.lang.Long id,
    java.lang.Long classId,
    S_LibraryObjectData data)
    throws IfsException
    // Construct a Document object - standard variant.
    super(ifs,id,classId,data);
    null

  • Object instance from bean to bean

    Hi.
    I have backing bean with next structure:
    import mypackage.ClassA;
    public class BeanName1{
    private ClassA instanceClassA;
    public ClassA getInstanceClassA();
    public void setInstanceClassA(ClassA a);
    public class BeanName2{
    How can I get instance fro object instanceClassA in other bean class BeanName2?
    Thx.

    Sinnerman,
    Exactly what are you trying to do? What are the scopes of your two beans? Depending upon what you are trying to do, there are different answers as to the best way...
    For example, if you're trying to pass parameters from one page to another, you could look at using af:setActionListener.
    Another method would be to inject the value into the second bean as a managed property (assuming the bean scopes would support it).
    In short - more information is needed about what exactly you are trying to do in order to suggest the best approach.
    Regards,
    John

  • Problem while creating instance of bean in jsp

    have created a bean ConnBean in package ask. I am using apache tomcat 4.0.1 as a web server.
    The ask folder is in webapps/WEB-INF/classes as well as in webapps/Root/WEB_INF/classes and in ask folder ConnBean.class is stored.
    Url for jsp is webapps/Root/jdbc.jsp
    In jsp file the tag used is <jsp.useBean id="conn" class="ask.ConnBean" />
    when jsp is executed web server shows error as following
    Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 10 in the jsp file: /jdbc.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\_\jdbc$jsp.java:75: Class ask.ConnBean not found.
    ask.ConnBean conn = null;
    ^
    An error occurred at line: 10 in the jsp file: /jdbc.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\_\jdbc$jsp.java:78: Class ask.ConnBean not found.
    conn= (ask.ConnBean)
    ^
    An error occurred at line: 10 in the jsp file: /jdbc.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\_\jdbc$jsp.java:83: Class ask.ConnBean not found.
    conn = (ask.ConnBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "ask.ConnBean");
    ^
    3 errors
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
    at java.lang.Thread.run(Unknown Source)

    have created a bean ConnBean in package ask. I am
    using apache tomcat 4.0.1 as a web server.
    The ask folder is in webapps/WEB-INF/classes Remove it. This will just cloud the issue.
    as well
    as in webapps/Root/WEB_INF/classes and in ask folderThat should be webapps/ROOT/WEB-INF/classes
    ConnBean.class is stored.
    Url for jsp is webapps/Root/jdbc.jspwebapps/ROOT/jdbc.jsp
    >
    In jsp file the tag used is <jsp.useBean id="conn"
    class="ask.ConnBean" />After making the above changes, see if the error still occurs. Does your ConnBean have a public no args constructor?

  • Binding component's instance to bean property

    I'm trying to bind a dataTable to an array of objects in a JavaBean. But I don't understand how the UIData object in my JavaBean gets created. I see the "setter" gets called from the binding attribute in the dataTable element, but it's not actually being populated with my data (it gets populated with a UIData object, HtmlDataTable, with 0 rows. But my object has rows).
    <h:dataTable id="licenseTable"
                 styleClass="Detail"
                 binding="#{searchBean.licenseTable}"
                 value="#{searchBean.licenses}"
                 var="license">
    </h:dataTable>In the "searchBean" JavaBean I have the following:
      private UIData licenseTable = null;
      private License[] licenseArray = null;
      public UIData getLicenseTable()
        return licenseTable;
      public void setLicenseTable(UIData table)
        this.licenseTable = table;
      public License[] getLicenses()
        return licenseArray;
      }Do I manually create the UIData object? From the examples I've seen, that doesn't appear to be the case. But I don't see how it works.
    Thanks.

    I'll try to answer your question, although, to be honest I'm not 100% sure that it will be correct. Perhaps a more experienced poster can correct me if I'm wrong.
    I think that local values and component values are the same thing. Model values are the properties of the managed bean. There is a third category, which is submitted values.
    - Submitted Values are the values which are read right off the HTTP parameters. In essence, they are the HTTP parameters.
    - Local Values (or Component Values) These are the properties of the component. They are set from the submitted value during Apply_Request_Values phase.
    - Model Values are the properties of a managed bean. These are set during the Update_Model_Values phase from the local values after being converted and validated during the Process_Validations phase.
    I hope that helps, again, I am not completely sure if this is correct.

  • SelectBooleanCheckbox and component instance backing bean problem

    Hi
    I have a selectBooleanCheckbox with the binding property pointing to a CoreSelectBooleanCheckbox but if the user changes the checkbox value CoreSelectBooleanCheckbox remains unchanged.
    Any idea ?

    try this:
    private CoreCommandButton cmd;
    private CoreSelectBooleanCheckbox chb;
    private boolean boo = false;
    public String cmd_action() {
    // Add event code here...
    if (getChb().isSelected() == true) {
    setBoo(false);
    } else {
    setBoo(true);
    return null;
    in the page:
    <af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
    label="Label 1" binding="#{prub.chb}"
    partialTriggers="cmd" value="#{prub.boo}"/>
    <af:commandButton text="commandButton 1" binding="#{prub.cmd}"
    id="cmd" action="#{prub.cmd_action}"/>
    is it???

  • Binding stateful EJB bean

    Hi,
    I have a problem binding EJB bean (Stateful bean). Bean have two business methods:
    SendPacketToTRSM and GetData
    When I invoke SendPacketToTRSM method from process, application server create first instance of bean and invoke method SendPacketToTRSM
    Next I invoke GetData method in process, application server create second instance of bean and invoke method GetData.
    Every time, when I invoke method, application server create new instance of bean and don't remove it.
    Application server after passivation remove instance of bean from container.
    Environment: BPEL 10.0.2(OC4J), patch 4369818, 4406640, 4496111
    EJB bean on JBoss 4.0.2
    The following wsdl EJB binding:
    <?xml version="1.0" ?>
    <definitions targetNamespace="http://xmlns.unizeto.pl/TRSMBPEL"
    xmlns:tns="http://xmlns.unizeto.pl/TRSMBPEL"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/"
    xmlns:ejb="http://schemas.xmlsoap.org/wsdl/ejb/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <!-- message declns -->
    <message name="SendPacketToTRSMRequestMessage">
    <part name="sender" type="xsd:int"/>
    <part name="bufferToTRSM" type="xsd:string"/>
    </message>
    <message name="SendPacketToTRSMResponseMessage">
    <part name="result" type="xsd:int"/>
    </message>
    <message name="GetDataRequestMessage">
    </message>
    <message name="GetDataResponseMessage">
    <part name="result" type="xsd:string"/>
    </message>
    <message name="RemoveRequestMessage">
    </message>
    <message name="RemoveResponseMessage">
    </message>
    <message name="CreateRequestMessage">
    </message>
    <message name="CreateResponseMessage">
    </message>
    <!-- port type declns -->
    <portType name="TRSMService">
    <operation name="SendPacketToTRSM">
    <input name="SendPacketToTRSMRequest" message="tns:SendPacketToTRSMRequestMessage"/>
    <output name="SendPacketToTRSMResponse" message="tns:SendPacketToTRSMResponseMessage"/>
    </operation>
    <operation name="GetData">
    <input name="GetDataRequest" message="tns:GetDataRequestMessage"/>
    <output name="GetDataResponse" message="tns:GetDataResponseMessage"/>
    </operation>
    <operation name="Remove">
    <input name="RemoveRequest" message="tns:RemoveRequestMessage"/>
    <output name="RemoveResponse" message="tns:RemoveResponseMessage"/>
    </operation>
    <operation name="Create">
    <input name="CreateRequest" message="tns:CreateRequestMessage"/>
    <output name="CreateResponse" message="tns:CreateResponseMessage"/>
    </operation>
    <operation name="SSCDAuthorizedForget">
    </portType>
    <!-- binding declns -->
    <binding name="EJBBinding" type="tns:TRSMService">
    <ejb:binding/>
    <format:typeMapping encoding="Java" style="Java">
    <format:typeMap typeName="xsd:int" formatType="int"/>
    <format:typeMap typeName="xsd:string" formatType="java.lang.String"/>
    </format:typeMapping>
    <operation name="SendPacketToTRSM">
    <ejb:operation
    methodName="SendBase64PacketToTRSM"
    parameterOrder="sender bufferToTRSM"
    interface="remote"
    returnPart="result"/>
    <input name="SendPacketToTRSMRequest"/>
    <output name="SendPacketToTRSMResponse"/>
    </operation>
    <operation name="GetData">
    <ejb:operation
    methodName="GetBase64Data"
    parameterOrder=""
    interface="remote"
    returnPart="result"/>
    <input name="GetDataRequest"/>
    <output name="GetDataResponse"/>
    </operation>
    <operation name="Remove">
    <ejb:operation
    methodName="remove"
    interface="remote"/>
    </operation>
    <operation name="Create">
    <ejb:operation
    methodName="create"
    interface="home"/>
    </operation>
    </binding>
    <!-- service decln -->
    <service name="TRSMService">
    <port name="EJBPort" binding="tns:EJBBinding">
    <ejb:address className="pl.unizeto.pki.des.ssp.trsmd.TRSMDRemoteHome"
    jndiName="pl.unizeto.pki.des.ssp.trsmd.TRSMDBean"
    initialContextFactory="org.jnp.interfaces.NamingContextFactory"
         jndiProviderURL="192.168.129.202:1999"/>
    </port>
    </service>
    <!-- partner links -->
    <plnk:partnerLinkType name="TRSMService">
    <plnk:role name="TRSMServiceProvider">
    <plnk:portType name="tns:TRSMService"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>
    and bpel source
    <process name="TRSMBPEL" targetNamespace="http://xmlns.unizeto.pl/TRSMBPEL" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:tns="http://xmlns.unizeto.pl/TRSMBPEL" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:trsm="http://xmlns.unizeto.pl/TRSMBPEL" xmlns:ctask="http://services.oracle.com/bpel/task" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:taskMgr="http://services.oracle.com/bpel/task" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS --><!-- List of services participating in this BPEL process --><!-- ================================================================= -->
    <partnerLinks><!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="tns:TRSMBPEL" myRole="TRSMBPELProvider"/>
    <partnerLink name="TRSMService" partnerRole="TRSMServiceProvider" partnerLinkType="tns:TRSMService"/>
    <partnerLink myRole="TaskManagerRequester" name="userTask" partnerRole="TaskManager" partnerLinkType="taskMgr:TaskManager"/>
    </partnerLinks><!-- ================================================================= --><!-- VARIABLES --><!-- List of messages and XML documents used within this BPEL process --><!-- ================================================================= -->
    <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="tns:TRSMBPELRequestMessage"/>
    <variable name="outputVariable" messageType="tns:TRSMBPELResponseMessage"/>
    <variable name="SendPacketToTRSM_SendPacketToTRSM_InputVariable" messageType="tns:SendPacketToTRSMRequestMessage"/>
    <variable name="SendPacketToTRSM_SendPacketToTRSM_OutputVariable" messageType="tns:SendPacketToTRSMResponseMessage"/>
    <variable name="GetData_GetData_InputVariable" messageType="tns:GetDataRequestMessage"/>
    <variable name="GetData_GetData_OutputVariable" messageType="tns:GetDataResponseMessage"/>
    <variable name="UserTask2.0Var1" element="ctask:task"/>
    <variable name="Invoke_1_Create_InputVariable" messageType="tns:CreateRequestMessage"/>
    <variable name="Invoke_1_Create_OutputVariable" messageType="tns:CreateResponseMessage"/>
    <variable name="removeTRSMD_Remove_InputVariable" messageType="tns:RemoveRequestMessage"/>
    <variable name="removeTRSMD_Remove_OutputVariable" messageType="tns:RemoveResponseMessage"/>
    </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC --><!-- Set of activities coordinating the flow of messages across the --><!-- services integrated within this business process --><!-- ================================================================= -->
    <sequence name="main"><!-- Receive input from requestor.
    Note: This maps to operation defined in TRSMBPEL.wsdl
    -->
    <receive name="receiveInput" partnerLink="client" portType="tns:TRSMBPEL" operation="process" variable="inputVariable" createInstance="yes"/>
    <scope name="Scope_1">
    <variables>
    <variable name="Invoke_3_Create_InputVariable" messageType="tns:CreateRequestMessage"/>
    <variable name="Invoke_3_Create_OutputVariable" messageType="tns:CreateResponseMessage"/>
    <variable name="Invoke_1_Remove_InputVariable" messageType="tns:RemoveRequestMessage"/>
    </variables>
    <sequence name="Sequence_1">
    <assign name="Init">
    <copy>
    <from variable="inputVariable" part="payload" query="/tns:TRSMBPELProcessRequest/tns:sender"/>
    <to variable="SendPacketToTRSM_SendPacketToTRSM_InputVariable" part="sender"/>
    </copy>
    <copy>
    <from variable="inputVariable" part="payload" query="/tns:TRSMBPELProcessRequest/tns:buffer"/>
    <to variable="SendPacketToTRSM_SendPacketToTRSM_InputVariable" part="bufferToTRSM"/>
    </copy>
    </assign>
    <invoke name="create" partnerLink="TRSMService" portType="tns:TRSMService" operation="Create" inputVariable="Invoke_3_Create_InputVariable" outputVariable="Invoke_3_Create_OutputVariable"/>
    <invoke name="SendPacketToTRSM" partnerLink="TRSMService" portType="tns:TRSMService" operation="SendPacketToTRSM" inputVariable="SendPacketToTRSM_SendPacketToTRSM_InputVariable" outputVariable="SendPacketToTRSM_SendPacketToTRSM_OutputVariable"/>
    <invoke name="GetData" partnerLink="TRSMService" portType="tns:TRSMService" operation="GetData" inputVariable="GetData_GetData_InputVariable" outputVariable="GetData_GetData_OutputVariable"/>
    <invoke name="Remove" partnerLink="TRSMService" portType="tns:TRSMService" operation="Remove" inputVariable="Invoke_1_Remove_InputVariable"/>
    </sequence>
    </scope><!-- Generate reply to synchronous request -->
    <assign name="Result">
    <copy>
    <from variable="GetData_GetData_OutputVariable" part="result"/>
    <to variable="outputVariable" part="payload" query="/tns:TRSMBPELProcessResponse/tns:data"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client" portType="tns:TRSMBPEL" operation="process" variable="outputVariable"/>
    </sequence>
    </process>
    Could anyone explain, is it possible to binding stateful bean to process?
    Thanks
    Norbert

    Did some additional investigations and concluded"
    The (embedded) OTC uses default the empty to obtain the reference to a Session Bean (EJB). In my case I was using the Remote Interface and my Context was empty { }:
    Hashtable ht = ic.getEnvironment();
    System.out.println(ht.toString());
    When I supply the missing information, obtained via the Test Client that functions correctly, a new Bean instance was created for each Client. My getInitialContext() method looks like the example below.
    public InitialContext getInitialContext() throws NamingException {
    Properties p =new Properties();
    p.setProperty( "java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
    p.setProperty( "java.naming.provider.url", "ormi://localhost:23892/current-workspace-app" );
    I tried the ApplicationInitialContextFactory and again the same Bean instance was shared among all Clients. I did not try ApplicationClientInitialContextFactory, but I expect that the Remote interface will be used!
    Is it a Bug that ApplicationInitialContextFactory does not create a new instance for my Stateful Session Bean? I can use the Remote interface, but that would decrease the performance and it is less elegant...
    Michael

  • Application Module instance not found in task flow

    Hi,
    i am working on Oracle Jdeveloper 11g Release 1
    I have created a bounded task flow for with following properties:
    <transaction id="__14">
          <new-transaction/>
        </transaction>
        <data-control-scope id="__15">
          <shared/>
        </data-control-scope>
        <task-flow-reentry id="__13">
          <reentry-not-allowed/>
        </task-flow-reentry>I have declared a page flow scope bean in the task flow as:
    <managed-bean id="__5">
          <managed-bean-name id="__6">trainBean</managed-bean-name>
          <managed-bean-class id="__8">oracle.sysman.core.gccompliance.view.library.rule.patchRule.PatchRuleTrainBean</managed-bean-class>
          <managed-bean-scope id="__7">pageFlow</managed-bean-scope>
        </managed-bean>but when i am trying to access the AM Impl instance from bean methos as below:
    public static final String DATA_CONTROLLER = "ComplianceLibraryAMDataControl";
        public ComplianceLibraryAMImpl getDataControl() {
            DCBindingContainer bc =
                (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            ApplicationModule am = bc.findDataControl(DATA_CONTROLLER).getApplicationModule();
            return (ComplianceLibraryAMImpl)am;
        }I am getting null pointer exception in ApplicationModule am = bc.findDataControl(DATA_CONTROLLER).getApplicationModule();
    I am using the same way to get bean in other task flows as well , so i think the code to get bean is working correctly.
    What am i missing in this?

    thanks Puthanampatti ,
    This is working and i am able to get AM instance from this , But i am not sure what is the difference between:
    public ComplianceLibraryAMImpl getComplianceLibraryAM() {
    ComplianceLibraryAMImpl am = (ComplianceLibraryAMImpl)ADFUtils.getApplicationModuleForDataControl("ComplianceLibraryAMDataControl");
    return am;
    Referred methods:
         * Get application module for an application module data control by name.
         * @param name application module data control name
         * @return ApplicationModule
        public static ApplicationModule getApplicationModuleForDataControl(String name)
            return (ApplicationModule) JSFUtils.resolveExpression("#{data." +  name +  ".dataProvider}");
         * Method for taking a reference to a JSF binding expression and returning
         * the matching object (or creating it).
         * @param expression EL expression
         * @return Managed object
        public static Object resolveExpression(String expression) {
            FacesContext facesContext = getFacesContext();
            Application app = facesContext.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = facesContext.getELContext();
            ValueExpression valueExp =
                elFactory.createValueExpression(elContext, expression,
                                                Object.class);
            return valueExp.getValue(elContext);
        }And my previous approach:
        public ComplianceLibraryAMImpl getDataControl() {
                     DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                     ApplicationModule am = bc.findDataControl(DATA_CONTROLLER).getApplicationModule();
                     return (ComplianceLibraryAMImpl)am;
        }Why am i not able to find my data control AM from Binding Container????

  • Where I save Executor instance in MDB environment

    Hi,
    I've been doing some experiences with JMS and Message Driven Beans.
    I put in a queue messages and see how many MDB beans catch and treat the message. I've concluded that Glassfish creates many MDB beans and some are removed.
    My goal is control the flux of messages treatment. In other words i dont want instances of beans treat the message in a uncontrolled manner. For example if i have 10 messages in a queue and the Application Server is running on a machine with two cpu cores i want only two messages be treated each time.
    I thought in instantiating an Executor. The motif is MDB beans get Executor reference and send the message to the Executor. The Executor see what threads are available in Thread Pool and treat the message.
    But the difficulty is how I save the Executor instance. In a static variable? In a MBean? In a shared memory (if yes how?).
    Thanks in advance.

    most app servers let you control the size of the "pool" used for various bean types. a google query for "glassfish mdb pool size" looks like it's returning relevant results.

  • Managed server detail in session bean

    In cluster domain with 4 managed server in weblogic, cluster enabled stateless bean is created & deployed. here is a need. In side bean, I should get the manged server name programmatically which server has created the instance of bean?

    you can use jmx, it can provide lots of information about wls.
    please see http://e-docs.bea.com/wls/docs92/jmx/index.html and http://e-docs.bea.com/wls/docs92/jmx/accessWLS.html#wp1119237

  • JSPDyn page using a bean

    Trying to create a pretty simple JSPDyn page with a single bean.  I am using NWDS to generate the code.  I am trying to set some initial data in bean to be used on the page later, but it always comes back as NULL.  It's like the creation the generation of the page creates a new instance of bean and loses the reference I create in the controller.
    Here is the code for the dynpage controller:
    package com.my.test;
    import com.my.test.bean;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.enum.*;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.page.*;
    import com.sapportals.portal.htmlb.page.*;
    import com.sapportals.portal.prt.component.*;
    public class myTest extends PageProcessorComponent {
      public DynPage getPage(){
        return new myTestDynPage();
      public static class myTestDynPage extends JSPDynPage{
        private bean myBean = null;
        public void doInitialization(){
          IPortalComponentProfile profile = ((IPortalComponentRequest)getRequest()).getComponentContext().getProfile();
          Object o = profile.getValue("myBean");
          if(o==null || !(o instanceof bean)){
            myBean = new bean();
            profile.putValue("myBean",myBean);
          } else {
              myBean = (bean) o;
          // fill your bean with data here...
          myBean.setOutput("test message");
        public void doProcessAfterInput() throws PageException {
        public void doProcessBeforeOutput() throws PageException {
          this.setJspName("myTest.jsp");
    Notice I am setting the data up after the comment "//fill your bean data here".  SAP code generator inserted this comment.
    and here is the bean code
    package com.my.test;
    import java.io.Serializable;
    public class bean implements Serializable {
         private String output;
         public String getOutput( ){
              return output;
         public void setOutput( String value ){
              output = value;
    and finally the jsp page
    <jsp:useBean id="myBean" scope="application" class="com.my.test.bean" />
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
         The value of Output is <%= myBean.getOutput( ) %>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    the output is:
    The value of Output is null
    Anyone have any idea what I am doing wrong here.
    Thanks in advance.
    Clark

    Hi Clark,
    Open the portalapp.xml and delete these two lines
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/myTest.jsp"/>
    Rebuild and deploy and it should work.
    Thanks
    Prashant

  • How to use PropertyChangeSupport for a bean from another bean

    Hi all,
    I have a bean A that doesnot implements the PropertyChangeListener or have a PropertyChangeSupport as one of its member and I cant change its design. I want to fire an PropertyChangeEvent when a property is changed. I added A to PropertyChangeSupport of another bean B. The problem is that even if the Property of Bean A is changed it doesnot fire a event. Can anybody let me know how to do it?
    Thanks,
    Amit

    You need to wrap bean A inside another bean (B) that
    implements the accessor and mutator methods of Bean A
    and adds property change support in those methods
    where appropriate. You hide the actual instance of
    bean A inside an instance of bean B so no instances of
    bean A are visible to the application.This is OK, unless you don't want to change all places where A is referenced. You could subclass B from A, as long as the accessor and mutator methods are not final. Of course, instantation still has to know about B and you will have to cast to B, or use reflection, to add and remove the listeners.

  • Measuring throughput of message driven bean

    Hi,
    I am trying to do some performance testing. I will be send millions of messages
    to a JMS server. These will be consumed by message driven beans (some appropriate
    number created at start up and kept in cache).
    The message driven bean performs uses some local entity bean to perform some database
    transaction.
    I want to measure how many messages did each of the instance of bean process?
    How much total time did each of message bean spend for their share of messages
    and average time for consumption of a message in a bean (which is actually dividing
    the total time for consumption of messages for a message bean dividing by total
    number of messages (assuming that bean pick up message instantaneously).
    Any idea if I could do that through weblogic console (I am using WL 6.1). Or by
    using MBeans??
    Any other idea will be useful.
    Thanks
    Mohit

    Mohit,
    Wily makes a tool tailored for doing the kind of performance evaluation you're
    talking about. How useful it will be to your specific situation depends a lot
    on some details that aren't in this post. Introscope (our tool) isn't designed
    to crack apart individual instances of your message beans, but it is designed
    to give you an idea of throughput per-component; exactly the kind of eval it looks
    like you have in mind.
    Roughly speaking... you can put rate and timer "tracers" on top of the relevant
    methods in your bean's class. There are also increment and decrement tracers,
    so you could match up send/receives between the components of your JMS app. This
    will work across JVMs. There is (of course) some overhead for the monitoring,
    but you could easily cancel out that number by doing a before and after and subtracting
    our overhead-- you will be probably be impressed with how small it really it.
    How many JVM instances are involved in your load test? How many different bean
    classes? Are you using strictly the standard JMS API calls, or do you want to
    monitor thing beyond that?
    Drop me an e-mail if you're interested and we can talk about getting you set up
    to try it out.
    Dave Martin
    [email protected]
    Wily Technology, Inc.
    (http://www.wilytech.com)
    "Mohit Sehgal" <[email protected]> wrote:
    >
    Hi,
    I am trying to do some performance testing. I will be send millions of
    messages
    to a JMS server. These will be consumed by message driven beans (some
    appropriate
    number created at start up and kept in cache).
    The message driven bean performs uses some local entity bean to perform
    some database
    transaction.
    I want to measure how many messages did each of the instance of bean
    process?
    How much total time did each of message bean spend for their share of
    messages
    and average time for consumption of a message in a bean (which is actually
    dividing
    the total time for consumption of messages for a message bean dividing
    by total
    number of messages (assuming that bean pick up message instantaneously).
    Any idea if I could do that through weblogic console (I am using WL 6.1).
    Or by
    using MBeans??
    Any other idea will be useful.
    Thanks
    Mohit

  • Instance Pool

    I am new to Weblogic & started straight away from 6.1. I am learning Stateful session bean. While going thru Stateful Session Bean tutorial, there is a mention that (which is a vendor specific) we can define & force the container to have a maximum number of instances of Beans in the instance pool.
    In WLS 6.1, in which file one define the number of instances of EJB to be created in the pool maintained by EJB container?

    Hi,
    Following links might help you.
    http://help.sap.com/saphelp_nw04/helpdata/EN/ca/7cb340be761b07e10000000a155106/content.htm
    Re: Connection to antivirus server (avira) adapter
    Manoj

  • Sharing a bean information through jsp pages

    Morning,
    I want to use a java bean in two jsp pages, so is it possible to share it (to set its properties in the 1st page and retrieve them in the 2nd)?
    If not, what should I do? Could I use forward and set param?
    Here is my 1st jsp
    ==================
    <%@page language="java" %>
    <jsp:useBean id="doctorConn" scope="session" class="beans.DoctorBean" >
         <jsp:setProperty name="doctorConn" property="*" />
    </jsp:useBean>
    <%
    if(doctorConn.getUserId().equals("") ||doctorConn.getPassword().equals(""))
         response.sendRedirect("notAuthorised.jsp");
    System.out.println("user id : " + doctorConn.getUserId()+ " password : " +doctorConn.getPassword());
    if(doctorConn.isAuthorised(doctorConn.getUserId(), doctorConn.getPassword())) {
    %>
         <jsp:forward page="doctorApp.jsp" />
    <%
    else response.sendRedirect("notAuthorised.jsp");
    %>
    ==================
    my second
    =================
    <%@page language="java" %>
    <%@page import ="java.sql.*" %>
    <%@page import ="java.lang.Exception"%>
    <jsp:useBean id="doctorConn" scope="session" class="beans.DoctorBean" />
    <jsp:useBean id="appointment" scope="session" class="beans.Appointment" >
         <jsp:setProperty name="appointment" property="*" />
    </jsp:useBean>
    ...etc
    ===========================
    I am using Tomcat 4 and in the 2nd page I am getting an error about doctorConn
    Thank you,

    Yes ofcorse. You can do it in many ways.
    Firstly, declare properties of your bean as static that you want to share between pages and create new instance of bean on each page.
    Secondly you can store the same instance of the bean in you session. On th other page, you can retrive same instance of the bean whenever needed.
    Otherwise, you can create a gateway class that maitain static reference of you bean class.

Maybe you are looking for

  • Is it possible to find the location on a lost ipod touch from my macbook?

    Is it possible to locate a lost ipod touch from my Macbook?

  • BT Infinity 2 - sudden 30% drop in download speed ...

    On the 11th April my line speed dropped from a great 60Mb/s to just over 40Mb/s for no apparent reason, even though I've experienced reconnects at random times over the last month or so (this may have been an early warning there was an issue). This w

  • Authorization: 2 startup disks = 1 or 2 "devices"?

    Apple/iTunes allows me to use purchased/licensed content only on a limited number of devices (if I understand the terms correctly, that's 10 devices, with a maximum of 5 computers). Now when I have one machine (e.g. a MacBook) with two separate OS X

  • Pages spell check "all caps"

    Is there a way to prevent the spell checker from skipping over WORDS IN ALL CAPS?  Or, should I say WORDX IN ALL CAPS?  Using latest version of OSX and pages. -Mike and Squirtty and Memep

  • Re: Startup files

    My Mac Pro was stolen and I just bought a new Imac. Now, I would like to recovery my Itunes Library from my Mac account. I can see my old purchases but I don't know how to donwload them in my new IMAC. I apreciate your help