Debug java class called from CF?

I'm experiencing different behaviour with a Java class called from a CF page to the same class called directly from Java code.
Is it possible for me to step into the Java class and debug it in CF builder if I attach the correct Java source?
Pressing F5 (step-in) on the line that the method is called just skips straight over.
Regards,
Andy

P5music wrote:
I would like to be able to make a java application that has a GUI that is a rich web page.That's what applets are for.
In this case, this page exists on my system and I can open it with my browser.
This page does many things that are typical of a web page like displaying information and presenting rich and graphical controls
but some of this controls are connected to a java application, launched from the web page or viceversa.I don't get this "launched from the web page" business. Is that a requirement or are you describing an existing system? Or are you describing somebody else's system whose architecture you want to imitate? Or are you using the word "launched" simply to describe the action of starting an applet?
It still isn't clear to me what you are trying to describe. But at any rate if you want a Java program to run in your browser, that's an applet. Note that applets can interact with Javascript code in the page they are embedded in. Or if you want to download a Java application which acts as a separate application, i.e. it still runs when the browser is closed, you can use Web Start for that.

Similar Messages

  • Custom Java class called from RTF template generates error

    We are running a report in BI Publisher and the report calls a custom developed Java class that is used to bind PDFs together and sent the result to another application.
    On the RTF template we have some XSLT that reads the input XML and sets a variable which is then passed to the Java class. We are however getting the following error when the report is called simultaneously 2 or more times:
    XML-22044: (Error) Extension function error: Error invoking 'JavaClassName': 'java.lang.Error: Cannot interweave overlay template with pdf input, combined number of pages is odd!
    I read this as the real cause of the error is the Java code but I'm not 100% sure. Also I don't understand what the error message means.
    Could someone help out please?
    Many thanks

    Since our this requirement is in Quotes module, its not using OAF. It is using plain JSPs and java classes.
    What i was thinking is, create the Option values as flex fields, and write a custom java class to fetch these data from the flex tables and use it in the JSP.
    The main problem we are facing now is,
    "...we wrote a simple java class, which establishes database connection, executes a simple insert & select query to our custom table. compiled & placed the class file under our new pkg structure under $JAVA_TOP eg. oracle.apps.xxx.quot.tmpl , bounced the apache."
    But when we tried to import this class in the jsp (which is being customized), the app just throwed Internal Server Error and we couldnt find any info in the Log file.
    Couldnt guess, why is this simple thing failing. Any idea ?

  • Java class call from form

    Hi
    I'm doing single sign on via cookie and I able to get the cookie value and for decrypting I loaded java classes on the back end, When I called via form the jvm is crashing with some frm-92101 error.
    First I want if anybody can help if I have to run any packages to execute java class from forms, I already created pl/sql wrapper class.
    When I execute the function on the backend and got the decrypted value via pl/sql wrapper package but from forms the web servver is crashing, Can any body help.
    Also where do I see the log file location.
    Thanks in advance for the pro's for helping me
    Thanks
    Murthy

    Dump from the application file.
    08/06/23 14:21:58 formsweb: Forms session <10> exception stack trace:
    java.io.IOException: FRM-93000: Unexpected internal error.
    Details : No HTTP headers received from runform
         at oracle.forms.servlet.ListenerServlet.forwardResponseFromRunform(Unknown Source)
         at oracle.forms.servlet.ListenerServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    08/06/23 14:52:17 formsweb: Forms session <11> aborted: unable to communicate with runtime process.
    08/06/23 14:52:17 formsweb: Forms session <11> exception stack trace:
    java.io.IOException: FRM-93000: Unexpected internal error.
    Details : No HTTP headers received from runform
         at oracle.forms.servlet.ListenerServlet.forwardResponseFromRunform(Unknown Source)
         at oracle.forms.servlet.ListenerServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    08/06/23 15:03:21 formsweb: Forms session <12> aborted: unable to communicate with runtime process.
    08/06/23 15:03:21 formsweb: Forms session <12> exception stack trace:
    java.io.IOException: FRM-93000: Unexpected internal error.
    Details : No HTTP headers received from runform
         at oracle.forms.servlet.ListenerServlet.forwardResponseFromRunform(Unknown Source)
         at oracle.forms.servlet.ListenerServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    08/06/23 15:08:21 formsweb: lservlet: destroy
    08/06/23 15:08:21 formsweb: Stopped
    08/06/23 15:08:21 Stopped (Shutdown executed by jazn.com/admin from 127.0.0.1 (localhost))

  • Java class call from Stored Proc or trigger

    Hi Experts!
    I have windows 2K server with Oracle 8i Enterprise Edition installed. Please let me know if I can call a java class from Stored Procedure or Trigger. If there is a way, then help me out with code sample or description.
    Regards,
    Atul
    [email protected]

    Atul,
    Couple of questions to you, off the subject,
    * Why NULL NULL registration?(You already revealed your name at the bottom)
    * Why email at the bottom? This is already a discussion forum.
    To your qn, it is very much possible. It is not something that one can explain in a single thread. It takes your machine setup for JVM, your knowledgebase on JAVA and other things. Please find notes on External Procedure Calls, which should give you a start. If you are running into problems, please come back with specifics.
    Thx,
    SriDHAR

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • 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

  • Debug java classes

    Is it possible or how to debug or profile imported java classes in Forms ? How to monitor this classes : how much memory / cpu they are using .

    Hi,
    there is no option in Forms to monitor imported Java files. One reason is that Forms only generates PLSQL wrappers for Java methods, but doesn't do anything with the Java classes itself. To profile Java classes, use the Java profiler in JDeveloper in a stand alone execution of the Java. It should behave the same if called from Forms or in stand alone
    Frank

  • Java stored proc from proxy Java classes generated from a web service?

    Hi gurus,
    I have searched "Java Stored Procedure" on this forum but could not find what I am looking for, so I have to post again.
    I need to use a web service and my client app is written in PowerBuilder 11 (Sybase), which claims that it will create a datawindow from a web service. Well, it turned out that PB can only handle simple stuff (it works with a very simple wsdl from the internet) but can't handle more complex ones that we need to use. So I am thinking about using Oracle JDeveloper(JDev) to create the web service proxy for the web service and then load it into Oracle as a Java stored procedure so that PowerBuilder can call the procedure. JDev succsfully generated the proxy and a few Java classes. My question is, do I need to load all the classes into the database? If yes, will the reference to the package work? For example, in a JDev generated class (the soap client class), it has package MyJdev.proxy; at the top. Or, will it work if I load all the classes included in package /MyJdev/proxy into the database?
    Thank you very much for any help.
    Ben

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • How to Debug Java Applet called in a BSP Component

    Hi All,
    In CRM Marketing->Segments->Graphical Modeler
    A click on settings button will load a Java Applet window.
    The settings window displays some elements. I want to translate a text displayed in that Java Applet window.
    Please let me know the ways to debug a Java applet loaded from BSP Component or ways the data is loaded into Java applet from SAP.
    Your help would be appreciated and points will be rewarded.
    Thanks a lot in advance.

    For the newbies, like me:
    Instruction to setup and debug an applet in Eclipse IDE via your Browser
    Java Console Setup for Applet debugging:
    1. Open up the Java Console Application by double clicking on it at C:\Program Files (x86)\Java\jre1.6.0_03\bin\javacpl.exe
    2. Select the Java Tab
    3. View Applet Runtime Settings button
    4. Enter in the Java Runtime Parameters the following: -Xdebug -Xrunjdwp:transport=dt_socket,address=5555,server=y,suspend=y
    5. Note: the port address 5555 can be anytime you want. You will need to enter whatever number you select into Eclipse IDE.
    6. Note: if you don�t need to debug code in the Applet�s init() method, then use....suspend=n (Not tested yet.)
    Eclipse setup for Applet debugging:
    1. Open up Eclipse and create your Applet. Once you are ready to debug go to the next step.
    2. Select the top level Run menu
    3. Pick the Open Debug Dialog� option
    4. In the left column select Remote Java Application
    5. Then select the �New� button to create a debug configuration for the remote session (the new button looks like a page with a yellow plus in the upper right hand corner)
    6. Give your session a name. I used the class name followed with the work remote for example: mainclassnameRemote
    7. Set connection type to Standard (Socket Attached)
    8. Host to localhost
    9. Port to 5555, or whatever you used in Java Console Setup step 5.
    10. Due not check the �Allow termination of remote VM�
    11. Due not close this window.
    Start debugging:
    1. Go to your Applet html launch file and launch in a browser
    2. Then go back to eclipse and select the debug button
    3. Eclipse should now throw you into the debugger mode.
    4. If it hangs, just retry again. It seems to work ok most of the time. A few time I need to close the browser and start over and then it seems to work.

  • Trying to run java class files from my jsp

    I am having difficulty running java files from my jsp. I have compiled my two java classes and inserted them onto my server in the webapps/WEB-INF/classes/scripting directory and have imported scripting.* into my jsp page. The files both compiled ok before the class files were loaded onto the server but when I rty to run the jsp from the server, I keep getting a compiler error. Thanks in advance
    Iob

    Here are the few question
    1) Does your java classes which u created is declared under package scripting. *.class files are to be places under the WEB-INF/classes directory only. Not under scripting. But if you java classes say are under a package called a.b. Then you need to put under classes\a\b\.

  • Accessing a java class method from the jsp page.

    Hi im a beginner with jsp and im trying to find a way to access a method of my java class file in jsp page. After searching through the forums i tried to use the usebean tag. Im using apache to host the jsp file.Below is an excerpt of my code and the error message i got. What am i doing wrong? anyone know?
    <%@ page language="java" %>
    <jsp:useBean id="movies" class="movie.Movie" />
    <jsp:setProperty name="movies" property="*"/>
    <%
    movies.getStart("file:///C:/Video/Applications2/sun.mpg");
    response.setContentType("text/xml");
    %>
    exception
    org.apache.jasper.JasperException: Exception in JSP: /View.jsp:7
    4: <jsp:setProperty name="movies" property="*"/>
    5: <%
    6:
    7: movies.getStart("file:///C:/Video/Applications2/sun.mpg");
    8: response.setContentType("text/xml");
    9: %>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: javax/media/ControllerListener

    Hi thanks for responding. Ok i did look through and it was opening some gui. I still need the program to do server side processes so cant use an applet.but i dont need the gui so i revised it and removed the gui. also im using a servlet to call the class now yet i still have the same error. Any ideas?
    Below is the vid2jpg code minus the gui.
    import java.io.*;
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import java.awt.image.*;
    import javax.imageio.*;
    public class vid2jpg implements ControllerListener
         Processor p;
         Object waitObj = new Object();
         boolean stateOK = true;
         DataSourceHandler handler;
    int imgWidth;int imgHeight;
         Image outputImage;
         String sep = System.getProperty("file.separator");
         int[] outvid;
         int startFr = 1;int endFr = 1000;int countFr = 0;
         boolean sunjava=true;
         * Static main method
         public static void main(String[] args)
              if(args.length == 0)
                   System.out.println("No media address.");
                   new vid2jpg("file:///C:/Video/applications2/sun.mpg");     // or alternative "vfw://0" if webcam
              else
                   String path = args[0].trim();
                   System.out.println(path);
                   new vid2jpg(path);
         * Constructor
         public vid2jpg(String path)
              MediaLocator ml;String args = path;
              if((ml = new MediaLocator(args)) == null)
                   System.out.println("Cannot build media locator from: " + args);
              if(!open(ml))
                   System.out.println("Failed to open media source");
         * Given a MediaLocator, create a processor and start
         private boolean open(MediaLocator ml)
              System.out.println("Create processor for: " + ml);
              try
                   p = Manager.createProcessor(ml);
              catch (Exception e)
                   System.out.println("Failed to create a processor from the given media source: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if(!waitForState(p.Configured))
                   System.out.println("Failed to configure the processor.");
                   return false;
              // Get the raw output from the Processor.
              p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
              TrackControl tc[] = p.getTrackControls();
              if(tc == null)
                   System.out.println("Failed to obtain track controls from the processor.");
                   return false;
              TrackControl videoTrack = null;
              for(int i = 0; i < tc.length; i++)
                   if(tc.getFormat() instanceof VideoFormat)
                        tc[i].setFormat(new RGBFormat(null, -1, Format.byteArray, -1.0F, 24, 3, 2, 1));
                        videoTrack = tc[i];
                   else
                   tc[i].setEnabled(false);
              if(videoTrack == null)
                   System.out.println("The input media does not contain a video track.");
                   return false;
              System.out.println("Video format: " + videoTrack.getFormat());
              p.realize();
              if(!waitForState(p.Realized))
                   System.out.println("Failed to realize the processor.");
                   return false;
              // Get the output DataSource from the processor and set it to the DataSourceHandler.
              DataSource ods = p.getDataOutput();
              handler = new DataSourceHandler();
              try
                   handler.setSource(ods);     // also determines image size
              catch(IncompatibleSourceException e)
                   System.out.println("Cannot handle the output DataSource from the processor: " + ods);
                   return false;
         //     setLayout(new FlowLayout(FlowLayout.LEFT));
    //          currPanel = new imgPanel(new Dimension(imgWidth,imgHeight));
         //     add(currPanel);
         //     pack();
              //setLocation(100,100);
         //     setVisible(true);
              handler.start();
              // Prefetch the processor.
              p.prefetch();
              if(!waitForState(p.Prefetched))
                   System.out.println("Failed to prefetch the processor.");
                   return false;
              // Start the processor
              //p.setStopTime(new Time(20.00));
              p.start();
              return true;
         * Sets image size
         private void imageProfile(VideoFormat vidFormat)
              System.out.println("Push Format "+vidFormat);
              Dimension d = (vidFormat).getSize();
              System.out.println("Video frame size: "+ d.width+"x"+d.height);
              imgWidth=d.width;
              imgHeight=d.height;
         * Called on each new frame buffer
         int nextframetime = 0;
    private void useFrameData(Buffer inBuffer)
    try
    if(inBuffer.getData()!=null) // vfw://0 can deliver nulls
    if(sunjava) // and with import javax.imageio.*;
    int frametimesecs = (int)(inBuffer.getTimeStamp()/1000000000);
    if(frametimesecs%10 == 0 && frametimesecs==nextframetime)
    nextframetime+=10;
    BufferedImage bi = new BufferedImage(outputImage.getWidth(null), outputImage.getHeight(null), BufferedImage.TYPE_INT_RGB);
    Graphics g = bi.getGraphics();
    ImageIO.write(bi, "png", new File("images"+sep+"image_"+(inBuffer.getTimeStamp()/1000000000)+".png"));
    catch(Exception e){}
         * Tidy on finish
         public void tidyClose()
              handler.close();
              p.close();
         * Block until the processor has transitioned to the given state
         private boolean waitForState(int state)
              synchronized(waitObj)
                   try
                        while(p.getState() < state && stateOK)
                        waitObj.wait();
                   catch (Exception e)
              return stateOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt)
              if(evt instanceof ConfigureCompleteEvent ||     evt instanceof RealizeCompleteEvent || evt instanceof PrefetchCompleteEvent)
                   synchronized(waitObj)
                        stateOK = true;
                        waitObj.notifyAll();
              else
              if(evt instanceof ResourceUnavailableEvent)
                   synchronized(waitObj)
                        stateOK = false;
                        waitObj.notifyAll();
              else
              if(evt instanceof EndOfMediaEvent || evt instanceof StopAtTimeEvent)
                   tidyClose();
         * Inner classes
         * A DataSourceHandler class to read from a DataSource and displays
         * information of each frame of data received.
         class DataSourceHandler implements BufferTransferHandler
              DataSource source;
              PullBufferStream pullStrms[] = null;
              PushBufferStream pushStrms[] = null;
              Buffer readBuffer;
              * Sets the media source this MediaHandler should use to obtain content.
              private void setSource(DataSource source) throws IncompatibleSourceException
                   // Different types of DataSources need to handled differently.
                   if(source instanceof PushBufferDataSource)
                        pushStrms = ((PushBufferDataSource) source).getStreams();
                        // Set the transfer handler to receive pushed data from the push DataSource.
                        pushStrms[0].setTransferHandler(this);
                        // Set image size
                        imageProfile((VideoFormat)pushStrms[0].getFormat());
                   else
                   if(source instanceof PullBufferDataSource)
                        System.out.println("PullBufferDataSource!");
                        // This handler only handles push buffer datasource.
                        throw new IncompatibleSourceException();
                   this.source = source;
                   readBuffer = new Buffer();
              * This will get called when there's data pushed from the PushBufferDataSource.
              public void transferData(PushBufferStream stream)
                   try
                        stream.read(readBuffer);
                   catch(Exception e)
                        System.out.println(e);
                        return;
                   // Just in case contents of data object changed by some other thread
                   Buffer inBuffer = (Buffer)(readBuffer.clone());
                   // Check for end of stream
                   if(readBuffer.isEOM())
                        System.out.println("End of stream");
                        return;
                   // Do useful stuff or wait
                   useFrameData(inBuffer);
              public void start()
                   try{source.start();}catch(Exception e){System.out.println(e);}
              public void stop()
                   try{source.stop();}catch(Exception e){System.out.println(e);}
              public void close(){stop();}
              public Object[] getControls()
                   return new Object[0];
              public Object getControl(String name)
                   return null;
    below is the servlet code.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class ShowMovie extends HttpServlet {
    String rootURL="http://127.0.0.1:8080/Video/";
    public void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
         //String movie=request.getParameter("movie");
         String movie ="son";
         getStart(movie);
              response.sendRedirect(rootURL+"View.jsp");
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
         public void getStart(String url){
              new vid2jpg(url);
    this is the error from the server. Im using tomkat 5
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
         java.lang.ClassLoader.defineClass1(Native Method)
         java.lang.ClassLoader.defineClass(Unknown Source)
         java.security.SecureClassLoader.defineClass(Unknown Source)
         org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812)
         org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         ShowMovie.getStart(ShowMovie.java:31)
         ShowMovie.processRequest(ShowMovie.java:14)
         ShowMovie.doGet(ShowMovie.java:22)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

  • Java Program Call from PLSQL

    First I have created two Java files
    FileName1-TestPLSQL.java
    package TestJava;
    public class TestPLSQL {
      * @param args
      public static void main(String[] args) {
      // TODO Auto-generated method stub
      test2.world();
    FilaName2-test2.java
    package TestJava;
    public class test2 {
       public static void world()
        System.out.println("Hello world");
    Then i have loaded the class in Oracle using Loadjava-
    loadjava -user TEST/TEST -v TestPLSQL.java
    loadjava -user TEST/TEST -v test2.java
    It successfully loaded without any error.
    Then i have created one function-
    create or replace
    FUNCTION F_JAVA_PGM
    /*Specify the return type as per the method in the java class*/
    RETURN VARCHAR2
    AS
    /*Specify the external programs base language*/
    LANGUAGE JAVA NAME 'TestJava.TestPLSQL(java.lang.String)
    return java.lang.String';
    While executing the below query -
    SELECT F_JAVA_PGM FROM DUAL;
    Its giving error-
    ORA-29540: class TestJava does not exist
    Can anybody help me on this?

    INRi wrote:
    While executing the below query -
    SELECT F_JAVA_PGM FROM DUAL;
    Its giving error-
    ORA-29540: class TestJava does not exist
    Can anybody help me on this?
    The call specification is incorrect :
    You must publish a method, not a class.
    None of the methods return a value, why are you creating a function ?
    So, in short, for the specific test case you've submitted here, use a procedure that interfaces the TestJava.TestPLSQL.main method with a String array parameter :
    create or replace procedure P_JAVA_PGM
    AS LANGUAGE JAVA
    NAME 'TestJava.TestPLSQL.main(java.lang.String[])';
    Tested OK after loading the sources directly via CREATE JAVA SOURCE :
    create or replace and compile java source named file2 as
    package TestJava;
    public class test2 {
       public static void world()
        System.out.println("Hello world");
    create or replace and compile java source named file1 as
    package TestJava;
    public class TestPLSQL {
      * @param args
      public static void main(String[] args) {
      // TODO Auto-generated method stub
      test2.world();
    create or replace procedure P_JAVA_PGM
    AS LANGUAGE JAVA
    NAME 'TestJava.TestPLSQL.main(java.lang.String[])';
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> exec p_java_pgm
    PL/SQL procedure successfully completed.
    Result can be seen in a trace file :
    *** 2013-08-11 12:44:51.513
    Hello world

  • DB Call from Oracle Business Rule +Java Method call from OBR

    Hi,
    1.We have a requirement in project where we need to make DB Call from Business rule.
    We are using ORACLE SOA11g.
    Is this possible.Any pointers on this will be helpfull.
    2.Can we call java method from Oracle Business Rule.If so pls suggest how it can be done.
    Thanks In Advance,
    Oracle SOA User

    You can implement java class to make database updates using JDBC. You can add Java class as fact in business rules and invoke methods as actions of the business rules.
    Hope this will help.
    Jayesh Patel
    http://jayesh-patel.blogspot.com/
    http://www.yagnasys.com/

  • Create java class/resource from binary blob in SQL statement

    Is there a way of creating a java class or resource from a binary blob in the CREATE JAVA CLASS statement? Something like:
    CREATE OR REPLACE JAVA CLASS
    USING BLOB 'CAFEBABE0000003100120A0004000D08000E07000F0700100100063C696E69743E010003282956010004436F646501000F4C696E654E756D6265725461626C6501000372756E01001428294C6A6176612F6C616E672F537472696E673B01000A536F7572636546696C6501001152657475726E537472696E672E6A6176610C0005000601001F546869732069732061206E657720737472696E67207269676874206865726501000C52657475726E537472696E670100106A6176612F6C616E672F4F626A65637401000F6175726F72615F6F70745F696E666F002100030004000000000002000100050006000100070000001D00010001000000052AB70001B10000000100080000000600010000000100090009000A000100070000001B00010000000000031202B0000000010008000000060001000000030002000B00000002000C00110000004C00000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009705070397050703';
    I've tried various combinations of casting & convert functions, all of them give an ORA-29506 error 'Invalid query derived from USING clause', and nothing useful is gained from google about this. Is there a way of specifying the class binary in this way?

    You can load Java classes into the database, then create a PL/SQL procedure or function in the database that calls that Java class.
    This leaves you with a standard PL/SQL procedure/function which you can call from Oracle Forms.
    Have a look at the database documentation on how to load a Java class: http://download.oracle.com/docs/cd/A91202_01/901_doc/java.901/a90210/toc.htm

  • Java Class calling another class?

    i have a class called infix and a separate class called postfix. what i am trying to do is make the infix class create a string of postfix notation and then call the postfix class to do the computation.
    i have the string all ready to be passed to the postfix class for computation..my question is...how do i get it to that class?

    HERE ARE THE TWO CLASSES. THE POSTFIX WORKS FOR SURE AND I AM TRYING TO GET THE INFIX TO WORK. THE QUESTION IS IN THE RETURN OF THE INFIX. DONT TRY TO CORRECT THE INFIX CODE. I AM WORKING ON THAT BY MYSELF. I JUST NEED HELP ON CONNECTING THEM IF POSSIBLE. CHECK THE RETURN OF INFIX. THANKS ALOT
    import java.util.*;
    public class PostFix
         private Set<String> ops = new HashSet<String>();
         private List<String> lst = new LinkedList<String>();
         private static Map<String, String> m = new HashMap<String, String>();
         public List<String> getLst()
              return lst;
         public Map<String, String> getMap()
              return m;
         public PostFix( String s )
              ops.add("+");
              ops.add("-");
              ops.add("*");
              ops.add("/");
              ops.add("%");
              StringTokenizer sTok = new StringTokenizer(s);
              while( sTok.hasMoreTokens() )
                   lst.add( sTok.nextToken() );
              m.put( "a" , "26" );
              m.put( "b" , "25" );
              m.put( "c" , "24" );
              m.put( "d" , "23" );
              m.put( "e" , "22" );
              m.put( "f" , "21" );
              m.put( "g" , "20" );
              m.put( "h" , "19" );
              m.put( "i" , "18" );
              m.put( "j" , "17" );
              m.put( "k" , "16" );
              m.put( "l" , "15" );
              m.put( "m" , "14" );
              m.put( "n" , "13" );
              m.put( "o" , "12" );
              m.put( "p" , "11" );
              m.put( "q" , "10" );
              m.put( "r" , "9" );
              m.put( "s" , "8" );
              m.put( "t" , "7" );
              m.put( "u" , "6" );
              m.put( "v" , "5" );
              m.put( "w" , "4" );
              m.put( "x" , "3" );
              m.put( "y" , "2" );
              m.put( "z" , "1" );
         public int Value()
              Stack<Integer>operandStack = new Stack<Integer>();
              Iterator<String> iterator = lst.iterator();
              String tmp;
              int val1 = 0;
              int val2 = 0;
              int tmpInt = 0;
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( !ops.contains( tmp ) )
                        operandStack.push(Integer.parseInt(tmp));
                   else
                        val1 = operandStack.pop();
                        val2 = operandStack.pop();     
                        Character c = new Character( tmp.charAt(0) );
                        switch( c )
                             case '+':
                                  operandStack.push(val1 + val2);
                                  break;
                             case '-':
                                  operandStack.push(val2 - val1);
                                  break;
                             case '*':
                                  operandStack.push(val1 * val2);
                                  break;
                             case '/':
                                  operandStack.push(val2 / val1);
                                  break;
                             case '%':
                                  operandStack.push(val2 % val1);
                                  break;
              return operandStack.peek();
         public int Value( Map m )
              Stack<Integer> operandStack = new Stack<Integer>();
              Iterator<String> iterator = lst.iterator();
              String tmp;
              String x;
              int val1 = 0;
              int val2 = 0;
              int tmpInt = 0;
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( !ops.contains( tmp ) && !m.containsKey( tmp )  )
                        operandStack.push(Integer.parseInt(tmp));
                   else if ( !ops.contains(tmp) && m.containsKey(tmp) )
                        x = m.get(tmp).toString();
                        operandStack.push(Integer.parseInt(x));
                   else{          
                        val1 = operandStack.pop();
                        val2 = operandStack.pop();     
                        Character c = new Character( tmp.charAt(0) );
                        switch( c )
                             case '+':
                                  operandStack.push(val1 + val2);
                                  break;
                             case '-':
                                  operandStack.push(val2 - val1);
                                  break;
                             case '*':
                                  operandStack.push(val1 * val2);
                                  break;
                             case '/':
                                  operandStack.push(val2 / val1);
                                  break;
                             case '%':
                                  operandStack.push(val2 % val1);
                                  break;
              return operandStack.peek();
         and the infix is
    import java.util.*;
    public class InFix
         PostFix pFix;
         private Set<String> LowOps = new HashSet<String>();
         //private Set<String> parenthesis = new HashSet<String>();
         private Set<String> HighOps = new HashSet<String>();
         private List<String> lst = new LinkedList<String>();
         public List<String> getLst()
              return lst;
         public InFix( String s )
              LowOps.add("+");
              LowOps.add("-");
              HighOps.add("*");
              HighOps.add("/");
              //ops.add("%");
              StringTokenizer sTok = new StringTokenizer(s);
              while( sTok.hasMoreTokens() )
                   lst.add( sTok.nextToken() );
         public int Value()
              Stack <String> operatorStack = new Stack<String>();
              Iterator<String> iterator = lst.iterator();
              String tmp = "";
              String pFixStr = "";
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( tmp == "(" )
                        operatorStack.push(tmp);
                   else if( tmp == ")" )
                        String peektmp = operatorStack.peek();
                        while( peektmp != "(" )
                             pFixStr.concat(operatorStack.pop() );
                   else if( !LowOps.contains(tmp) && !HighOps.contains(tmp) )//pushes if its a number
                        pFixStr.concat( tmp );
                   else if( LowOps.contains( tmp ) )
                        operatorStack.push(tmp);
                   else if( HighOps.contains( tmp ) )
                        operatorStack.push(tmp);
              while ( !operatorStack.empty() )
                   pFixStr.concat(operatorStack.pop());
              System.out.println( pFixStr );
         return <THIS IS WHERE I WANT TO RETURN THE COMPUTATION FROM THE POSTFIX CLASS. IS THIS CORRECT TO TRY AND RETURN A POSTFIX(PFIXSTR) OR SOMETHING LIKE THAT>     
         }THANKS

Maybe you are looking for