PI 7.1 Access to Dynamic Configuration through Java Class

My Current scenario involves IDCO -> FILE communications in PI 7.1 using XSL where the file name is dynamic.
I have attempted calling a Java Class from XSL with the use SAPXMLTOOL kit option set in the adaptor and it works but I need to be able to call the transform method
public void transform(TransformationInput arg0, TransformationOutput arg1)
from XSL so I can access the message and update the File Name via Dynamic Configuration.
Whilst I can call a static class with in the object I can not call transform with the correct arguments (arg0, arg1). I need access to arg0 (payload) to set/figure out the filename. I can calculate the filename in XSL and pass it to the Java but in a static method it is useless as it need to access the arg0 which is a object and obviously non-static context.
Is this possible ? How do I get access to Dynamic Configuration from XSL through Java in 7.1 ?
I have successfully called a static method but that is no help.
Thanks in advance.

Suraj,
   Unfortunately you link isnt operational but thankyou anyway, I have managed to call as Java class as per my original post, but a static method does not allow me to get a handle to the Dynamic Configuration Variables in the message.
It seems importing the 7.0 LIBS may be an option and Im not entirely sure I have that option.
It certainly isnt possible to use the JDK5 XML implementation to even call a static method on an Java OBJ from XSL (obviously the USE SAPXMLTOOLKIT option is there for a reason).
I think and again I could be wrong but direct access via XSLT..
LINK:http://help.sap.com/saphelp_nwpi71/helpdata/EN/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
Is what Im looking for, I shall report back success or failure but the doco seems to fit the bill. Im not sure why I wanted to instatiate a sperate Java class when it can all exist in the XSLT.

Similar Messages

  • Access/set dynamic configuration in client/server abap proxy

    Hi,
    I have 2 question regarding reading/setting dynamic configuration in ABAP proxies:
    1) Is it possible to set dynamic configuration objects in a server abap proxy (SAP --> XI)?
    When looking at the class CL_PROXY_FRAMEWORK is looks as if it is possible. This class has en attribute IF_XMS_MAIN~DY which is a reference to the class CL_XMS_MSGHDR30_DYNAMIC.
    I'm not sure if I'm supposed to try and access the dynamic configuration objects via this class or if I'm supposed to use the GET_PROTOCOL method in some manner as suggested by:
    http://help.sap.com/saphelp_nw04s/helpdata/en/51/d5cd16235e4643ae8ec92395c4ad97/frameset.htm
    Above link is for client proxies not server, and I've been unable to find any documentation on this for server proxies.
    2) The same question goes for server proxies (XI --> SAP), though now I would like to set some dynamic configuration data.
    This I believe should be done using get_protocol( if_wsprotocol=>ws_header ) as indicated by before mentioned link.
    However in both cases I'm not sure of if it is indeed possible and which road to choose for sure. So a hint or 2 would be really nice.
    Best Regards,
    Daniel
    ps. maybe I should just mention that I am pretty new to the ABAP world, so bear with me.

    The link that you gave does give you an example for both server and client proxies:
    Accessing Protocol Classes for Client Proxies
    In client proxies, you access the protocol class by using the GET_PROTOCOL method. Below is an example for the IF_WSPROTOCOL_PAYLOAD protocol:
    DATA:
    lo_clientProxy      TYPE REF TO co_clientProxy,
    lo_payload_protocol TYPE REF TO if_wsprotocol_payload
    lo_payload          TYPE REF TO if_ws_payload.
    CREATE OBJECT lo_clientProxy.
    Get Protocol Class Using Method GET_PROTOCOL
    lo_payload_protocol ?=
           lo_clientProxy->get_protocol( if_wsprotocol=>payload ).
    CALL METHOD lo_clientProxy->execute_synchronous
                EXPORTING output  = ls_request
                IMPORTING input   = ls_response.
    Use Protocol Methods
    lo_payload = lo_payload->get_sent_request_payload( ).
    Accessing Protocol Classes for Server Proxies (XI Only)
    Within the implementation of a server proxy, you get the protocol class by using the CL_PROXY_ACCESS=>GET_SERVER_CONTEXT( ) method:
    DATA:  lo_server_context   TYPE REF TO if_ws_server_context,
           lo_payload_protocol TYPE REF TO if_wsprotocol_payload.
    lo_server_context   = cl_proxy_access=>get_server_context( ).
    lo_payload_protocol =
         lo_server_context->get_protocol( if_wsprotocol=>payload ).

  • Accessing OS level commands through Java?

    Hello everyone,
    Is it possible to access OS-level (Unix BSD for instance) commands through Java classes or methods?
    "OS-level commands" refers strictly to Unix commands such as I/O CTL (control), Poll and Select through a file descriptor.
    "Access" refers to legitimate, built-in OR illegitimate (forced by "fooling" the system) access.

    However, the calls that you refer to, have been implemented in java; that goes for read/write/select (java.io and java.nio). But they pass through the java api implementation, and then throught the native implementation inside the JVM. If you want to use the raw power of poll() through java, you'd have to implement it yourself in JNI. But even if you successfully implement that, you must always remember that you'd have to make corresponding java classes that serve as arguments to your call, which, inside C, you must unpack again - so there goes your speed-advantage out the window.

  • Accessing a applicationScope variable in java class

    I have gone through the forum and found out the examples of setting a application scope variable in servlet. But How can I access the same from a java class; to be specific from Struts Action class. Also, is there any other way to set a application scope variable, than using the servlet; because I havent extended the Controller Servlet of Struts. Your timely help will be highly appreciated.
    Thanks & Regards
    Sridhar

    The struts Action class has a method getServlet that returns the instance of the ActionServlet associated with the Action Class. The ActionServlet has access to the ServletContext and the application scoped attributes.

  • Access DataControls methods in a java class

    Hi All,
    Jdeveloper Version 11.1.5
    I have created DataControls for SessionFacade web service.
    Inside the datacontrol there is a method getAllDepartments() which have a Return type which includes DaertmentId,DepartmentName,....
    I want to know how can i access this method inside a Java Class and create a list of only departmentId.

    You would need to add the method in the data control as a method action in your pageDef.
    After that, you could access the method as mentioned above.
    Thanks,
    Navaneeth

  • How to get access to PageContext in a java class (.java file)?

    Hi all,
    I am trying to get access to PageContext from inside a java class, and it doesn't seem to work.
    I could get the PageContext from a jsp page, at the object instantiation, through the constructor, but my class is not called by a jsp page.
    Any ideas?
    Thanks,
    Paul

    Basically I do not need to change any attributes from pageContext. However I need the pageContext object because I am using a third party component that is initialized with the pageContext .
    I cannot change the implementation of that component: it is a black box to me, I simply need the pageContext in my java class that uses the component.
    Any thoughts based on this clarification?
    Thanks,
    Paul

  • Accessing MS Sql Server with Java classes - problem connecting to socket

    I found an example at this location which uses java classes to connected to MS Sql Server.
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    --bummer - it is a login location - so I will include the article
    Anyway, the example is using Websphere, but I am still on Jbuilder (will get wsad soon). So I planted the classes from the example in
    C:\Borland\JBuilder\jkd1.4\jre\lib\ext\...the classes
    Then I copied the code from the example to my jpx project and got an error that it could not connect to the socket. The only thing I changed in the code was the connection string:
    --original string from example:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    I was getting an error with the 2 argument version of DriverManager - and the second argument here was empty (properties argument). Here was my connection string:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    I am only using the 1 argument version of DriverManager. Note that the password=" is blank because my RnD workstation is standalone - no one accesses the sql server except me - so no password. I also left out the last semicolon I noticed. Any suggestions appreciated how I could fix this.
    Thanks
    source of article:
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    iSeries 400 Tips:
    TIPS & NEWSLETTERS TOPICS SUBMIT A TIP HALL OF FAME
    Search for: in All Tips All search400 Full TargetSearch with Google
    PROGRAMMER
    Sample code: Accessing MS SQL Server database from the iSeries
    Eitan Rosenberg
    09 Mar 2005
    Rating: --- (out of 5)
    Nowadays with the help of Java the iSeries can be integrated with other databases quite easy. This tip shows you how. The code included here uses the free Microsoft driver that can be downloaded from here. (SQL Server 2000 Driver for JDBC Service Pack 3)
    If your SQL server does not include the Northwind Sample Database you can find it here.
    http://www.microsoft.com/downloads/details.aspx?familyid=07287b11-0502-461a-b138-2aa54bfdc03a&displaylang=en
    The download contains the following files:
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Those files needs to be copied to the iSeries directories (/home/r_eitan/ExternalJARs).
    Here's the directory structure (on the iSeries) for this sample:
    /home/r_eitan/ExternalJARs - Microsoft files (msbase.jar,mssqlserver.jar,msutil.jar)
    /home/r_eitan/JdbcTest02 - My code (Main.java,Main.class)
    The Java code
    import java.sql.*;
    import java.io.*;
    class Main {
    * Connect to Microsoft SQL server and download file northWind.products as tab
    * seperated file. (products.txt)
    public static void main(String args[]) {
    try {
    PrintStream outPut = new PrintStream(new BufferedOutputStream(new FileOutputStream("products.txt")));
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    System.out.println("Connection Done");
    connection.setCatalog("northWind");
    String sqlCmdString = "select * from products";
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery(sqlCmdString);
    ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
    int columnCount = resultSetMetaData.getColumnCount();
    // Iterate throught the rows in resultSet and
    // output the columns for each row.
    while (resultSet.next()) {
    for (int index = 1; index <=columnCount; ++index)
    String value;
    switch(resultSetMetaData.getColumnType(index))
    case 2 :
    case 3 :
    value = resultSet.getString(index);
    break;
    default :
    value = """ + resultSet.getString(index) + """;
    break;
    outPut.print(value + (index < columnCount ? "t" : ""));
    outPut.println();
    outPut.close();
    resultSet.close();
    connection.close();
    System.out.println("Done");
    catch (SQLException exception)
    exception.printStackTrace();
    catch (Exception exception)
    exception.printStackTrace();
    --------------------------------------------------------------------------------------------------

    My guess is that the server's host name isn't right. It necessarily (or even usually) the "windows name" of the computer. Try with the numeric IP address instead (type "ipconfig" to see it).
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
    - Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try it with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • Accessing String variables from several JAVA classes

    Hi.
    I have several java classes that accesses the same String variables. Instead of putting the String declarations in every java files, how can I put these declarations in a single file source, and get each java class to get the variables data from this file ?
    Please advice.
    Thanks.

    hi, of course you can solve it by the following methods:
    Method 1. define a superclass including the common string variable, and extend other classes from the superclass.
    Method 2. define a class , and define your common string variable as a static variable in it. In your other classes, you can call the string variable.
    Method 3. define it at your each classes.

  • How to know MS Access Database is down through Java

    How i would know whether MS Access DataBase is down?
    Is there any specific code for it in Java
    Need a quick reply

    How i would know whether MS Access DataBase is down?"down"? If the file system on which it's running is unavailable, that's the best you can do. If you can't connect, it's "down".
    Is there any specific code for it in JavaNo. Doesn't sound very platform-independent.
    Need a quick replyFast enough?
    %

  • Read SSH (Unix) dynamic file through Java code

    Hi,
    I am trying to create a java code which should read the dynamically changing content in the unix(SSH) system.
    Could you please tell me which is the best way to create the above requirement.
    Thanks in advance...

    corlettk wrote:
    but there are perl libraries... and (I was dumbfounded) a java-embedded-in-perl compiler. I feel a mashup delegate layer coming on.JCraft's JSch is, however, IMHO, a very good, flexible, and reliable implementation of SSH2 protocol (OpenSSH key formats). It allows your program to become an SSH client.
    Edit: And to tell you the truth, the Perl Net::SSH module is simply a wrapper around OpenSSH's libraries, and the Net::SSH::Perl Module (which is complete Perl although many of the Encryption modules need to be compiled, at least on Unix) are much more complicated to get installed, if not necessarily used, than JSch is.
    Edit Again: Although knowing the OP's history, I very much doubt his ability to implement either solution. ;-)

  • Dynamic Call to Java Class or Method

    Hi All,
    I have a requirement to call a Class or a Method Within the same class dynamically based on the user choice. I will give an example with how I do it in pl sql.
    begin
    if (choice = 1) then
    execute immediate 'package.procedure1(params)';
    elsif (choice = 2) then
    execute immediate 'package.procedure2(params)';
    else
    execute immediate 'package.procedure3(params)';
    end if;
    end;
    From the Example above, I call a program based on user choice. How Can I do the same in Java?
    Thank you.
    Edited by: Eric S. on Jul 6, 2011 9:52 AM

    I have a requirement to call a Class or a MethodYou can call a method, but not the Class where as you can instantiate the Class.
    I will give an example with how I do it in pl sql.
    begin
    if (choice = 1) then
    execute immediate 'package.procedure1(params)';
    elsif (choice = 2) then
    execute immediate 'package.procedure2(params)';
    else
    execute immediate 'package.procedure3(params)';
    end if;
    end;
    From the Example above, I call a program based on user choice. How Can I do the same in Java?The similar way. Here it takes the following structure.
    ClassA object = new ClassA();
    if(choice==1) {
          object.callMethod1();
    } else if(choice==2) {
          object.callMethod2();
    } else if(choice==3) {
          object.callMethod3();
    } Also you can switch case instead of if else. It takes the following structure.
    ClassA object = new ClassA();
    switch(choice) {
    case 1:  object.callMethod1(); break;
    case 2:  object.callMethod2(); break;
    case 3:  object.callMethod3(); break;
    }I recommend you to go with the second one which using switch.

  • Checking textbox through java class which is called  in jsp

    I have created a text box in html and if the string entered by user is a alphabet it will not show any message ,else it should display a error message..These checking validations of textbox is done in java and called in jsp;
    a.html
    <font size="4">Enter the search keyword:</font><input type="text" name="key" ><br>
    and also submit button is there which goes to main.jsp
    main.jsp
    <%@page import="gaveshan.checking;"%>
    <%
    checking ch=new checking();
    String trans=request.getParameter("key");
    out.println(ch.ParseClean(trans));
    session.setAttribute( "trans", trans );
    %>
    checking.java
    package gaveshan;
    import java.awt.event.*;
    public class checking
    {  public String ParseClean(String str)
    if(str.length()==100||str.length()==0)
    return "Enter String Properly";
    for(int i=0;i<str.length();i++)
    if(!(str.charAt(i)>65&&str.charAt(i)<122))
    return "Enter String Properly";
    it is not givng any message when user enters the input in textbox
    it is not showing any error

    Using javascript.
    var lwr = 'abcdefghijklmnopqrstuvwxyz';
    var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    function isValid(parm) {
    for (i=0; i<parm.length; i++) {
    if (val.indexOf(parm.charAt(i),0) == -1) return false;
    return true;
    }- vignesh

  • Dynamic configuration required in sender file - Adapter Module

    Hi Everybody,
    I am developing an Adapter Module in the file adapter (sender) using Adapter Specific Message Attributes.
    I am using Dynamic configuration inside the Module Process method in the adapter module.
    We are getting an error saying Dynamic Configuration cannot be resolved.
    Can anybody tell me the package to be used.
    Thanks,
    Zabiulla

    You can access the dynamic configuration in adapter module like this:
    Message msg = (Message) inputModuleData.getPrincipalData();
    String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "FileName");
    You do not need any addition library besides the adapter module API.
    Hope that helps
    Stefan

  • Accessing RUN through java programming

    Sir,
    i need to develop a java application t access "run" in start menu.How can i access the run menu through java programming.?I want to run the program in the run command when we input command through the java program..please help me..if you have the code palese send it tio me please..........

    But I cant access the drives for eg: I wrote c:\programfiles as input but i got an exception like this
    error=3
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at java.lang.Runtime.exec(Runtime.java:429)
    at java.lang.Runtime.exec(Runtime.java:326)
    at ex.main(ex.java:10)
    how can correct this error...

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

Maybe you are looking for

  • I have a Toolbar, but no button for' Tools', why? and how can I get it?

    on the Right top is a star for Bookmarks, below that is a green wheel which I thought would be "Tools", but its not. It's 'Toolbar Settings' I can't find the Tools button.

  • Removing "Run Only" attribute on AppleScript?

    So, let's say I wrote a killer script. Now I want to use it as the base for another script, but i inadvertently saved my script as "run only". Is there a way to change the attribute of this file (Sort of like a dos attrib command on a pc?)

  • I brought a macbook pro retina, what type of warranty is better

    i brought a macbook pro retina, what type of warranty is better

  • Date validation in ABAP Webdynpro.

    Hi,     I have created a field for date in my table and binded it with a field of a data dictionary table . The problem is when the user enters the year , whether one , two or three digits it automatically sets the remaining digits and the year is a

  • Print Service API Errors

    Hi, I am trying to use the new print services API's, I have a code example that will complie but failes at runtime. I am using Wepshere develoment studio client for the Iseries (V4.00). Can any one help me get this example running ? Error Message >>