Invoking a supersuperclass method

I'd like to invoke the gradparent's version of a method
from a method. For example, the following
public class Test {
public static void main(String[] args) throws Exception {
C c = new C();
c.test();
class A {
void f() {System.out.println("A.f");}
class B extends A {
void f() {System.out.println("B.f");}
class C extends B {
void f() {System.out.println("C.f");}
void test() { ((A)this).f(); }
prints C.f(). I'd like it to display A.f()
Without creating a new A object of course.
super.f() calls B's version, I know, but I'm stumped
as to how to skip over B.
Thanks

You can't do that, and if you want to do that there is
a good chance you have a problem with your design.No kidding. I'm trying to workaround a "design problem" in existing
code where the skip is the best way to bury the problem.
I probably should have made that point in the original post,
as it didn't take long for someone to notice. Reflection doesn't
even help, and I know the JLS points out method invocation is
always sensitive to the runtime type of the object. Still, I was
hoping there is some clever mechanism.

Similar Messages

  • Java.lang.NoSuchMethodError while invoking web service method

    Hi, I have a web service which has two methods exposed as
    A and B.
    I deployed it on weblogic server (7.0 SP4) and fired teh request when I got this error:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <env:Header/>
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring/>
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.NoSuchMethodError
    I tried deploying the web service on another instance and there the method A was invoked but I got the same error when I tried invoking B.
    I tried it on third instance and there both the methods were successfully invoked.
    The methods A and B name start with capital letter (someone told me that method name should not start with capital letter but that does not hold good here)
    Any idea why this starnge behavior of web service?

    Hi Guys,
    I have solved the above issue by applying the PATCH 1 & PATCH 2 of the
    BPEL 10.1.2 version .
    Thanks
    Kalyan

  • Strange about invoking web service method declared “string  method(void)”;

    Dear forum readers
    I’m experimenting with OpenESB and web services. I’ve create a simple web service using NetBeans 6.1. The method consists of a single method, getTime, that is declared:
    String getTime()
    My current experiment is to invoke this method from a BPEL-process using the “Invoke” process object. The strange thing is that it seems like I have to provide a “dummy” inbound variable from the BPEL-designer even though the method doesn’t take any parameters. I include a snippet from the BPEL process below which includes the section where I set the dummy GetTimeIn-variable and then invokes the WS method getTime().
    <assign name="Assign2">
    <copy>
    <from>'DummyValue'</from>
    <to variable="GetTimeIn" part="parameters"/>
    </copy>
    </assign>
    <invoke name="Invoke1" partnerLink="PartnerLink1" operation="getTime" xmlns:tns="http://ws/" portType="tns:MyWebService" outputVariable="GetTimeOut" inputVariable="GetTimeIn"/>
    If I don’t initiate the dummy variable or remove it altogether, I can’t successfully call the method. If I include the dummy in-parameter the call works just fine and I get back the current time as a string.
    I must admit that I’m still a rookie to web services, especially when calling them from a BPEL-process, so it may be a very trivial reason for this behaviour. Anyway, any help on this matter would be greatly appreciated.
    Regards, Ola

    Thank you both for the response. Regarding Rennay’s posting I have an additional question. When I create a new web service I don't have the "Document Literal" option nor a "Concrete Configuration" tab. I've created the web service using the "Web Application" project type and then adding a web service using the "Web Service..." wizard. This wizard doesn't have the configuration properties you mention, but if I add a WSDL-file to a BPEL-project the wizard has the properties you mention.
    Is it possible to create a web service, programmed as an ordinary Java-class, from an existing WSDL-file? In that case it may solve the problem with the “Document Literal” property. Currently I don’t know any other way to create such a web-service other than the through the web service wizard in a web application project. Of course, it’s possible to craft it from scratch but that’s to much work to be practical.
    Regards, Ola

  • Obiee 11.1.1.6  Actions- Invoke a Java Method screen is empty

    Hi All,
    I have created and deployed an EJB for obiee11g by using the example provided in the below link
    http://www.rittmanmead.com/2010/09/oracle-bi-ee-11g-action-framework-java-ejbs-and-pdf-watermarks/
    I have mapped oracle.bi.actions also
    But I am not able to see the java method in the obiee11g Actions- Invoke a Java Method screen .The screen is empty
    I have configured the ActionFrameworkConfig.xml as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <obi-action-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="afconfig.xsd">
    <aliases/>
    <registries>
    <registry>
    <id>reg05</id>
    <name>WaterMark EJBS</name>
    <content-type>java</content-type>
    <provider-class>oracle.bi.action.registry.java.EJBRegistry</provider-class>
    <description>WaterMark BIEE</description>
    <location>
    <path/>
    </location>
    <custom-config>
    <ejb-targets>
    <appserver>
    <context-factory>weblogic.jndi.WLInitialContextFactory</context-factory>
    <jndi-url>t3://localhost:9704</jndi-url>
    <server-name>localhost</server-name>
    <account>WLSJNDI</account>
    <ejb-exclude>mgmt</ejb-exclude>
    <ejb-exclude>PopulationServiceBean</ejb-exclude>
    </appserver>
    <ejb-app>
    <server>localhost</server>
    <app-context>watermark</app-context>
    </ejb-app>
    </ejb-targets>
    </custom-config>
    </registry>
    </registries>
    <content-types>
    <content-type>
    <typename>webservices</typename>
    <displayname>Web Services and BPEL Processes</displayname>
    <actionType>WebServiceActionType</actionType>
    </content-type>
    <content-type>
    <typename>misc</typename>
    <displayname>Mixed Services</displayname>
    <actionType>URLActionType</actionType>
    </content-type>
    <content-type>
    <typename>java</typename>
    <displayname>Java Services</displayname>
    <actionType>JavaActionType</actionType>
    </content-type>
    </content-types>
    <accounts>
    <account>
    <name>WLSJNDI</name>
    <description>Account used to access WLS JNDI.</description>
    <adminonly>false</adminonly>
    <credentialkey>JNDIUser</credentialkey>
    <credentialmap>oracle.bi.actions</credentialmap>
    </account>
    </accounts>
    </obi-action-config>
    Please help me to resolve this issue
    Regards
    Deepz

    1. check your t3 port no, in my case it's 7001.
    so i changed "<jndi-url>t3://localhost:9704</jndi-url>" to "<jndi-url>t3://localhost:7001</jndi-url>"
    2. if you run obiee 11.1.1.6.0 above, you don't need below.
    <credentialmap>oracle.bi.actions</credentialmap>
    so please drop this line.
    3. restart your server and check there's no error log when loading ActionFrameworkConfig.xml.
    Good Luck !!!

  • Invoking the main() method of a class within another

    Greetings -
    Can someone tell me what happens when you invoke the main() method of a class from within another class?
    I have a third-party class, designed to be invoked from a command line, that I want to invoke from within a separate class. What appears to be happening is that following the successful execution of the third-party class, the invoking class is terminated as well. That's not the intended behavior I had envisioned. ^_^
    Is there a better way than invoking the main() method? I still need the invoking class to continue executing.
    Thanks!

    Navigate yourself around pitfalls related to the Runtime.exec() method

  • 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.

  • How to Invoke two java methods parallaly

    Hi,
    I need to invoke two Java methods parallaly ,for example if i am having two methods in a class
    public class Test {
        public Test() {
        public static void main(String[] args)
        Test test = new Test();
        String returnString1 = test.test1();
        String returnString2 = test.test2();
        public String test1(){
        String newString1 = "";
        return newString1;
        public String test2(){
        String newString2 = "";
        return newString2;
    }if i run the above class two methods will be invoked one by one(Sequentially).is there any possibility to invoke these two methods parallaly (ie) both methods need to be invoked at the same time.

    import java.lang.reflect.Method;
    class Paralell implements Runnable{
          private Object srcObject;
          private String methodName;
          private Class parameterTypes[];
          private Object parameterArgs[];
          private Object returnObject;
          public Paralell(Object srcObject, String methodName, Class parameterTypes[], Object parameterArgs[]){
              this.srcObject = srcObject;
              this.methodName = methodName;
              this.parameterTypes = parameterTypes;
              this.parameterArgs = parameterArgs;
          public Object getReturnObject(){
             return this.returnObject;
          public void run(){
               Method method = null;
                try{
                    method =  srcObject.getClass().getDeclaredMethod(this.methodName,this.parameterTypes);
                    this.returnObject =method.invoke(this.srcObject,this.parameterArgs);  
                }catch(Exception exp){
                   exp.printStackTrace();
                }finally{
                    method = null;
    }

  • Invoking a procedure/method via a string

    I know this is probably a long shot, but I will ask anyway...
    What I would like to do is invoke a procedure/method in a class/package which is not the current one by building a string which makes up the call and the parameters and then running it somehow. PLUS, I would like to receive a return value or object from the call....
    eg.
    String command = "getname(id)";
    retval = dummy.execute(command);
    I have looked at RMI, but it does not seem to go this far...
    suggestions would be much appreciated...

    I know this is probably a long shot, but I will ask
    anyway...
    [snip]
    I have looked at RMI, but it does not seem to go this
    far...
    suggestions would be much appreciated...What you are looking for is not RMI, but Reflection.
    Specifically, you will be performing roughly the steps, as explained by calling the String.indexOf(String) method...// import java.lang.reflect.*;
    // Identify the object being called
    Object methodOwner = "This is a test";
    // Identify the class containing the method definition
    Class methodClass = String.class;
    // Identify the method parameters
    Class[] paramTypes = new Class[] { String.class };
    // Find the method *1
    Method method = methodClass.getMethod("indexOf", paramTypes);
    // Create the argument list
    Object[] params = new Object[] { "test" };
    // Invoke the method *2
    Object result = method.invoke(methodOwner, params);
    System.out.println(result); // Prints the Integer with value 10Note that exceptions may be thrown at marks *1 and *2, of which the InvocationTargetException at *2 will probably of most interest, meaning that an exception ocurred in the method being invoked - the exception that was thrown can be found by the getTargetException() method on the InvocationTargetException.
    Hope this helps,
    -Troy

  • FATAL ERROR in native method: Wrong method ID used to invoke a Java method

    When calling the same method second time , I get message ::
    <FATAL ERROR in native method: Wrong method ID used to invoke a Java method>
    void myFunction(int myVal)
    JNIEnv *env = NULL;
    jclass odbcconnls;
    jint res;
    printf("\nInitilaizing class ");
    res = (jvm)->AttachCurrentThread((void **)&env,NULL);
    if (res < 0) {
    fprintf(stderr, "Can't get Env \n");
    (jvm)->DestroyJavaVM();
    return SQL_ERROR;          
    if(res == JNI_OK)
    printf("\nThe env is initialized ");
    if(*(&env) == NULL)
    printf(" the env is NULL ");
    printf("\nenv :::::: %s ", env);     
    // the jobject (dbc->actualConn) is a global reference
    odbcconnls = (env)->GetObjectClass(dbc->actualConn);
    if (odbcconnls == NULL) {
    goto destroy;
    switch(myVal){
    case 1:
    jmethodID methodId ;
    jboolean jbool;
    SQLINTEGER Val = (SQLINTEGER )Value;
    SQLINTEGER val1 = *Val;
    methodId = (env)->GetMethodID( odbcconnls,"myFun1","(Z)V");
    if(methodId == NULL){
    goto destroy;
    if(val1 == SQL_FALSE )
    jbool = 0;
    else
    jbool =1;
    env->CallVoidMethod(dbc->actualConn,methodId,jbool);
    env->DeleteLocalRef((jobject)res);
    env->DeleteLocalRef((jobject)odbcconnls);
    env->DeleteLocalRef((jobject)methodId);
    jvm->DetachCurrentThread();
    return ;
    case 2 :
    jmethodID methodId1 ;
    SQLUINTEGER* Level;
    methodId1 = (env)->GetMethodID( odbcconnls,"myFun2","(I)V");
    if(methodId1 == NULL){
    goto destroy;
    Level = (SQLUINTEGER *)Value;
    env->CallVoidMethod(dbc->actualConn,methodId1,(int)*Level);
    dbc->txn_isolation = (SQLUINTEGER)Value;
    env->DeleteLocalRef((jobject)res);
    env->DeleteLocalRef((jobject)odbcconnls);
    env->DeleteLocalRef((jobject)methodId1);
    jvm->DetachCurrentThread();
    return ;
    case 3 :
    SQLCHAR* Cate;
    jmethodID methodId2 ;
    jstring jStrCat;
    methodId2 = (env)->GetMethodID(odbcconnls,"myFun3","(Ljava/lang/String;)V");
    if(methodId2 == NULL){
    goto destroy;
    Cate = new SQLCHAR[20];
    strcpy((char *)CCatalog,(char *)Value);
    jStrCat = env->NewStringUTF((char *) Cate);
    printf("\n got jSTring ");
    env->CallVoidMethod(dbc->actualConn,methodId2,jStrCat);
    printf("\n after called method ");
    int len = strlen((char *)Cate);
    dbc->Cate = new SQLCHAR[len+1];
    strcpy((char *)dbc->Cate,(char *)Cate);
    printf("\n copied result ");
    env->DeleteLocalRef((jobject)res);
    env->DeleteLocalRef((jobject)odbcconnls);
    env->DeleteLocalRef((jobject)methodId2);
    jvm->DetachCurrentThread();
    return ;
    destroy:
    if ((env)->ExceptionOccurred()) {
    (env)->ExceptionDescribe();
    jvm->DetachCurrentThread();
    (jvm)->DestroyJavaVM();
    return SQL_ERROR;
    When case 1 is called second time this error is thrown..
    plz help me..
    Thanx
    MittalSunita.

    When calling the same method second time , I get
    message ::
    <FATAL ERROR in native method: Wrong method ID used
    d to invoke a Java method>
    void myFunction(int myVal)
    JNIEnv *env = NULL;
    jclass odbcconnls;
    jint res;
    printf("\nInitilaizing class ");
    res = (jvm)->AttachCurrentThread((void **)&env,NULL);
    if (res < 0) {
    fprintf(stderr, "Can't get Env \n");
    (jvm)->DestroyJavaVM();
    return SQL_ERROR;          
    if(res == JNI_OK)
    printf("\nThe env is initialized ");
    if(*(&env) == NULL)
    printf(" the env is NULL ");
    printf("\nenv :::::: %s ", env);     
    // the jobject (dbc->actualConn) is a global
    reference
    odbcconnls = (env)->GetObjectClass(dbc->actualConn);
    if (odbcconnls == NULL) {
    goto destroy;
    switch(myVal){
    case 1:
    jmethodID methodId ;
    jboolean jbool;
    SQLINTEGER Val = (SQLINTEGER )Value;
    SQLINTEGER val1 = *Val;
    methodId = (env)->GetMethodID(
    ( odbcconnls,"myFun1","(Z)V");
    if(methodId == NULL){
    goto destroy;
    if(val1 == SQL_FALSE )
    jbool = 0;
    else
    jbool =1;
    env->CallVoidMethod(dbc->actualConn,methodId,jbool);
    env->DeleteLocalRef((jobject)res);
    env->DeleteLocalRef((jobject)odbcconnls);
    env->DeleteLocalRef((jobject)methodId);
    jvm->DetachCurrentThread();
    return ;Why do you delete a local reference???
    Did you ever call the get local reference?
    case 2 :
    jmethodID methodId1 ;
    SQLUINTEGER* Level;
    methodId1 = (env)->GetMethodID(
    ( odbcconnls,"myFun2","(I)V");
    if(methodId1 == NULL){
    goto destroy;
    Level = (SQLUINTEGER *)Value;
    env->CallVoidMethod(dbc->actualConn,methodId1,(int)*Le
    el);
    dbc->txn_isolation = (SQLUINTEGER)Value;
    env->DeleteLocalRef((jobject)res);
    env->DeleteLocalRef((jobject)odbcconnls);
    env->DeleteLocalRef((jobject)methodId1);
    jvm->DetachCurrentThread();
    return ;
    case 3 :
    SQLCHAR* Cate;
    jmethodID methodId2 ;
    jstring jStrCat;
    methodId2 =
    (env)->GetMethodID(odbcconnls,"myFun3","(Ljava/lang/St
    ing;)V");
    if(methodId2 == NULL){
    goto destroy;
    Cate = new SQLCHAR[20];
    strcpy((char *)CCatalog,(char *)Value);
    jStrCat = env->NewStringUTF((char *) Cate);
    printf("\n got jSTring ");
    env->CallVoidMethod(dbc->actualConn,methodId2,jStrCat)
    printf("\n after called method ");
    int len = strlen((char *)Cate);
    dbc->Cate = new SQLCHAR[len+1];
    strcpy((char *)dbc->Cate,(char *)Cate);
    printf("\n copied result ");
    env->DeleteLocalRef((jobject)res);
    env->DeleteLocalRef((jobject)odbcconnls);
    env->DeleteLocalRef((jobject)methodId2);
    jvm->DetachCurrentThread();
    return ;
    destroy:
    if ((env)->ExceptionOccurred()) {
    (env)->ExceptionDescribe();
    jvm->DetachCurrentThread();
    (jvm)->DestroyJavaVM();
    return SQL_ERROR;
    When case 1 is called second time this error is
    thrown..
    plz help me..
    Thanx
    MittalSunita.

  • 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/

  • Oracle BI EE 11g – Action Framework - Invoke a Java Method from Action links

    Hello All,
       I have a requirement to save OBIEE 11g report into shared drive. I have created a EJB by using the below link and successfully deployed the application in server(bi_server1) .
    http://www.rittmanmead.com/2010/09/oracle-bi-ee-11g-action-framework-java-ejbs-and-pdf-watermarks/
    When Im trying to call Invoke a Java method, it is showing "No Content" . Can anybody please share with me the sample "ActionFrameworkConfig.xml" file used for Invoke a Java method.
    My OBIEE version is : 11.1.1.7.131017
    Thanks.

    1. check your t3 port no, in my case it's 7001.
    so i changed "<jndi-url>t3://localhost:9704</jndi-url>" to "<jndi-url>t3://localhost:7001</jndi-url>"
    2. if you run obiee 11.1.1.6.0 above, you don't need below.
    <credentialmap>oracle.bi.actions</credentialmap>
    so please drop this line.
    3. restart your server and check there's no error log when loading ActionFrameworkConfig.xml.
    Good Luck !!!

  • 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

  • Invoking Business Service method which takes Hierarchy / Integration Object

    Hi,
    I want to invoke Business Service methods using JDB API invokeMethod(). There are some methods which take Hierachy/Integration object as argument. The question here is how do I creat and pass these arguments?
    Following two are the methods which take these arguments.
    1)[Hierarchy]
    Business Service:
    SHM Calculate Tax
    Method:
    SumCalculateTax
    Args:
    CalculateTax - Hierarchy - Input
    ForWhich - String- Input
    GetSubTaxCodes - Number- Output
    GetTaxCodes - Number- Output
    2)[Integration Object]
    Business Service:
    External Contact
    Method : Update
    Args :
    SiebelMessage - Integration Object - Input / Output
    Can you direct me to some sample code please?
    Thanks,
    ram

    Thank you both for the response. Regarding Rennay’s posting I have an additional question. When I create a new web service I don't have the "Document Literal" option nor a "Concrete Configuration" tab. I've created the web service using the "Web Application" project type and then adding a web service using the "Web Service..." wizard. This wizard doesn't have the configuration properties you mention, but if I add a WSDL-file to a BPEL-project the wizard has the properties you mention.
    Is it possible to create a web service, programmed as an ordinary Java-class, from an existing WSDL-file? In that case it may solve the problem with the “Document Literal” property. Currently I don’t know any other way to create such a web-service other than the through the web service wizard in a web application project. Of course, it’s possible to craft it from scratch but that’s to much work to be practical.
    Regards, Ola

  • UnsatisfiedLinkError invoke of native method

    Hi,
    When the native method is invoked in the same Classloader as the native library is loaded, then everything is ok :-)
    But when the native method is invoked in a "child" of the ClassLoader, which has loaded the native library, then a
    java.lang.UnsatisfiedLinkError: <methodname>
    is thrown.
    Has anybody an idea?
    Thank you for your assistance
    Johannes Rameder

    Hi,
    Here is a small test example for solaris for better understanding.
    I have tested this with solaris 9.
    Put all files in a directory asst/test
    ---JNISmallTestHelper.java---
    package asst.test;
    public class JNISmallTestHelper {
      public JNISmallTestHelper() {
        printClassLoaderChain(this);
        JNISmallTest tmp = new JNISmallTest();
        int i = tmp.NoArgs();
        System.out.println("result of NoArgs is "+i);
      private static void printClassLoaderChain(Object o) {
        for (ClassLoader cl = o.getClass().getClassLoader(); cl != null; cl = cl.getParent()) {
          System.out.println("H: "+cl.toString());
    ---JNISmallTest.java---
    package asst.test;
    public class JNISmallTest {
      public JNISmallTest() {
        printClassLoaderChain(this);
      public native int NoArgs();
      private static void printClassLoaderChain(Object o) {
        for (ClassLoader cl = o.getClass().getClassLoader(); cl != null; cl = cl.getParent()) {
          System.out.println("J: "+cl.toString());
    ---JNISmallTestMain.java---
    package asst.test;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class JNISmallTestMain {
      public JNISmallTestMain() {
        try {
          System.out.println("system "+ClassLoader.getSystemClassLoader());
          printClassLoaderChain(this);
          System.loadLibrary("JNITest");
          URLClassLoader ucl = new URLClassLoader(new URL[] {new URL("file:JNITest.jar")});
          ucl.loadClass("asst.test.JNISmallTestHelper").newInstance();
        } catch (Exception e) {
          System.out.println("Load exception " + e.toString());
          e.printStackTrace();
      public static void main (String[] args) {
        new JNISmallTestMain();
      private static void printClassLoaderChain(Object o) {
        for (ClassLoader cl = o.getClass().getClassLoader(); cl != null; cl = cl.getParent()) {
          System.out.println("M: "+cl.toString());
    ---JNITest.c---
    #define JNITest_c
    static char rcsid[] = "$Id:$";
    #include <stdio.h>
    #include <stdlib.h>
    #include "JNITest.h"
    JNIEXPORT jint JNICALL Java_asst_test_JNISmallTest_NoArgs (JNIEnv * env, jclass cls) {
       printf("*Called NoArgs in shared C library*\n");
       return 5;
    ---makeNOK.sh---
    rm -rf *.class *.jar *.so *.o *.h TestMain
    javac -classpath ../.. *.java
    javah -classpath ../.. -o JNITest.h asst.test.JNISmallTest
    cd ../..
    jar cvf asst/test/JNITest.jar asst/test/JNISmallTestHelper.class asst/test/JNISmallTest.class
    cd asst/test
    rm JNISmallTestHelper.class
    rm JNISmallTest.class
    gcc -g -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -c *.c
    gcc -g -fPIC -shared -W1 --soname=libJNITest.so JNITest.o -o libJNITest.so
    gcc -g -fPIC -L. -lJNITest TestMain.o -o TestMain
    ---makeOK.sh---
    rm -rf *.class *.jar *.so *.o TestMain
    javac -classpath ../.. *.java
    javah -classpath ../.. -o JNITest.h asst.test.JNISmallTest
    cd ../..
    jar cvf asst/test/JNITest.jar asst/test/JNISmallTestHelper.class
    cd asst/test
    rm JNISmallTestHelper.class
    gcc -g -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -c *.c
    gcc -g -fPIC -shared -W1 --soname=libJNITest.so JNITest.o -o libJNITest.so
    gcc -g -fPIC -L. -lJNITest TestMain.o -o TestMain
    ---run.sh---
    export LD_LIBRARY_PATH=.:/usr/lib:/usr/local/lib
    echo "#start test with java"
    java -cp ../.. asst.test.JNISmallTestMain
    echo
    echo "#start test with C"
    TestMain
    ---TestMain.c---
    #define testmain_c
    static char rcsid[] = "$Id: TestMain.c,v 1.4 2004/03/16 20:20:54 neiExp $";
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    int main(int argc, char** argv) {
       printf("Calling NoArgs from C Main Program\n");
       printf("NoArgs returned %d to calling C program\n",
          Java_asst_test_JNISmallTest_NoArgs(0, 0));
       printf("After NoArgs call\n");
       exit(0);
    }call makeOK.sh and run.sh
    #start test with java
    system sun.misc.Launcher$AppClassLoader@10dd1f7
    M: sun.misc.Launcher$AppClassLoader@10dd1f7
    M: sun.misc.Launcher$ExtClassLoader@53c015
    H: java.net.URLClassLoader@108786b
    H: sun.misc.Launcher$AppClassLoader@10dd1f7
    H: sun.misc.Launcher$ExtClassLoader@53c015
    J: sun.misc.Launcher$AppClassLoader@10dd1f7
    J: sun.misc.Launcher$ExtClassLoader@53c015
    Called NoArgs in shared C library
    result of NoArgs is 5
    #start test with C
    Calling NoArgs from C Main Program
    Called NoArgs in shared C library
    NoArgs returned 5 to calling C program
    After NoArgs call
    Here you can see that the classloader which loads the native library is the same as the classloader which loads the class who invokes the native method.
    then call makeOK.sh and run.sh
    #start test with java
    system sun.misc.Launcher$AppClassLoader@10dd1f7
    M: sun.misc.Launcher$AppClassLoader@10dd1f7
    M: sun.misc.Launcher$ExtClassLoader@53c015
    H: java.net.URLClassLoader@108786b
    H: sun.misc.Launcher$AppClassLoader@10dd1f7
    H: sun.misc.Launcher$ExtClassLoader@53c015
    J: java.net.URLClassLoader@108786b
    J: sun.misc.Launcher$AppClassLoader@10dd1f7
    J: sun.misc.Launcher$ExtClassLoader@53c015
    Exception in thread "main" java.lang.UnsatisfiedLinkError: NoArgs
    at asst.test.JNISmallTest.NoArgs(Native Method)
    at asst.test.JNISmallTestHelper.<init>(JNISmallTestHelper.java:9)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:308)
    at java.lang.Class.newInstance(Class.java:261)
    at asst.test.JNISmallTestMain.<init>(JNISmallTestMain.java:18)
    at asst.test.JNISmallTestMain.main(JNISmallTestMain.java:28)
    #start test with C
    Calling NoArgs from C Main Program
    Called NoArgs in shared C library
    NoArgs returned 5 to calling C program
    After NoArgs call
    The classloaders are different.

  • Can a applet to invoke a JavaScript method?

    I have a javascript method like:
    <script language="JavaScript">
    function openURL(strUrl) {
    window.open(strUrl, "statusbar=no, scrollbar=no");
    </script>
    Can a applet to invoke the JavaScript method above sending "strUrl" parameter?

    Yes.
    http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/java_js.html

Maybe you are looking for

  • Iscsi in Solaris 5.10.1 express 3/05

    Since Solaris 10 express (5.10.1) 3/05 (start from 2/05), iscsiadm is provided as isci initiator; I have a Cisco iscsi SN5428 router, (the storage is Sun StorEdge 9980) I have some solaris 9 iscsi clients setup in our enviroment using the Cisco iscsi

  • Wrt54g v8 always losing connection

    I have a WRT54G V8 with a ARRIS modem connected with videotron and every 15 minutes, my router power light starts flashing then I lose the internet connection. I always have to unplugged then plugged my router to get internet connection again. Someon

  • Rollbacking in A Trigger

    Hi guys!! again I need some help. I have a table t. I am writing a trigger that fires when a tuple is inserted in t. This trigger should check some condition and if that is not satisfied it should disallow the insertion in t. But if I put rollback in

  • $80 Apple in-ear headphones not working with iPhone 4

    I spent $80 on a pair of in ear headphones and they do not work with iPhone 4. I can listen to music and talk but the volume controls are completely nonfunctional. So I used them on my friends 3GS and they work fine. How can Apple come out with a new

  • Select Max Rno Records

    I have following data select  * from retreport   CODE VDATE        STAT  ICODE INAME   FCODE FNAME        IAMOUNT        UNITS          AVG       UBAL           ABAL        Rno    108 28/06/2010    I     1    ABC      1    MCMOF   67107445.99      65