Problem with cfobject calling java class

hi there,
i have a small java class that takes 2 arguments in
(fileToRead & fileToWrite) and everything runs fine when i run
the class from the command line...
C:\>java csvParser fileToRead fileToWrite
however when i try to instantiate the class via cfobject like
so :
<cfobject type="Java" action="create" class="csvParser"
name="convert">
<cfset convert.init(#tmpfile#, "text.xml")>
it continuously throws the following error at me :
Unable to find a constructor for class csvParser that accepts
parameters of type ( java.lang.String, java.lang.String ).
any ideas ast to what i may be missing here...startin to
drive me batty.

C:\>java csvParser fileToRead fileToWrite
Suggests you passed arguments as args[0] and args[1] to the
method
public static void main(String[] args)
<cfobject type="Java" action="create" class="csvParser"
name="convert">
<cfset convert.init(#tmpfile#, "text.xml")>
Suggests the code for the class CSVParser has the following
constructor definition:
private String s1, s2;
CSVParser (String s1, String s2) {
this.s1=s1;
this.s2=s2;
This seems unlikely, in view of
"everything runs fine when i run the class from the command
line". One possibility is to convert the
public static void main method into, for example, the public
method
doThemFiles(String s1, String s2), not forgetting to include
the return-type in its signature. You could then run
<cfobject type="Java" action="create" class="csvParser"
name="convert">
<cfset convert.doThemFiles("#tmpfile#", "text.xml")>

Similar Messages

  • How to call java class from pl/sql procedure ?

    Hello everyone,
    My query is..
    There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
    and the other thing is.. oracle is in one machine and java is in another .. :(
    hope ..u can help me out !!
    Thank in advance !!

    but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
    so how to call java class file which is on another machine and oracle in another..

  • Calling java classes from plsql procedures

    I'm attempting to call java classes from plsql procedures which will create cmsdk users, folders, groups etc, however when I attempt to load a java class into the oracle schema using the command:
    loadjava -user user/password@database -resolve classname.class
    It generates error messages to the effect that classes (cmsdk classes) required by the class cannot be found. The class is loaded and marked with the status "invalid". Is it therefore necessary for me to load the cmsdk packages into the schema?
    Cheers
    David

    Using CMSDK Java API within the database has never been supported
    (see Problems loading IFS's java class into database
    When we needed to invoke CMSDK code from our PL/SQL code, we used one of two approaches:
    (1) use advanced queues to send requests to an external Java program (the CMSDK code, running outside the database) and receive the results back (asynchronous choice); or
    (2) make an HTTP request to a Java servlet (the CMSDK code, running in some Java web container like iAS) and get the response back in some custom format (XML or something) (synchronous choice).
    It seems to me that the CMSDK Java API was designed to be used only in middle-tier, not in database tier.
    Regards,
    Daniel.

  • Problem with running the midlet class (Error with Installation suite )

    hi everyone...
    i have problem with running the midlet class(BluetoothChatMIDlet.java)
    it keep showing me the same kind of error in the output pane of netbeans...
    which is:
    Installing suite from: http://127.0.0.1:49296/Chat.jad
    [WARN] [rms     ] javacall_file_open: wopen failed for: C:\Users\user\javame-sdk\3.0\work\0\appdb\delete_notify.dat
    i also did some research on this but due to lack of forum that discussing about this,im end up no where..
    from my research i also find out that some of the developer make a changes in class properties..
    where they check the SIGN DISTRIBUTION...and also change the ALIAS to UNTRUSTED..after that,click the EXPORT KEY INTO JAVA ME SDK,PLATFORM,EMULATOR...
    i did that but also didnt work out..
    could any1 teach me how to fix it...
    thanx in advance... :)

    actually, i do my FYP on bluetooth chatting...
    and there will be more than two emulators running at the same time..
    one of my frens said that if u want to run more than one emulator u just simply click on run button..
    and it will appear on the screen..

  • How to call java class file from jsp

    hi
    we need to call java classes (which are written separately in .java file )from jsp file. we need it for our project if anyone knows about please reply us.
    bye
    siva sankari

    you can call the methods in a lot of ways. you could use scriptlets with the
    <%@ page import="package.class"%> and then inside instantiate an object
    <%
         MyClass mc = new MyClass(parameters if any);
         mc.theMethodYouWantToCall();
    %>or as Madathil has stated,
    or use the JSP tags
    <jsp:useBean id="anyname" class="classname"/>and then use the getProperty tag
    or even Custom Tags

  • Call java class by using servlet

    i written simple servlet with doGet(0. I need call java class when i run servlet
    my requirement is when i start the server i will call servlet it will redirect to another page.
    but before that servlet will run java class. which i have written externally.
    i need to run java class by using servlet then it will redirect to another page.
    could you give the proper solution

    You don't call classes - you call methods.
    There's nothing special about servlets except the requirement that they implement HttpServlet. Servlets and other classes they interact with all get compiled into WEB-INF/classes on the server.
    To forward a request to, say, "other.jsp" you do:
    getServletContext().getRequestDispatcher("/other.jsp").forward(request,response);

  • B1if Call Java Class

    I am attempting to call a java class using the Call Java Class atom. 
    Java Class Name: full name of the java class to be called (boldjar must be available in the B1i base pathbold)
    Where is the B1i base path?
    I have created a simple java class the implements Callable that simply returns 1.
    The exception I get com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE027 Could not get an instance for 'Callable'-class
    I have pasted the jar file in just about every path I can think of and still get this exception.
    Does anyone have a simple example of what the class should look like?  The callable interface only has a single function named call which does not take parameters.  How do we create a class that accepts parameters?

    Well I found this under Control Center -> Development -> BPC Reference
    User defined Java-Classes for the Call-Atom via the 'Callable' interface
    com.sap.b1i.bizprocessor.Callable
    This interface must be implemented by classes intended to be called by the B1iBizProcessor via the Call-Atom. Instances of these classes are subject of internal pooling if they do not indicate after a usage that they should be destroyed. In order to be able to create them internally in a generic way, they have to implement a parameterless initializer !!!
    I just searched the entire BizStore for com.sap.b1i.bizprocessor.Callable but was unable to find it. 
    I also searched Google for com.sap.b1i.bizprocessor.Callable and it only come up with my posts.
    I also searched the SAP Partner Portal, and SAP SDN with no avail.
    Is this functionality only for internal SAP use?

  • Problem with win2000sp3 and Java web start

    I have JRE and Java web start (1.2.0_01, build b01) which come downloading file j2re-1_4_1_01-windows-i586-i.exe from sun.
    I have win2000pro running on my PC.
    I had updated win2000 to service pack 2 and everything was fine.
    Now i decided to update to service pack 3 (in the process I also updated other components) from Microsoft and:
    1) Java applets seem to be running fine within i.e.
    2) If i try to run an application from java web start my PC freezes and I have to restart it.
    3) Staroffice 6.0, which runs on Java, seems to be fine.
    I reinstalled both sp3 and jre etc, with no result.
    Is this a known problem?
    Thanks to all.
    Maurizio

    I suspect that you have hit a known problem with Swing on Java 1.4.1 with buggy video drivers. Do you have an ATI card? They are the worst offenders. ATI released new drivers for its Radeon line today. They fix the problem.

  • Problems with a call transaction

    Hi, I'm having some problems with a call transaction and I cannot understand why. I put A in the mode, and I am seeing the dynpros and I am pressing enter it works perfectly but when I use mode N it tells me that there is not information for one of the dynpros and it doesn't work. Does anybody know the problem and how to solve it??
    Thanks in advance

    Hi,
    First of all thank you very much for your time.
    I am using FB05 and the problem is in dynpro SAPLKACB 0002, and it says that batch input data doesn't exist. Here is the code, maybe you can see what is happening
    LOOP AT t_resumen WHERE belnr = t_batch-belnr AND
                                ( contador = 3 OR contador = 4 or CONTADOR = 5 ).
          READ TABLE t_clave WITH KEY belnr = t_resumen-belnr.
          d_clave = t_clave-bschl.
          i = i + 1.
          CASE i.
            WHEN 1.
              PERFORM bdc_dynpro  USING 'SAPMF05A'    '0700'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
              PERFORM bdc_field   USING 'RF05A-NEWBS' t_resumen-bschl.
              PERFORM bdc_field   USING 'RF05A-NEWKO' t_resumen-hkont.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
              PERFORM bdc_dynpro  USING 'SAPMF05A'    '0300'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
              j_wrbtr = t_resumen-wrbtr.
              REPLACE '.' WITH ',' INTO j_wrbtr.
              PERFORM bdc_field   USING 'BSEG-WRBTR' j_wrbtr.
              PERFORM bdc_dynpro  USING 'SAPLKACB'    '0002'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
            WHEN t.
              PERFORM bdc_dynpro  USING 'SAPMF05A'    '0300'.
              PERFORM bdc_field   USING 'RF05A-NEWBS'  t_resumen-bschl.
              PERFORM bdc_field   USING 'RF05A-NEWKO'  t_resumen-hkont.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
              j_hkont = t_resumen-hkont.
              j_clave = t_resumen-bschl.
              PERFORM bdc_dynpro  USING 'SAPMF05A'    '0300'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '=BU'.
              j_wrbtr = t_resumen-wrbtr.
              REPLACE '.' WITH ',' INTO j_wrbtr.
              PERFORM bdc_field   USING 'BSEG-WRBTR' j_wrbtr.
              PERFORM bdc_dynpro  USING 'SAPLKACB'    '0002'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
            WHEN OTHERS.
              PERFORM bdc_dynpro  USING 'SAPMF05A'    '0300'.
              PERFORM bdc_field   USING 'RF05A-NEWBS'  t_resumen-bschl.
              PERFORM bdc_field   USING 'RF05A-NEWKO'  t_resumen-hkont.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
              j_hkont = t_resumen-hkont.
              j_clave = t_resumen-bschl.
              PERFORM bdc_dynpro  USING 'SAPMF05A'    '0300'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
              j_wrbtr = t_resumen-wrbtr.
              REPLACE '.' WITH ',' INTO j_wrbtr.
              PERFORM bdc_field   USING 'BSEG-WRBTR' j_wrbtr.
              PERFORM bdc_dynpro  USING 'SAPLKACB'    '0002'.
              PERFORM bdc_field   USING 'BDC_OKCODE'  '/00'.
          ENDCASE.
            READ TABLE t_porcentajes WITH KEY gjahr = t_resumen-zzbad
                                           zzbtd = t_resumen-zzbtd.
            IF j_hkont = t_porcentajes-cfacpr.
              PERFORM bdc_field   USING 'COBL-PRCTR' t_porcentajes-prctrfac.
              PERFORM bdc_field   USING 'COBL-ZZBTD' t_resumen-zzbtd.
              PERFORM bdc_field   USING 'COBL-ZZBAD' t_resumen-zzbad.
            ELSEIF t_resumen-hkont = t_porcentajes-cadmin.
             PERFORM bdc_field   USING 'COBL-KOSTL' '20801'.
            ELSEIF t_resumen-hkont = t_porcentajes-creca.
             PERFORM bdc_field   USING 'COBL-KOSTL' '20401'.
            ELSE.
              IF d_clave = 01 OR d_clave = 04 OR d_clave = 40 OR d_clave = 09.
                IF j_hkont >= 424001 AND j_hkont <= 424005.
                  PERFORM bdc_field   USING 'COBL-PRCTR' 'DUMMY'.
                ELSEIF j_hkont >= 424601 AND j_hkont <= 424605.
                  IF j_clave = 40.
                    PERFORM bdc_field   USING 'COBL-PRCTR' 'DUMMY'.
                  ENDIF.
                ENDIF.
              ELSEIF d_clave = 11 OR d_clave = 12 OR d_clave = 14 OR d_clave = 50.
                IF j_hkont >= 424001 AND j_hkont <= 424005.
                  PERFORM bdc_field   USING 'COBL-PRCTR' 'DUMMY'.
                ELSEIF j_hkont >= 424601 AND j_hkont <= 424605.
                  IF j_clave = 50.
                    PERFORM bdc_field   USING 'COBL-PRCTR' 'DUMMY'.
                  ENDIF.
                ENDIF.
              ENDIF.
    *Fin modificacion marzo 2007.----
              PERFORM bdc_field   USING 'COBL-ZZBTD' t_resumen-zzbtd.
              PERFORM bdc_field   USING 'COBL-ZZBAD' t_resumen-zzbad.
              PERFORM bdc_field   USING 'COBL-ZZBTT' t_resumen-zzbtt.
              PERFORM bdc_field   USING 'COBL-ZZBTU' t_resumen-zzbtu.
              PERFORM bdc_field   USING 'COBL-ZZBTS' t_resumen-zzbts.
              PERFORM bdc_field   USING 'COBL-ZZBAG' t_resumen-zzbag.
              PERFORM bdc_field   USING 'COBL-ZZBRE' t_resumen-zzbre.
              PERFORM bdc_field   USING 'COBL-ZZBC8' t_resumen-zzbc8.
              PERFORM bdc_field   USING 'COBL-ZZBC9' t_resumen-zzbc9.
            ENDIF.
        ENDLOOP.

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • Call Java Class and Methods from ABAP

    Hi
    I install de JCo, But how i can call java class and methods from ABAP?. somebody has an example?
    The tutorial say that's is possible,  but don't explain how do that?
    Thanks.
    Angel G. Hurtado

    If you need only simple java program, you do not need to install JCo. The following codes can call java class.
    DATA: COMMAND TYPE STRING VALUE 'C:\j2sdk1.4.2_08\bin\java',
          DIR TYPE STRING VALUE D:\eclipse\workspace',
          PARAMETER TYPE STRING VALUE 'Helloworld'. "here the name of your java program
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
       EXPORTING
         APPLICATION = COMMAND
         PARAMETER = PARAMETER
         DEFAULT_DIRECTORY = DIR
       MAXIMIZED =
         MINIMIZED = 'X'     "If you need the DOS window to be minimized
      EXCEPTIONS
        CNTL_ERROR = 1
        ERROR_NO_GUI = 2
        BAD_PARAMETER = 3
        FILE_NOT_FOUND = 4
        PATH_NOT_FOUND = 5
        FILE_EXTENSION_UNKNOWN = 6
        ERROR_EXECUTE_FAILED = 7
        OTHERS = 8.
    Tell me if it works.
    Nuno.

  • Can anyone help i want to call java class using visual basic

    I want to call java class using visual basic and send some arguments to the main class

    Hi,
    I don't know VB, but you can surely launch a command line like :
    javaw.exe mypackage.MyMainClass myArgument1
    Regards

  • BAD CLASS FILE ERROR WHEN TRYING TO CALL JAVA CLASS IN WEB-INF DIRECTORY

    I AM NEW TO THIS FORUM. PLEASE HELP ME IDENTIFY/RESOLVE THIS ERROR - bad class file: /java/tomcat/webapps/ChoiceTel/WEB-INF/classes/XYZ/SMUA.class. OTHER JSP SCRIPTS THAT CALL JAVA CLASSES DO WORK WELL.
    THE FUNNY THING ABOUT COMPILIING THIS JAVA CLASS WAS - I HAD TO A jar xvf OF activation.jar and mail.jar IN THE XYZ DIRECTORY BEFORE SUCCESSFULLY COMPILING SMUA.
    THE CALL BEING MADE FROM THE JSP SCRIPT IS AS FOLLOWS:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <BODY>
    <%@ page import="XYZ.*" %>
    <%!
    %>
    <%
    SMUA sndmail = new SMUA();
    sndmail.postMail ("[email protected]","Test Subject","What Message","[email protected]");
    %>
    </BODY>
    </HTML>

    Dude. Please don't shout. If your keyboard is like mine, it can produce both upper and lower case letters. Please use them appropriately.
    Do you have the activation.jar/mail.jar available in the WEB-INF/lib directory for this application?

  • I have problems with outgoing call no audio, only works with speaker. I bought my iphone on december 2011.

    I have problems with outgoing call no audio, only works with speaker. I bought my iphone on december 2011.

    Had the same problem, no audio on incoming or outgoing calls and only could hear the conversation of the call if I put on speaker. It seemed to start after I did a recent IOS update this past month. I tried restart, reset and restore of my iPhone but nothing changed. It appears not to be a software issue but a hardware problem. I got my phone this past summer so it was still under warranty and got it replaced.

Maybe you are looking for

  • Repair in China - English?

    My PBook's logic board is broken. This was confirmed at a genius bar in the US. There was no time to ship the unit off to CA for repair b/c I was leaving for China in 3 days to teach (to live). I am still here and I have contacted apple support in Sh

  • HH3 won't connect to Demand tv service

    Hi, I have HH3 Infinity service and it works fine, if sometimes a little slow, with my pc, notebook and tablet.  Unfortunately it won't connect to my OnDemand box from Sky.  I've been through all of the usual rebooting, checking connections etc but t

  • Bridge linksys BEFW11S4 and Airport

    I am trying to extend my home network by bridging my wireless network between two routers. Currently, the Linksys is plugged into the cable modem and the Airport is in another part of the house. My laptop with Airport can see both and I can configure

  • How to insert autoincrement record and query it with multiple keys

    Hi all, I am not familiar with BerkeyleyDB, I am now doing a project that needs to insert records and then query it out with multiple keys at later time. Since there is no field that can be distinct primary key, I want to user DbSequence as auto incr

  • Multiple video layers in clip

    When attempting to view a clip in Quicktime, the clip will play as normal and then suddenly switch between scenes. At this point, it is possible to drag the slider backwards in time and view a different scene. A third scene can be viewed if the curso