Invoke not known method in not known class.

Everybody,
I am confusing about loading, invoking a little-known class, method. 'Little-known' means, when
designing we don't know the existence of that class, method. The application'll know names of
class, method which are inputted by user (Those classes exist when the user input).
For example: look at 'Little-known' class: FutureClass. It has method notKnownMethod as below
package notnow
public class FutureClass extends now.KnownClass {
  public void notKnownMethod() {
}and the application main class MainApp.
  public class MainApp {
    public static void main(String[] args) {
      // these variable will be inputted by users
      // this is what we not known
      String className = "notnow.FutureClass";
      String methodName = "notKnownMethod";
      try {
        // create instance of the class
        // use the name inputted bye user
        Class futureClass = Class.forName("notnow.FutureClass");
        // get method in that class
        Method futureMethod = futureClass.getMethod("notKnownMethod", null);
        // and then invoke it -- Error dialog appears:
        // Prompt:  "Java Virtual Machine Launcher"
        // Content: "Fatal excption occurred. Program will exit"
        // with exception throw: java.lang.IllegalArgumentException: object is not an instance of  
        // declaring class. Point to next row.
        futureMethod.invoke(new now.KnownClass(), null);
        //futureMethod.invoke(new notnow.FutureClass(), null); -- No Error
        // but we don't know name of the class till user input it.
      }catch (Exception e) {}
  }You may think it's reflection, but reflection uses the known object in the invoke method(like the tutorial http://java.sun.com/docs/books/tutorial/reflect/object/invoke.html ). So how to invoke a method of a class known in the future (bussiness rule or update) ?
Please help me out of this problem.
Thanks for advance
Liwh

Take a closer look at the tutorial.
To use a non-static method from the class, you must have an instance of the class. That means either calling one of the class' constructors or using the newInstance method to invoke the default no-args constructor.
Object instance = futureClass.newInstance();
futureMethod.invoke(instance, null);I will let you play with calling methods whose argument list you don't know...
And if you know all you FutureClasses will extend a particular CurrentClass, make CurrentClass abstract with a few abstract methods that you would use in FutureClass... It will make life a lot easier:
public abstract class CurrentClass {
  //All the other stuff
  public abstract void runPrimaryMethod();
//Then in FutureClass
public class FutureClass extends CurrentClass {
  //Other Stuff
  public void notKnownMethod () {
    //Stuff
  public void runPrimaryMethod() {
    notKnownMethod();
//Then in main body
    CurrentClass instance = (CurrentClass)futureClas.newInstance();
    instance.runPrimaryMethid();Interfaces are also good for this.

Similar Messages

  • Can you invoke a protected method in a different class

    I want to tell my method that if a certain event occurs, to invoke a method thats located in a different class but in the same package. But neither inherit each other.
    I also want the original method to pass parameters to the remote method so it can perform actions on them.
    Is this possible somehow, or am I barking up the wrong tree?
    I've included an example to illustate.
    edu.example;
    public class one extends bank{
    protected void count (){
    If i>100{
    spend(5); // method thats in the two class
    else break;
    edu.example;
    public class two extends bank{
    protected void spend (int x){
    i = i - x;

    Yes, protected will work in this case. A protected method is available to all classes in the same package, just like default access.

  • ValueChangeListener not invoking backing bean method

    Hi Everybody
    I am using a valueChangeListener attribute with <h:selectOneListbox>. As i am using onChange, the form is getting submitted but the associated backing bean method is not getting invoked.
    My JSP code:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
       <head>
          <title>Song Detail</title>
       </head>
       <body>
          <f:view>   
               <h:form id="songForm">
                       <H4>Select a song to view detail.</H4>
                </Br>
                       <h:selectOneListbox id="songList" value="#{songBean.selectedSong}"
    valueChangeListener="#{songBean.songInformation}" immediate="true" onchange="submit();">
                              <f:selectItems value="#{songBean.songList}"/>
                     </h:selectOneListbox>
                <p>
                 <h:outputText id="result" value="#{songBean.songDetail}"/>
             </p>   
         </h:form>                  
       </f:view>
      </body>
    </html> My Backing bean method:
    public void songInformation(ValueChangeEvent vce) throws AbortProcessingException
              System.out.println("Method invoked");
           } This songInformation() method is not getting invoked.
    Please help.

    I never say to put every bean in session scope.
    I recommend that the following beans are in session scope:
    (1) the value property of h:dataTable
    (2) the value property of f:selectItems
    (3) the rendered property
    They are evaluated before Update Model Values phase.

  • Javax.ejb.EJBException: Method is not a known CMP field accessor...

    Hi !
    I have a little problem. When I deploy my jar file, I have the next message :
    "javax.ejb.EJBException: Method is not a known CMP field accessor, CMR field accessor, or ejbSelect method: methodName=compareTo"
    Is there someone to tell me why ? ^_^
    I didn't put the source code in this topic, not to pollute it, but if you need it, tell me ;)
    Thx for your help.

    Hi Spidey !
    Thx for you help but... Giving my method doesn't require the use of EJBQL, I don't think I have to define it in my deployment descriptor (this is not a query)...
    I give you an idea of my (experimental ^_^) source code :
    public class CountryBean implements EntityBean{
    public int compareTo(Country c){
    SOP("COMPARE TO");
    return 0;
    public class MySession implements SessionBean{
    public int doIt(){
    MyComparator comparator = new MyComparator();
    return comparator.compare(country1, country2);
    public class MyComparator implements Comparator{
    public int compare(Object o1, Object o2){
    return compare((Country)o1, (Country)o2);
    public int compare(Country c1, Country c2){
    SOP("COMPARE");
    return c1.compareTo(c2);
    When I call doIt(), the message "COMPARE" is written and just after, there's this message (the message "COMPARE TO" is never written):
    "11:29:44,204 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
    javax.ejb.EJBException: Method is not a known CMP field accessor, CMR field accessor, or ejbSelect method: methodName=compareTo
    at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:110)
    at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
    at CountryBean$Proxy.compareTo(<generated>)"
    I hope this is clear ^__^
    Thx for helping me ;)

  • Method "equals" not implemented for class "Pan1"

    Method "equals" not implemented for class "Pan1" -- this is the error I'm getting while running one static Analyzer. Can anybody say, what is this error , and how to rectify it ?

    The static analyzer may have noticed that either you may invoke .equals() on instances of this class (possibly through polymorphism) and you have not implemented the method in your class. This is most likely a warning since many times lack of an implemented .equals() method in such cicumstances will lead to Object.equals() being executed and that simply checks to see if the object references are the same - quite a bit stronger than what one would probably expect from .equals();
    it is also possible that you did implement an equals() method but that you used the wrong argument type. This is a common mistake:
    public boolean equals(MyClass other) {
       return /* something */;
    }This type of warning may be ignored, or if it troubles you and there is no way to disable it for the classes that you know you have implemented correctly, you might consider adding an equals method of the form:
    public boolean equals(Object other) {
       return super.equals(other);
    }Chuck

  • Could not invoke the service() method when the JSP page is loaded

    I am new to servlets/jsp so excuse if I am doing something silly here:
    I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
    Any help is much appreciated:
    Here is my JSP:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
    <% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
    <HTML>
    <BODY>
    <Form name=listTable action="InsSer" method="post">
    <TABLE border="1">
         <TBODY>
              <TR>
                   <TD width="258" align="center"><B>Policy Id</B></TD>
                   <TD width="187" align="center"><B>Customer Name</B></TD>
                   <TD width="160" align="center"><B>Agent Name</B></TD>
                   <TD width="134" align="center"><B>Status</B></TD>
              </TR>
              <TR>
    <%
    for (int index=0; index < VTable.size();index++) {
    PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
    %>
         <TR bgcolor="#99CCFF">
    <TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
    <TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
    <TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
    <TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
    </TR>
         <% } %>
         </TBODY>
    </TABLE>
    <P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
    </BODY>
    </HTML>
    Here is my servlet:
    package insurance;
    import java.io.IOException;
    import java.util.Vector;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.Servlet;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class InsSer extends HttpServlet implements Servlet {
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#HttpServlet()
         public InsSer() {
              super();
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doPost(req,resp);
              // TODO Auto-generated method stub
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              //PolicyObj[] policyTable = new PolicyObj[3];
              HttpSession session = req.getSession(false);
              //if (session == null) {
                   //resp.sendRedirect("http://localhost:9080/Insurance/error.html");
              //Vector buylist = (Vector) session.getAttribute("PolicyList");
              Vector policyList = null;
              policyList.addElement(new PolicyObj());
              ((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
              ((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
              ((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
              ((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
              session.setAttribute("policyTable",policyList);
              ServletContext sc = getServletContext();
              RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
              rd.forward(req,resp);
    Message was edited by:
    sfz1
    Message was edited by:
    sfz1

    I am new to servlets/jsp so excuse if I am doing something silly here:
    I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
    Any help is much appreciated:
    Here is my JSP:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
    <% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
    <HTML>
    <BODY>
    <Form name=listTable action="InsSer" method="post">
    <TABLE border="1">
         <TBODY>
              <TR>
                   <TD width="258" align="center"><B>Policy Id</B></TD>
                   <TD width="187" align="center"><B>Customer Name</B></TD>
                   <TD width="160" align="center"><B>Agent Name</B></TD>
                   <TD width="134" align="center"><B>Status</B></TD>
              </TR>
              <TR>
    <%
    for (int index=0; index < VTable.size();index++) {
    PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
    %>
         <TR bgcolor="#99CCFF">
    <TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
    <TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
    <TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
    <TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
    </TR>
         <% } %>
         </TBODY>
    </TABLE>
    <P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
    </BODY>
    </HTML>
    Here is my servlet:
    package insurance;
    import java.io.IOException;
    import java.util.Vector;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.Servlet;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class InsSer extends HttpServlet implements Servlet {
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#HttpServlet()
         public InsSer() {
              super();
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doPost(req,resp);
              // TODO Auto-generated method stub
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              //PolicyObj[] policyTable = new PolicyObj[3];
              HttpSession session = req.getSession(false);
              //if (session == null) {
                   //resp.sendRedirect("http://localhost:9080/Insurance/error.html");
              //Vector buylist = (Vector) session.getAttribute("PolicyList");
              Vector policyList = null;
              policyList.addElement(new PolicyObj());
              ((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
              ((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
              ((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
              ((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
              session.setAttribute("policyTable",policyList);
              ServletContext sc = getServletContext();
              RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
              rd.forward(req,resp);
    Message was edited by:
    sfz1
    Message was edited by:
    sfz1

  • a4j:commandButton Back end bean method is not invoked on click event.

    I am using below code. It seems back end bean method is not called when I click commandbutton. I think it has some thing to with rendering.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:a4j="http://richfaces.org/a4j"
         xmlns:rich="http://richfaces.org/rich"
         xmlns:cdm="http://mportal.com/cdm">
    <ui:composition>
         <rich:panel>
              <a4j:form id="RefreshPropertiesInstanceForm">
                   <table id="RefreshPropertiesTable" width="100%" border="0">
                        <tr>
                             <td width="35%" align="right">
                             <div class="fieldLabel">Property File Name :<span
                                  class="requiredField">*</span></div>
                             </td>
                             <td style="margin-top: 15px; padding-left: 15px" nowrap="nowrap"
                                  align="left"><rich:comboBox id="combo"
                                  value="#{testPropertyRefreshHelper.selectedPropertyFile}"
                                  enableManualInput="false">
                                  <f:selectItems value="#{testPropertyRefreshDetails.propertyFileNameList}" />
                                  <a4j:support event="onchange"
                                       reRender="RefreshPropertiesInstanceForm" BypassUpdates="false"
                                       ajaxSingle="true" action="#{testPropertyRefreshHelper.getPropertyFileContentFromRemoteServer}" />
                             </rich:comboBox></td>
                        </tr>
                        <tr>
                             <td style="margin-top: 10px; padding-left: 100px" align="left"
                                  colspan="3"><h:inputTextarea id="firstTextArea" value="#{testPropertyRefreshHelper.propertyFileContent}"
                                  rows="21" cols="150"
                                  style="overflow-x: auto; overflow-y: scroll"
                                  rendered="#{testPropertyRefreshHelper.selectedPropertyFile != 'Choose from below'}"
                                  disabled="#{testPropertyRefreshHelper.selectedPropertyFile == 'Choose from below'}">
                             </h:inputTextarea></td>
                        </tr>
                        <tr>
                             <td style="margin-top: 10px; padding-left: 400px" align="left"
                                  colspan="2">
                             <a4j:commandButton id='refreshPropertyButton' value="refresh"
                                  image="#{imageManager.imageMap['REFRESH_BUTTON']}"
                                  rendered="#{testPropertyRefreshHelper.selectedPropertyFile != 'Choose from below'}"
                                  action="#{testPropertyRefreshHelper.updatePropertyFileContentInRemoteServer}"
                                  reRender="RefreshPropertiesInstanceForm" >     
                             </a4j:commandButton>
                             </td>
                        </tr>
                   </table>
              </a4j:form>
         </rich:panel>
    </ui:composition>
    </html>
    Every thing works perfectly. But when I click command button "#{testPropertyRefreshHelper.updatePropertyFileContentInRemoteServer}" backing bean method is not invoked. Other componenets are working properly.

    try what the linked article says: make your bean session scoped.
    NOTE: when working with Ajax I tend to make the backing bean session scoped to have less issues with partial updates and such. If you use JSF 2.0 you could make it view scoped to get the same result.

  • Web Deploy error - "This method is not supported by this class"

    I have an MVC project which I am trying to deploy to one of our internally-hosted web front end servers via a TFS build process. Our server hosts the MS Deploy service, and other solutions deploy without problems to the same box. The parameters for the build
    process are as follows:
    /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSVC /p:MsDeployServiceUrl=https://<server>:8172/msdeploy.axd /p:DeployIISAppPath="<internal.site.com>" /p:username=<username> /p:password=<password>
    /p:IncludeIisSettingsOnPublish=false /p:AllowUntrustedCertificate=True /p:OutputPath=bin\ /p:SkipExtraFilesOnServer=True /p:VisualStudioVersion=11.0
    The error message I receive at the point the build reaches the deployment activity is:
    Web deployment task failed. (Could not complete the request to remote agent URL 'https://<server>:8172/msdeploy.axd?site=<internal.site.com>'.)
    Could not complete the request to remote agent URL 'https://<server>:8172/msdeploy.axd?site=<internal.site.com>'.
    The request was aborted: The request was canceled.
    This method is not supported by this class.
    We've found
    this StackOverflow post which describes the same error we're experiencing, however the suggested solution is something we already do in our server configuration, so this doesn't resolve the issue for us.
    Has anyone seen this error before, or is able to make any suggestions why it is happening?

    Hi Matt,
    You have to have a look in the build log then copy the command that is under Run MSBuild node and executed it on the build agent.
    You should find something like below:
    C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "C:\Builds\....sln" /nr:False /fl /flp:"logfile=C:\Builds\...log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:CreatePackageOnPublish=true /p:DeployOnBuild=true /p:SkipExtraFilesOnServer=True /m /p:OutDir="C:\Builds\...\bin\\" /p:Configuration="DEV" /p:Platform="Any CPU" /p:VCBuildOverride="C:\Builds\....sln.Any CPU.DEV.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/31630;IgnoreDuplicateProjects=False;InformationNodeId=14;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;LogProjectNodes=True;LogWarnings=True;TFSUrl=http://...-tfs:8080/tfs/...;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;" /p:BuildId="aa2d3857-27e9-4854-b44f-4ca625ccd786,vstfs:///Build/Build/31630" /p:BuildLabel="..._2015.02.27.2" /p:BuildTimestamp="Fri, 27 Feb 2015 11:16:41 GMT" /p:BuildDefinition="..."
    Daniel

  • File's Owner does not show methods in Interface Builder 3.2.6 but the class is set correctly and the nib on the lower left is green

    Hi, I'm trying to make my first IPhone app. After having problems with interface builder the first time I coppied the code directly from a tutorial in case I made any mistakes. I saved the program, and re-opened the .xib file. Right clicking  File's Owner does not show a list of methods. I've been looking around for solutions for this but have not gotten anything to work. I tried deleting the default .xib and creating a new one through file-> new file. This did not help. I did notice that File's owner was showing up as a light blue cube apposed to a yellow one now and found that a bit odd but otherwise nothing changed. I opened the library menu and selected helloWorldiPhoneViewController so it would show up in the view port. I set the class field of File's Owner to hellowWorldiPhoneViewController. File's Owner still does not show methods when right clicked or when a line is dragged over a button. I read somewhere that the color of nib on the lower left of the viewport may indicate a problem, but it is green not indicating any issue. Every solution I found for someone else seems nto to work for me and I don't know how to continue.
    here is the .h file just in case:
    //  HelloWorldViewController.h
    //  HelloWorld
    //  Created by Paul Peelen on 2011-03-14.
    //  Copyright 2011 9697271014. All rights reserved.
    #import <UIKit/UIKit.h>
    @interface HelloWorldViewController : UIViewController {
            UILabel *textLabel;
    @property (nonatomic, retain) IBOutlet UILabel *textLabel;
    - (IBAction)changeTheTextOfTheLabel;
    @end
    I'm trying to connect changeTheTextOfTheLabel to a button and textLabel to a label

    You need a parameter for an interface builder method. The type should be id and the name is typically "sender". It would look like this:
    - (IBAction)changeTheTextOfTheLabel: (id) sender;
    Be careful about those tutorials. Many are ancient and do not correspond to current Xcode behaviour.

  • Method init not found in class oracle.apps.fnd.cp.request.C

    Hi all,
    I am reffering to Oracle Application Framework Developer’s Guide Release
    11.5.10 RUP3 December 2, 2005
    As given in the document (page 275) Concurrent Processing: Request Submission
    and Monitoring ,I want the Concurrent Processing Request Submission and Monitoring user interfaces available on my OA Framework-based pages.
    I have followed the steps given in the OADevGuide but when the custom CO
    is compiled it gives following error.
    method <init> not found in class oracle.apps.fnd.cp.request.ConcurrentRequest.
    The import statement in our code is as followed
    import oracle.apps.fnd.cp.request.ConcurrentRequest;
    import oracle.apps.fnd.cp.request.RequestSubmissionException;
    wheather I have to open a SR on metalink asking for an updated file ConcurrentRequest.class ?
    Thanks in advance,
    Anant.

    Hi All,
    Thanks Prabhat for that update.
    Thanks tapashray cause u r update on thread Apply not being caught in debugger helped me a lot.
    Right now I am facing a different problem.
    On click of submit button The page gets called but it gives error as
    oracle.apps.fnd.framework.OAException: Could not load application module 'oracle.apps.fnd.cp.srs.server.RequestAM'.
    In myprojects folder under oracle dir at reqd path I have this AM .
    Whether I need to add the bc4j pkg "oracle.apps.fnd.cp.srs.server.RequestAM" in my project . I dont think so as I am not extending any class/VO or doing any substitution.
    my code is as followed
    public void processFormData(OAPageContext pageContext, OAWebBean webBean)
    System.out.println("Inside ProcessFormData");
    if (pageContext.getParameter("Submit")!= null )
    System.out.println("Inside Submit ");
    try
    // get the JDBC connection
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    //Connection conn = (Connection)am.getOADBTransaction();
    OADBTransaction conn = am.getOADBTransaction();
    System.out.println("OADBTransaction conn "+conn);
    ConcurrentRequest cr = new ConcurrentRequest(conn.getJdbcConnection());
    System.out.println(" ConcurrentRequest cr "+cr);
    cr.setDeferred();
    // call submit request
    Vector param = new Vector();
    String selectedValue = pageContext.getParameter("reportList");
    System.out.println("selectedValue -> "+selectedValue);
    param.add(selectedValue);
    System.out.println("before cr.submitRequest ");
    int reqId = cr.submitRequest("SQLGL", "RGFSGXML", "Run FSG and XML Publisher",null, false, param);
    // int reqId = cr.submitRequest("SYSADMIN", "FNDSCURS", "User Responsibility Report",null, false, param);
    System.out.println("After cr.submitRequest reqId "+reqId);
    conn.commit();
    System.out.println("After commit");
    // redirect page to Request Scheduling page
    HashMap parameters = new HashMap();
    String url = "OA.jsp";
    parameters.put("akRegionApplicationId", "0");
    parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
    String id = "" + reqId + "";
    parameters.put("requestMode", "DEFERRED");
    parameters.put("requestId", id);
    System.out.println("before page forward ");
    pageContext.setForwardURL("BSE_CONC_REQUEST"
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,parameters
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
    ,OAWebBeanConstants.IGNORE_MESSAGES);
    catch(RequestSubmissionException reportError)
    System.out.println("RequestSubmissionException raised "+reportError.getStackTrace());
    catch(SetDeferredException deferred)
    System.out.println("SetDeferredException raised "+deferred.getStackTrace());
    super.processFormData(pageContext,webBean);
    Hope I have given all the details.
    Regards,
    Anant.
    Message was edited by: Removed the error stack so that thread details remain on the same page
    Anant

  • Class /SAPSRM/CL_WF_PROCESS_LEVEL method IS_LAST_LEVEL not working

    We are running SRM 7.0 SP 8 with Process Controlled Workflow.
    I am trying to use object with reference to class /SAPSRM/CL_WF_PROCESS_LEVEL, method IS_LAST_LEVEL to determine if the current workflow process level is the last in an N-step approval. But the method does not return what I am expected, instead, it is always returning abap_true. I am puzzled for a while for this. Following is my code excerpt with this call:
            data:ls_process_level    type /sapsrm/s_wf_process_level,
                 lo_curr_proc_level  type ref to /sapsrm/cl_wf_process_level.
              call method /sapsrm/cl_wf_apv_facade=>get_current_process_level
                exporting
                  iv_document_guid = iv_doc_guid
                importing
                  es_process_level = ls_process_level.
              try.
                  lo_curr_proc_level = /sapsrm/cl_wf_process_level=>getpersistent_by_oid( ls_process_level-level_guid ).
                  if lo_curr_proc_level->is_last_level( ) eq 'X'.
                    lv_final_step = 'X'.
                  endif.
                catch cx_root.
                  raise exception type /sapsrm/cx_wf_not_found.
              endtry.
    Note: After the call to  /sapsrm/cl_wf_process_level=>getpersistent_by_oid, lo_curr_proc_level is returned with the actual valid object. The issue is only with the next call to IS_LAST_LEVEL.
    If you can shed some light as to what might be wrong with this code, OR, how else you would determine whether the current process level is the last step in an N-step approval, I'd really appreciate it.
    Thanks.

    Hi,
      Try the below code
      DATA lo_first_level           TYPE REF TO /sapsrm/cl_wf_process_level.
      DATA lo_temp_level            TYPE REF TO /sapsrm/cl_wf_process_level.
      DATA lo_obsolete_level        TYPE REF TO /sapsrm/cl_wf_process_level.
      DATA lv_process_status        TYPE /sapsrm/wf_process_status.
      DATA lo_process_config        TYPE REF TO /sapsrm/cl_wf_configuration.
      DATA lv_process_scheme        TYPE /sapsrm/wf_process_scheme.
      DATA lv_document_guid         TYPE /sapsrm/wf_document_guid.
      DATA lv_document_type         TYPE /sapsrm/wf_document_type.
      DATA lo_object_service        TYPE REF TO /sapsrm/cl_wf_object_service.
      DATA lo_runtime_config         TYPE REF TO /sapsrm/if_wf_runtime_hdl.
      DATA ls_config_value           TYPE /sapsrm/s_wf_runtime_result.
      DATA lv_config_value           TYPE /sapsrm/wf_conf_attr_val.
      DATA lv_restart_process_scheme TYPE /sapsrm/wf_process_scheme.
      DATA lv_first_level_id         TYPE os_guid.
      DATA lv_final_acceptance_registered TYPE /sapsrm/wf_conf_attr_val.
      CONSTANTS:
        lc_prc_level_class_name TYPE seoclskey VALUE '/SAPSRM/CL_WF_PROCESS_LEVEL',
        lc_scheme_attribute     TYPE /sapsrm/wf_conf_attr VALUE 'PRC_RSTSCE', " Process restart scheme
        lc_level_attribute      TYPE /sapsrm/wf_conf_attr VALUE 'PRC_RSTLVL'. " Process restart first level
      rv_updated = abap_false.
      lv_document_type = io_process->getdocument_type( ).
      lv_document_guid = io_process->getdocument_guid( ).
      CREATE OBJECT lo_object_service.
      CREATE OBJECT lo_process_config
        EXPORTING
          iv_document_type = lv_document_type
          iv_document_guid = lv_document_guid
          io_process       = io_process.
      lv_process_scheme = lo_process_config->get_process_scheme( ).
      IF lv_process_scheme EQ io_process->getprocess_scheme( ) AND iv_force_update EQ abap_false.
        RETURN.
      ENDIF.
      lv_process_status = /sapsrm/cl_wf_process_manager=>get_process_status( lv_document_guid ).
      "--- Get the OID of the first process level
      TRY.
          lo_runtime_config = /sapsrm/cl_wf_process_manager=>get_runtime_config(
            io_process = io_process
          IF lo_runtime_config IS NOT BOUND.
            RAISE EXCEPTION TYPE /sapsrm/cx_wf_abort.
          ENDIF.
          CLEAR ls_config_value.
          lo_runtime_config->get_attribute(
            EXPORTING
              iv_attribute = lc_level_attribute
            IMPORTING
              es_attribute_result = ls_config_value
          lv_first_level_id = ls_config_value-attribute_value.
        CATCH /sapsrm/cx_wf_error. "EC NO_HANDLER
          CLEAR ls_config_value.
      ENDTRY.
      "-- Get the Flag of FINAL_ACCEPTANCE_REGISTERED
      TRY .
          CLEAR ls_config_value.
          lo_runtime_config->get_attribute(
            EXPORTING
              iv_attribute = /sapsrm/if_wf_process_c=>gc_wf_runtime_attrib_010 "'ACP_FINAL'
            IMPORTING
              es_attribute_result = ls_config_value
          lv_final_acceptance_registered = ls_config_value-attribute_value.
        CATCH /sapsrm/cx_wf_error. "EC NO_HANDLER
          CLEAR ls_config_value..
      ENDTRY.
      "--- Determine current object state of the process instance
      IF ( lo_object_service->is_new_instance( io_process ) EQ abap_true OR
           lo_object_service->is_changed_instance( io_process ) EQ abap_true ) AND
         lv_process_status EQ /sapsrm/if_wf_process_c=>gc_process_status_initial.
        "--- Delete obsolete process levels in case process instance is still in initial state
        lo_temp_level = io_process->getfirst_level( ).
        DO.
          IF lo_temp_level IS NOT BOUND.
            EXIT.
          ENDIF.
         tif this field lo_temp_level->is_last_level( ) is 'X'
    Saravanan

  • After yosemite upgrade junk mail does not work - is this a known issue

    after yosemite upgrade junk mail does not work - is this a known issue?

    Yes, it is a problem.

  • Deployment warning: SC null null not known yet, can not get release level

    Hi everybody,
    During the deployment I'm getting the following warning (application_00.log):
    SC null null not known yet, can not get release level for vendor: 'se.sync', name: 'BPE', location: 'Deployment Manager', counter: '42', change number: 'null'
    BPE is the application name and "se.sync" is the provider-name from application-j2ee-engine.xml.
    This seems to indicate that some release level (version?) is not set... How can this be fixed?
    Regards,
    Milosz

    Hi Milosz,
    the warning is because the deploy controller checks for correct version numbers in the DC/SC that is deployed.
    You can just ignore it, your application should run just fine.
    Regards,
    Christian

  • Why addcomponent and removecomponent method are not in component class,

    Hi,
    why addcomponent and removecomponent method are not in component oand component class,
    Thank you

    java.awt.Container has the appropriate add and remove methods:
    http://java.sun.com/javase/6/docs/api/java/awt/Container.html
    If that seems odd to you, you need to think about the Composite Pattern:
    http://en.wikipedia.org/wiki/Composite_pattern
    [url #" style="display: block; background-image: url('http://upload.wikimedia.org/wikipedia/en/1/13/Compositepattern.png'); width: 406px; height: 271px] 

  • I cannot get it. 10 times already to receive  new passwords today. Adove Download Assistant says  "Unable to invoke CFC - The method login was not found in component tdrc.tdrcfacade.

    I cannot get it. 10 times already to receive  new passwords today. Adove Download Assistant says  "Unable to invoke CFC - The method login was not found in component tdrc.tdrcfacade.
    What can I do? My problem was started from installing Adobe Reader. It says "Done OK" but never installed.
    Elena
    e. [email protected]

    Try using the offline installer from http://get.adobe.com/reader/enterprise/

Maybe you are looking for