Factory, Factory Method etc.. - method name conventions?

hi,
this might be a minor point but is there a convention for naming methods whose job is a level of indirection for obtaining new objects? in the java libraries there are methods that do this with various names eg.
newMyObject()
createMyObject()
and i think i've seen
getMyObject() somewhere (not as a normal getter but as an object creator) but will check..
thanks,
asjf

Based on code I have seen, both in real work and on the Web, I'd say that there are only organization-wide , if not personal, conventions - no universal naming scheme - so you'll probably get only personal feelings.
As for a general convention, I have seen all forms you propose, so none of it is either a defacto standard, nor universally rejected...
As for my personal (but argumented) feelings:
I favor getMyObject(), as it's rarely misleading, especially if it's already in a Factory class. This way, a factory method implementation will have the freedom to create a new object or reuse an existing one.
Actually it's not very different from getters, whose point is to return a "property" value, no matter whether this value is calculated or stored.
The createMyObject() flavor is a bit too explicit to allow for reusing of cached or recycled objects, but it is the clearest form for a factory method that would by design be required to always return a newly created object.
The newMyObject() form has the same overspecifying drawback, plus the additional flaw of being easy to misread - and actually understood as a constructor invocation. So I avoid it - and frown when I see it.
I sometimes use getOrCreateMyObject(), though not exactly as a factory method, rather for getters of a property I don't want to be null (and which has a reasonable default value, of course).
I must admit, this hasn't got a huge enthusiasm from my colleagues either...

Similar Messages

  • Two methods with same name but different return type?

    Can I have two methods with same name but different return type in Java? I used to do this in C++ (method overloading or function overloading)
    Here is my code:
    import java.io.*;
    public class Test{
    public static void main(String ar[]){
    try{          
    //I give an invalid file name to throw IO error.
    File file = new File("c:/invalid file name becasue of spaces");
    FileWriter writer = new FileWriter(file ,true);
    writer.write("Test");
    writer.close();     
    } catch (IOException IOe){
         System.out.println("Failure");
    //call first method - displays stack trace on screen
         showerr(NPe);
    //call second method - returns stack trace as string
            String msg = showerr(NPe);
            System.out.println(msg);
    } // end of main
    public static void showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         String stackTrace = sw.toString();
         System.out.println("Null Ptr\n" +  stackTrace );
    }//end of first showerr
    public static String showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         return sw.toString();
    }//end of second showerr
    } // end of class
    [\code]

    Overloading is when you have multiple methods that have the same name and the same return type but take different parameters. See example
    public class Overloader {
         public String buildError(Exception e){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( e.getClass().getName() )
                   .append( " : " )
                   .append( e.getMessage() ) ;
              return buffer.toString() ;
         public String buildError(String msg){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( msg ) ;
              return buffer.toString() ;
         public String buildErrors(int errCount){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( "There have been " )
                   .append( errCount )
                   .append( " errors encountered.")  ;
              return buffer.toString() ;
    }Make sense ???
    Regards,

  • No event method with matching name and signature found on EventSet

    Dear,
    I have this error in the Problems view in Workshop (I'm using the Weblogic 9.2.1) :
    No event method with matching name and signature found on EventSet: com.bea.control.TaskControl.Callback.
    This error occurs sometimes when I put an event on a task in a process definition. Example, I have a process : Application.java, when I put the onReceptionCompleted control (receive) in my process, the error appears!
    Thanks for your help,
    Regards,
    Mathieu

    It is a problem with the drap & drop in Workshop (from the taskControl to the Process). Workshop automatically inserts a wrong eventSet instead of the good one from the generated task control !
    See you,
    Mathieu

  • Class extends two interface which have method in common name

    A class implements two interfaces. Those interfaces have method in common name.
    For ex;
    public interface b{public void hello();}
    public interface c{public void hello();}
    public class a implements b,c
    public void hello(){}
    Since two interfaces have common method, How to differentiate in this case ?

    How to differentiate what? You have to provide a method called hello(), just as in your example. (Normally you would have code in the method body, but zero lines of code is not against the rules.)

  • File name convention when accessing NI 9802 from RT Host vi.

    I have a question regarding the file name convention to use when writing files to a NI 9802 module. 
    Just to note, I'm using a 9014 controller with a 9104 chassis, LabVIEW 8.6 RT/FPGA, and NI-RIO 3.0.
    I've read a post regarding the subject.  The post says to use the DOS 8.3 naming convention in the form of "CRIO-X##.BIN".  All uppercase letters.  See http://digital.ni.com/public.nsf/allkb/D15720EB0F60FAC58625732700070081.  (Also, I guess from reading the post that you're limited to 255 files per directory, maybe?)  The built in example for writing data to a file on the 9802 from a RT Host vi shows using "Example.txt" as the filename.  However, the built in example for writing directly to the 9802 from the FPGA using Methods does use the "CRIO-X##.BIN" convention.
    I guess what I'd like to know is this:  Does writing data to the 9802 from the RT Host vi require using the "CRIO-X##.BIN" convention (to be efficient, anyways)?  I was hoping to use filenames that actually had the date/time in the name (e.g. Node2_09_04_59__10_30_2008.txt).  Does the "CRIO-X##.BIN" convention (DOS 8.3) only need to be used when writing directly to the 9802 through Method Nodes?
    I'm not writing lots of data real fast, but rather, recording some data for long periods of time (many days).  Additionally, I plan on writing the data as text.
    Any info would be appreciated.  Thanks.
    Stephen

    Hi Stephen,
    The CRIO-X##.BIN naming restriction comes only from the limitations of the FPGA.  We sometimes encourage people to follow this naming convention only because we don't want people using RT to suddenly realize they'd now like to use it from FPGA and now they have to rename all their files.  If you are only using 9802 from RT you can names your files anything that's valid in the FAT16 filesystem.  This includes names that are longer than 8.3.
    The reason for all this is that in the FPGA case, the entire filesystem must be implemented on the FPGA.  We have to make lots of trade offs for FPGA space.  When you use the 9802 from RT the filesystem is implemented on the controller and is a more complete implementation.
    You are also correct that from FPGA you are limited to 255 files.  Post again if you have any other 9802 questions.
    Ross
    cRIO R&D 
    Ross Houston
    Senior Software Engineer
    RIO Software R&D

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

  • ABAP OO: methods as method params, method chains

    Hello all,
    I am currently developing quite much ABAP OO and wonder if this is possible, because I got compilation errors.
    a) Methods as method params w/o temp vars:
    I have a method whose parameter shall be the return value (let s say a string) shall be the parameter:
    document->set_owner( owner = person->get_name( ) ).
    This throws an error and I have to code this instead
    data: owner type String.
    ownerString = person->get_owner( ).
    document->set_owner( owner = ownerString ).
    ... so I have always a temp variable which is getting MUCH overhead when having such stuff often...
    Am I doing wrong or is this impossible in ABAP OO? ...am used to do such things in all other languages I know... mean, that methods can be params of other methods.
    b) "chaining of methods"
    Is this possible somehow?:
    data: tmp type String.
    tmp = employee->get_orgUnit( )->get_name( ).
    Calling one level (the get_OrgUnit() method) works fine, but an immediate call to the second level ( get_name() method) fails and I have to code this:
    data: tmp     type String,
          orgUnit type ZOrgUnit.
    orgUnit = employee->get_orgUnit( ).
    tmp = orgUnit->get_name( ).
    This also very annoying to have so much temporary help variables on the way.
    Is there any help for me?
    Thank you for any hints and reagrds,
    Timo

    Hi Timo,
    as Richard's reply says it's impossible in ABAP-OO. The nature of this language is ABAP not OO
    Only helpful for you, could be the returning parameter. It's very useful in conditional expressions like
    if m1->a() = '2'.
    A preferred parameter to avoid writing parameter names like
    m1->b( '2' ).
    All other useful stuff of method or parameter chaining, and so on is NOT possible. Sorry.

  • Passing methods as methods arguments

    Hi,
    how can I pass a method to another method?
    I need something like this:
    public void methodA() {
    System.out.println("Hallo world");
    public void methodB( Method method ) {
    method();
    // or
    method.invoke();
    and in my app:
    methodB( methodA );
    ...of course the code below didn't work :-D
    Thanks.

    sorry, I didn't understood very well the 'inteface
    aproach'. Do you have some example code?If the name of the method to be called truly needs to be dynamic, then this won't work but if you just want different behaviors, then you could do something like this: public interface Doer {
        void doIt();
    public class Doer1 implements Doer {
        void doIt() {
            // do some stuff
    public class Doer2 implements Doer {
        void doIt() {
            // do some other stuff
    public class DoerDriver {
        public static void main(String[] args) {
            for (int ix = 0; ix < args.length; ix++) {
                try {
                    Class klass = Class.forName(args[ix]);
                    Doer doer = (Doer)klass.newInstance();
                    doStuff(doer);
                catch (Exception exc) {
                    System.out.println("Couldn't do " + args[ix]);
                    exc.printStackTrace();
         * This method only exists to follow your model of passing the "method"--i.e., they dynamic
         * bit--to another method. We could just call doer.doIt() right inside the loop in main.
        private static void doStuff(Doer doer) {
            doer.doIt();
    java DoerDriver Doer1 Doer2 Doer2 Doer1
    Whether this works for you depends on what you're really trying to do.

  • CUSTOM DOCUMENT over internet file name convention

    Hi ,
    I am sending an OAGIS xml file(CUSTOM DOCUMENT over internet) through interal delivery channel to our supplier, I am getting an below error.
    I got the same error while processing an EDI transaction, I change the file name, and then it processed successfully
    ex: Penske_850_4010_1_25
    in the same way for sending an file(CUSTOM DOCUMENT over internet) , do we have any file naming convention
    I tried with Benchmark_850_4010_1_25, it showing a 2nd error.
    Please help me to resolve this
    Machine Info: (essapp000-u008.emrsn.com)
    Description: Make sure the trading partner has name, type, and value information
    StackTrace:
    Error -: AIP-50548: Trading partner agreement lookup failed as From trading partner cannot be identified
         at oracle.tip.adapter.b2b.tpa.TPAIdentifier.identifyTPA(TPAIdentifier.java:199)
         at oracle.tip.adapter.b2b.tpa.TPAProcessor.processTPA(TPAProcessor.java:589)
         at oracle.tip.adapter.b2b.tpa.TPAProcessor.processOutgoingTPA(TPAProcessor.java:221)
         at oracle.tip.adapter.b2b.engine.Engine.processOutgoingMessage(Engine.java:1061)
         at oracle.tip.adapter.b2b.transport.AppInterfaceListener.onMessage(AppInterfaceListener.java:141)
         at oracle.tip.transport.basic.FileSourceMonitor.processMessages(FileSourceMonitor.java:903)
         at oracle.tip.transport.basic.FileSourceMonitor.run(FileSourceMonitor.java:317)
    and Machine Info: (essapp000-u008.emrsn.com)
    Description: Unable to identify the trading partner agreement from the given input values. Also verify agreement effectiveToDate
    StackTrace:
    Error -: AIP-50547: Trading partner agreement not found for the given input values: From party[NAME] "Emerson", To party[NAME] "Benchmark", Business action name "null"; also verify agreement effectiveToDate
         at oracle.tip.adapter.b2b.tpa.RepoDataAccessor.getAgreementNameByBaTPName(RepoDataAccessor.java:2345)
         at oracle.tip.adapter.b2b.tpa.TPAIdentifier.identifyTPA(TPAIdentifier.java:186)
         at oracle.tip.adapter.b2b.tpa.TPAProcessor.processTPA(TPAProcessor.java:589)
         at oracle.tip.adapter.b2b.tpa.TPAProcessor.processOutgoingTPA(TPAProcessor.java:221)
         at oracle.tip.adapter.b2b.engine.Engine.processOutgoingMessage(Engine.java:1061)
         at oracle.tip.adapter.b2b.transport.AppInterfaceListener.onMessage(AppInterfaceListener.java:141)
         at oracle.tip.transport.basic.FileSourceMonitor.processMessages(FileSourceMonitor.java:903)
         at oracle.tip.transport.basic.FileSourceMonitor.run(FileSourceMonitor.java:317)

    Hi,
    I used to get "Unable to identify the trading partner agreemen" due to below reasions,
    1. Agreement is not deployed properly. Please check whether deployed agreement is in active state.
    2. While creating the Operational Capability, please check whether initiator and responder defined correctly.
    For Outbound, Please check Remote trading partner Is Initiator should be false and Host trading partner Is Initiator should be true.
    As far as I know, File name convention should be folllowed for FTP/File and not for HTTP.

  • Getting problem with DOMImplementation classes method getFeature() method

    hi
    getting problem with DOMImplementation classes method getFeature() method
    Error is cannot find symbol getFeature()
    code snippet is like...
    private void saveXml(Document document, String path) throws IOException {
    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
    problem with getFeature() method

    You are probably using an implementation of DOM which does not implement DOM level-3.

  • FATAL ERROR in native method: Wrong Method ID

    I have a piece of C code from which I am trying to launch a piece of Java, but I am having severe problems just trying to get a simple integer value returned from any Java function. I keep getting the error message "FATAL ERROR in native method: Wrong method ID used to invode a Java method"
    My C code looks like :
    JNIEnv *env;
    long result;
    jmethodID mid;
    jclass cls;
    jobjectArray args;
    jstring jstr;
    jint res;
    jobject myObj;
    options[0].optionString = "-Djava.class.path=.";
    options[1].optionString = "-Djava.compiler=NONE";
    options[2].optionString = "-verbose:jni";
    vm_args.version = JNI_VERSION_1_2;
    vm_args.options = options;
    vm_args.nOptions = 2;
    vm_args.ignoreUnrecognized = JNI_FALSE;
    // Create the Java VM
    result = JNI_CreateJavaVM(&jvm,(void **)&env, &vm_args);
    if (result == JNI_ERR )
    printf("Can't create Java VM\n");
    exit(1);
    else
    printf("Java VM created successfully\n");
    cls = (*env)->FindClass(env, "Example1");
    if (cls == 0){
    printf("Can't find Class\n");
    exit(1);
    else
    printf("Class Found\n");
    mid = (*env)->GetMethodID(env, cls, "GetIntValue", "()I" );
    if (mid == 0) {
    printf("Can't find function\n");
    exit(1);
    else
    printf("Function Found\n");
    res = (*env)->CallIntMethod(env, cls, mid);
    if (res != 0)
    char pszTempString[256] = {'\0'};
    sprintf (pszJavaString, "Returned from Java the value of %d", res);
    printf("Returned from Java with ");
    printf(pszJavaString);
    My GetMethodID call works correctly and I have checked the signature (using javap -s) and that works fine. I've seen many references on these forums about using NewObject prior to calling CallIntMethod, but if I try to use that I then get the error message "FATAL ERROR in native method: a non-constructor passed to NewObject".
    Any body got any ideas please.
    Thanks

    What I couldn't figure out from your code is where you create the java object that is supposed to return the integer to your C code.
    Alternatives:
    o This is just code snippets, and you really are creating the object.
    o Error - the object should have been created.
    o Error - it is a static method, and you should be finding a static method and calling it on a class object.
    (Other than that, I didn't see anything obviously wrong.

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

  • How to get string which is return from a method and method is called from a filter

    Can anyone please guide me how i will get a string on a template, this string value is return by method which is called through 'ValidateStandered' filter.
    My problem is when i CheckIn a document, i am implementing some validation of duplicated document and duplicated document is identified by some metadata value.
    if metadata value of CheckIn document(current document) is same with existing document then filter will return ddocname and ddoctitle of existing document on a template(user can see the ddocname of existing item).

    please find error logs also:
    intradoc.data.DataException: !csDbCouldNotBind,getValueOfDuplicateDocument
            at intradoc.jdbc.JdbcQueryUtils.buildQuery(JdbcQueryUtils.java:107)
            at intradoc.jdbc.JdbcWorkspace.buildQuery(JdbcWorkspace.java:736)
            at intradoc.jdbc.JdbcWorkspace.createResultSet(JdbcWorkspace.java:639)
            at CheckInRestrictionFilter.CheckInRestrictionFilter.getResultSet(CheckInRestrictionFilter.java:108)
            at CheckInRestrictionFilter.CheckInRestrictionFilter.doFilter(CheckInRestrictionFilter.java:57)
            at intradoc.shared.PluginFilters.filterWithAction(PluginFilters.java:114)
            at intradoc.shared.PluginFilters.filter(PluginFilters.java:68)
            at intradoc.server.DocServiceHandler.validateStandard(DocServiceHandler.java:1251)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
            at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
            at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
            at intradoc.server.Service.doCodeEx(Service.java:620)
            at intradoc.server.Service.doCode(Service.java:592)
            at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
            at intradoc.server.Service.doAction(Service.java:564)
            at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1483)
            at intradoc.server.Service.doActions(Service.java:559)
            at intradoc.server.ServiceRequestImplementor.executeSubServiceCode(ServiceRequestImplementor.java:1346)
            at intradoc.server.Service.executeSubServiceCode(Service.java:4109)
            at intradoc.server.ServiceRequestImplementor.executeServiceEx(ServiceRequestImplementor.java:1222)
            at intradoc.server.Service.executeServiceEx(Service.java:4104)
            at intradoc.server.Service.executeService(Service.java:4088)
            at intradoc.server.Service.doSubService(Service.java:3998)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
            at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:310)
            at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)
            at intradoc.server.Service.doCodeEx(Service.java:637)
            at intradoc.server.Service.doCode(Service.java:592)
            at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
            at intradoc.server.Service.doAction(Service.java:564)
            at intradoc.server.Service.doScriptableAction(Service.java:4050)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
            at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:310)
            at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)
            at intradoc.server.Service.doCodeEx(Service.java:637)
            at intradoc.server.Service.doCode(Service.java:592)
            at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
            at intradoc.server.Service.doAction(Service.java:564)
            at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1483)
            at intradoc.server.Service.doActions(Service.java:559)
            at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1415)
            at intradoc.server.Service.executeActions(Service.java:545)
            at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:751)
            at intradoc.server.Service.doRequest(Service.java:1974)
            at intradoc.server.ServiceManager.processCommand(ServiceManager.java:486)
            at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
            at intradoc.idcwls.IdcServletRequestUtils.doRequest(IdcServletRequestUtils.java:1355)
            at intradoc.idcwls.IdcServletRequestUtils.processFilterEvent(IdcServletRequestUtils.java:1732)
            at intradoc.idcwls.IdcIntegrateWrapper.processFilterEvent(IdcIntegrateWrapper.java:223)
            at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at idcservlet.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:87)
            at idcservlet.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:305)
            at idcservlet.common.ClassHelperUtils.executeMethodWithArgs(ClassHelperUtils.java:278)
            at idcservlet.ServletUtils.executeContentServerIntegrateMethodOnConfig(ServletUtils.java:1680)
            at idcservlet.IdcFilter.doFilter(IdcFilter.java:457)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
            at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
            at java.security.AccessController.doPrivileged(Native Method)
            at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
            at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
            at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
            at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
            at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
            at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
            at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
            at java.security.AccessController.doPrivileged(Native Method)
            at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
            at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
            at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
            at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
            at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3739)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3705)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2282)
            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2181)
            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1491)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

  • Name conventions

    Hello Everybody!
    I'd like to know if there is any kind of name conventions manual I can use for naming my XI Objects
    thanks
    Julio

    Hi,
    On service marketplace you can find document with naming convention proposal.
    https://websmp209.sap-ag.de/xi
    https://websmp209.sap-ag.de/~form/sapnet?_FRAME=OBJECT&_HIER_KEY=501100035870000008223&_HIER_KEY=601100035870000111191&_HIER_KEY=601100035870000129125&_HIER_KEY=601100035870000099844&_HIER_KEY=601100035870000161695&_HIER_KEY=701100035871000349972&#HOME
    Regards,
    Wojciech
    Message was edited by: Wojciech Gasiorowski

  • Table name for 'Program name of method' and 'Method name'

    As we know, each method method contains different  program name with ext. like "====CM0001" etc., Where can I find this program name of method in database tables?
    Note: Program names are in REPOSRC with type as 'I' and name as "CLASS NAME======CMXYZ". But here we can not decide with program name belongs to which class!
    Thanks,
    Naveen.I

    Use FM SEO_CLASS_GET_METHOD_INCLUDES. Provide your class name and you will get the method names with include name.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Running a Standard OAF page in Jdeveloper

    Hi, I have configured Jeveloper and designed some of the sample OAF pages. Now i want to view the Standard Supplier Page into my jdeveloper so that i can learn how to modify the standard pages. Can you let me know the step by step procedure of how to

  • How do I change the install language on a MacBook Pro

    Hi folks, I have purchased a 2nd hand MacBook Pro that was using Polish as its default language. I have changed it all back to English, including 'sudo languagesetup' in utilities, however I want to reintsall the OS and when I press Command > R on st

  • Personalize Button to be restricted for a user

    Hi All, My issue is when a user  login to WEBUI  he/she must not be able to see the personalize Button. To restrict  the personalize button is there any SPRO Configuration or we have to do through the code? Thanks & Regards, Venkat

  • AppServer for Intel Solaris

    How about an Intel/x86 platform Solaris version of Sun ONE Application Server?

  • Tune My Mini With OSX

    I've just read, that you can 'tune' you iPod with windows. There are programs like iPodlinux (www.ipodlinux.org) (for more features) GoogleGet (The latest news on you iPod) iPodWizard (for changing fonts and graphics) and MarksMan (for bookmarks). My