Problem in creating DB Link - Please help

Hi ,
I created a DB Link with name "CTM_DBLINK".
i want to create DB Link with different name but using same server and connection also same.
When i am trying this its shows error :
"ORA-00933:SQL Command not properly ended."
My Query :
create public database link "CTM_BANK"
connect to ABC
identified by <pwd>
using 'database';
i am getting error on line 3 : identified by <pwd>
Please help , its urgent.
Surender

Try enclosing the password in quotes.
Same problem occurs if you try to create a user using the password you have given.
SQL> create user abc identified by abc!;
create user abc identified by abc!
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> create user abc identified by "abc!" ;
User created.
To create the database link, try this:
SQL> CREATE PUBLIC DATABASE LINK "CTM_BANK" CONNECT TO "ABC"
2 IDENTIFIED BY "abc!"
3 USING 'database' ;
Database link created.
Hope that helps!
Regards.
RK

Similar Messages

  • Problem with creating JAVA Source. please help

    Dear all
    how are you.
    In fact I have made a simple java class that return a string which represents the screen size . for example 800/600 or 1024/768 or others
    but I face error ORA-29541 class string.string could not be resolved
    This what i made
    first i created my JAVA Source
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "ScreenProperty" AS
    import java.lang.Object;
    import java.awt.*;
    public class ScreenProperty
    int w;
    int h;
    public static String getScreenSize()
    w = Toolkit.getDefaultToolkit().getScreenSize().width;
    h = Toolkit.getDefaultToolkit().getScreenSize().height;
    return w+"/"+h;
    SQL>Operation 160 succeeded.
    this means the the java source created successfuly
    and I'm sure that my java code is correct
    then i created a fuction to call this java source as fellow
    SQL> create or replace function f_get_screen_size
    return varchar2
    as language java
    name 'ScreenProperty.getScreenSize() return java.lang.String';
    Function created.
    the I Issued this sql statement to return the result that should be varchar2 that represent the sceen size(1024/768)
    SQL> select f_get_screen_size from dual;
    ORA-29541 class string.string could not be resolved.
    I do not know what is the reason for this error
    and when i searched the documentation for this error i found
    ORA-29541 class string.string could not be resolved
    Cause: An attempt was made to execute a method in a Java class that had not been previously and cannot now be compiled or resolved successfully.
    Action: Adjust the call or make the class resolvable
    I need to know what is the problem.
    And is there another way to load this class other than making JAVA SOURCE
    please help

    before drawing hands of clock you could fill a circle/oval with certain color, then you'd have that kind of circle that has been filled as backgound.
    you may change those dots to be small lines for 12, 3, 6 and 6 o'clock and then have small dots represent 1, 2, 4, 5, 7, 8, 10 and 11 o'clock
    anyhow, you should study that code and see how you can modify it whitout breaking it but having it look different.
    better yet would be trying to understand how it works, what any line there means and then recreate your own... this way you would learn more....
    and if there are some methods or anything you don't understand, then look them up from API documentation
    good luck.

  • HI YANN/VADIM...Still having problem in BADIs...please help me out

    Hi Yann/Vadim,
    Facing a problem in BADI can u please help me out...
    I am implementing sourcing dashboard.
    I am facing problem while implementing the badi BBP_ECS_PO_OUT_BADI in SRM. and BBP_PO_INBOUND_BADI in R3.
    i have written following code in BBP_ECS_PO_OUT_BADI in SRM
    method IF_EX_BBP_ECS_PO_OUT_BADI~BBP_B46B_PO_OUTBOUND.
    data : ls_item type BBP_PDS_PO_ITEM_D.
    data : w_customer_fields type BBPS_IF_CUSTOMER_FIELDS_PI.
    move 'POITEM' to w_customer_fields-refobject.
    move 'CATALOGID' to w_customer_fields-fieldname.
    move ls_item-catalogid to w_customer_fields-container.
    append w_customer_fields to ct_bapi_customer_fields.
    endmethod.
    i have created field zsrmcatalogid field in R3 in EKPO table.and i am now implementing the Badi in R3 for BBP_PO_INBOUND_BADI .....in extended classic scenario.
    i have written following code in R3 BADI
    method IF_EX_BBP_PO_INBOUND_BADI~BBP_MAP_BEFORE_BAPI.
    data : wa_customer_fields type bbps_if_customer_fields,
    wa_bapi_te_mepoitem type bapi_te_mepoitem,
    wa_bapi_te_mepoitemx type bapi_te_mepoitemx,
    wa_extensionin type bapiparex.
    data : txt_960(960) type c.
    read table bbp_customer_fields into wa_customer_fields with key
    refobject = 'POITEM' fieldname = 'CATALOGID'.
    if sy-subrc eq 0.
    move wa_customer_fields-container TO
    wa_bapi_te_mepoitem-zsrmcatalogid.
    wa_bapi_te_mepoitemx-zsrmcatalogid = 'X'.
    endif.
    clear txt_960.
    clear wa_extensionin.
    write wa_bapi_te_mepoitem to txt_960 left-justified.
    wa_extensionin-structure = 'BAPI_TE_MEPOITEM'.
    wa_extensionin-valuepart1 = txt_960(240).
    wa_extensionin-valuepart2 = txt_960+240(240).
    wa_extensionin-valuepart3 = txt_960+480(240).
    wa_extensionin-valuepart4 = txt_960+720(240).
    append wa_extensionin to bapi_extensionin.
    clear txt_960.
    clear wa_extensionin.
    write wa_bapi_te_mepoitemx to txt_960 left-justified.
    wa_extensionin-structure = 'BAPI_TE_MEPOITEMX'.
    wa_extensionin-valuepart1 = txt_960(240).
    wa_extensionin-valuepart2 = txt_960+240(240).
    wa_extensionin-valuepart3 = txt_960+480(240).
    wa_extensionin-valuepart4 = txt_960+720(240).
    append wa_extensionin to bapi_extensionin.
    endmethod.
    But its not working...
    The PO details are not passed from SRM to R3.......
    PLEASE CAN U GIVE ME EXACT CODE FOR CHANGES TO BE MADE IN THIS BADI ..AS IT IS NOT WORKING...
    Can anybody help me regarding how to debug the BADI in R3.
    Thanks in Advance...

    Hi Ravi,
    You can transfer the standard SRM catalog ID field to R/3 tracking number field (if not already used for another purpose) in the R/3 PO.
    This will avoid to implement the R/3 inbound bapi.
    Here is an extract of the code.
    The ECS PO badi example was here used to transfer the unlimited delivery flag to R/3 PO for a Z combination of criteria as well as the transfer of <b>catalog ID</b> to <b>tracking number field</b> in R/3 PO :
    method IF_EX_BBP_ECS_PO_OUT_BADI~BBP_B46B_PO_OUTBOUND.
    update unlimited delivery flag in R3 PO for combination of vendor +
    Product Category maintained in the bespoke table ZUD_PC_VNDR ..
      LOOP AT ct_bapi_poitem INTO ls_bapi_poitem.
        lv_tabix = sy-tabix.
        IF ls_bapi_poitem-po_item IS NOT INITIAL.
          READ TABLE it_item INTO ls_item
               WITH KEY number_int = ls_bapi_poitem-po_item
                          del_ind    = ' '.
          IF sy-subrc = 0.
    Set Unlimited delivery Flag
            read table li_zud_pc_vndr into ls_zud_pc_vndr
                            with key partner       = ls_partner-PARTNER_ID
                                       category_id = ls_item-category_id.
            if sy-subrc eq 0.
              ls_bapi_poitem-UNLIMITED_DLV = 'X'.
            endif.
    Set the Dummy catalog.. entry..
            if ls_item-catalogid eq c_dummy.
              ls_bapi_poitem-TRACKINGNO = c_noncat.
            endif.
            ls_bapi_poitem-GR_BASEDIV = ' '.
            modify ct_bapi_poitem from ls_bapi_poitem index lv_tabix
                          transporting UNLIMITED_DLV TRACKINGNO GR_BASEDIV.
          ENDIF. "READ TABLE it_item ..
        ENDIF.   "IF ls_bapi_poitem-po_item ..
      ENDLOOP.   "LOOP AT ct_bapi_poitem ..
    endmethod.
    Kind regards,
    Yann
    PS : please do reward helpful answers ))

  • I need to create Buttons dynamically Please Help

    I am currently developing a card game. I represent my cards as buttons. But as the player draws more cards from the deck I have to generate buttons dynamically at run-time. I could use arrays of buttons and store new buttons inside that arrays of buttons. But the only problem is I need ActionListener for each of my buttons. How do you create ActionListener for each different dynamically created buttons? Please Help.

    Here is my code. I just do not understand how to create those functions dynamically that functions different each time.
    Here is my code please take a look.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class run108{
    JButton setbutton;
    JButton ButtonUp;
    JButton ButtonDeal;     
    JButton slot1;
    JButton slot2;
    JButton slot3;
    JButton slot4;
    JButton slot5;
    JButton slot6;
    JButton slot7;
    cards[] card = new cards[55];
    public static void main(String[] argv)
         run108 startgui = new run108();
         startgui.createframe();     
    void createframe()
         //Standard of way of creating Frame
         JFrame frame = new JFrame("108");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLocation(300,200);// Tells the startup position;
         //Adding Panels to the framework
         JPanel panelA = new JPanel();
         panelA.setBackground(Color.white);
         panelA.setLayout(new BoxLayout(panelA,BoxLayout.Y_AXIS));
         JPanel panelB = new JPanel();
         JPanel panelC = new JPanel();
         //Adding buttons with card images
         JLabel label1 = new JLabel("       Set of Cards");
         panelA.add(label1);
         ImageIcon pic1 = new ImageIcon("cards/backd.png");
         setbutton = new JButton(pic1);          
        panelA.add(setbutton);
        ImageIcon picdeal = new ImageIcon("cards/deal.png");
         ButtonDeal = new JButton(picdeal);
         panelA.add(BorderLayout.CENTER, ButtonDeal);
        ButtonDeal.addActionListener(new DealListener());
         JLabel label2 = new JLabel("       Your Target");
         panelA.add(label2);
         ButtonUp = new JButton(pic1);          
        panelA.add(BorderLayout.CENTER, ButtonUp);
        frame.add(BorderLayout.WEST,panelA);
        // Adds 7 initial card slots.
         ImageIcon pic2 = new ImageIcon("cards/backc.png");
         slot1 = new JButton(pic2);
        panelB.add(slot1);          
        slot1.addActionListener(new Slot1Listener());
        slot2 = new JButton(pic2);
        panelB.add(slot2);
        slot2.addActionListener(new Slot2Listener());
         slot3 = new JButton(pic2);
        panelB.add(slot3);
        slot3.addActionListener(new Slot3Listener());
         slot4 = new JButton(pic2);
        panelB.add(slot4);
        slot4.addActionListener(new Slot4Listener());
         slot5 = new JButton(pic2);
        panelB.add(slot5);
        slot5.addActionListener(new Slot5Listener());
         slot6 = new JButton(pic2);
        panelB.add(slot6);
        slot6.addActionListener(new Slot6Listener());
         slot7 = new JButton(pic2);
        panelB.add(slot7);
        slot7.addActionListener(new Slot7Listener());
        frame.add(BorderLayout.CENTER,panelB);
        // This has to be added @ the end to show the components
        //that were added after on. If it is placed before the components
        //the components shall not appear since they sit on the frame
         frame.setSize(600,500);
         frame.setVisible(true);
    class DealListener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot1Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot2Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot3Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot4Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot5Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot6Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot7Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    }

  • TS3899 In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    Greetings,
    Questions:
    1. What version of the Mac OS are you running (Apple > About this Mac)?
    2. What version of the iOS are you running (Settings > About)?
    3. Do you use MobileMe/ iCloud or another server based sync solution like Google or Yahoo?
    4. Do other changes to synced information like Address Book content sync successfully back and forth?
    Based on your description it sounds like you have a 1 way sync issue.  Events sync fine between the iOS devices and fine from the computer to the iOS devices but not from the iOS devices to the computer.
    Try:
    Backup your computer and iOS devices before doing anything else:
    http://support.apple.com/kb/HT1427
    http://support.apple.com/kb/ht1766
    Ensure all the devices in use are fully up to date: Apple > Software Update / Settings > General > Software Update
    Make separate backups of critical data:
    Backup your computer Addressbook: http://docs.info.apple.com/article.html?path=AddressBook/4.0/en/ad961.html
    Backup your computer iCal: http://support.apple.com/kb/HT2966
    Reset syncing on your Mac: http://support.apple.com/kb/TS1627
    Reply back if that does not resolve your issue.
    Hope that helps.

  • TS1363 My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue?

    My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue? I have already updated to the latest version of iTunes on my Windows 8 and I cannot synchronize my iPod for the time being. Please do help me to solve this problem. Thank You.

    uninstall all iTunes,5 programes,this worked for me after reinstall them

  • I'm having a problem saving a pages document as another format, like a Word document or PDF file.  I've never had this problem in the past.  Please help me!  I need to have this fixed a.s.a.p.

    Hello everyone,
    I'm currently having a problem saving a Pages document as another format, such as a Word document or PDF file.  I've never had this problem before with Pages.  Please help me!  I need to have this completed a.s.a.p.
    Thanks,
    Amy

    To save as a PDF, you do that from Print
    To save as Wrod format, you export
    Allan

  • I have a really really big problem to my iphone icloud please help me i could send you my birth certificate for confirmation that im the real user please help me

         i have a really really big problem to my iphone icloud please help me i could send you my birth certificate for confirmation that im the real user please help me apple.corp and please tell me if this is not possible to be done it almost a month that i cant use my iphone.
         thank you for those who read this
    <Email Edited by Host>

    Remove your email address.  This is a public website, and you are addressing thousands of strangers.
    After doing that, tell us what your issue actually is.  This is a user-to-user technical forum.  You are not addressing Apple here.

  • Firefox is having problems with "Southwest Airlines website" Please help soon

    Whenever I go on Southwest Airline website, it does not work. I am having this problem since last month. Please help on this as soon as you can.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Other things that need your attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    * Shockwave Flash 10.0 r22
    * Java Plug-in 1.6.0_07 for Netscape Navigator (DLL Helper)
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://kb.mozillazine.org/Flash
    *http://www.adobe.com/software/flash/about/
    Update the [[Java]] plugin to the latest version.
    *http://kb.mozillazine.org/Java
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • HT4623 why my device  had "no service" even I already put my sim card..I have follow a few instruction from you tube how to solve this problem but all failed. Please help me .TQ

    why my device  had "no service" ..I have follow a few instruction from you tube how to solve this problem but all failed. Please help me .TQ

    See if anything in this support document help http://support.apple.com/kb/ts4429

  • TS3376 I was able to use the findmyiphone app last week, but now I have been getting an error message "Can't load findmyiphone.  There was a problem loading the application."  please help as we are trying to locate an ipod with pics of a no deceased loved

    I was able to use the findmyiphone app last week, but now I have been getting an error message "Can't load findmyiphone.  There was a problem loading the application."  please help as we are trying to locate an ipod with pics of a no deceased loved one.

    Had the same problem and the same message --  was suddenly unable to access icloud apps on my pc, also using Windows 7 and Internet Explorer. After several days of pulling my hair out, decided to try a different browser and was able to get in by using Firefox instead of Internet Explorer.  Hope this helps. 

  • Problem in creating db link

    Hi,
    1. I have created db link using as follows (ORACLE 8.1.6):
    CREATE PUBLIC DATABASE LINK TORAMESH CONNECT
    TO rem_user IDENTIFIED BY pass USING 'ST1';
    2. I am having string ST1 created.
    3. When I connect using string I am getting connecting to
    remote database, but the problem comes when
    I connect to local database and tries and query using
    @TORAMESH, then I am getting following error :
    ORA-02019: connection description for remote database not found.
    Please help me to solve the problem.
    Thanks in advance...
    Ramesh

    I think that it was caused by the improper dblink name which do not give the complete description of your remote database.
    See the information below from http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/sql_elem.htm#27762
    , you may find what you should used for the dblink name.
    The name that you give to a database link must correspond to the name of the database to which the database link refers and the location of that database in the hierarchy of database names. The following syntax diagram shows the form of the name of a database link:
    database.domain
    database should specify name portion of the global name of the remote database to which the database link connects. This global name is stored in the data dictionary of the remote database; you can see this name in the GLOBAL_NAME view.
    domain should specify the domain portion of the global name of the remote database to which the database link connects. If you omit domain from the name of a database link, Oracle qualifies the database link name with the domain of your local database as it currently exists in the data dictionary.
    connect_descriptor allows you to further qualify a database link. Using connect descriptors, you can create multiple database links to the same database. For example, you can use connect descriptors to create multiple database links to different instances of the Oracle Parallel Server that access the same database.
    The combination database.domain is sometimes called the "service name".

  • Problem in creating workspaces..Please guide

    Hello All,
    Am facing a problem in creating workspaces in DTR. Am working on EP7 SR2 (SP9)
    Have read mostly all related posts on SDN but cannot catch the missing link...Please guide me for the same:
    <u><b>setvars.bat</b></u>
    @echo off
    rem Default properties definition for the DTR Client Commandline Tool:
    rem -
    rem (1) Mandatory: DTR configuration folder:
    set DTR_HOME=C:\Documents and Settings\RHunjan
    set CFG_DIR=%DTR_HOME%\.dtr
    rem Remark: How to find DTR_HOME folder?
    rem - In Release 6.40:
    rem          The default location is C:\Documents and Settings\<user>\.sapnetweaver.
    rem - In Release 7.1:
    rem      Start Netweaver Developer Studio and login to the configuration / client
    rem      where you would like to work, then choose the menu: 'file' -> 'Switch workspace'.
    rem      The upcoming dialog shows the currently used Eclipse workspace.
    rem      The DTR configuration folder is <currently used eclipse workspace>.jdi
    rem (2) Optional: Folder with the definition of logging properties:
    set LOGGING=%DTR_HOME%\logging.properties
    rem (3) Default properties:
    rem set DEFAULT_PROPERTIES=-Dvfs.configfolder=%CFG_DIR% -Dvfs.logging=%LOGGING%
    <u><b>dtrshell.bat</b></u>
    @echo off
    rem Run DTR Commandline Shell:
    rem -
    rem (1) Get it running:
    rem -
    rem - Adapt configuration settings in setvars.bat.
    rem - Uncomment the settings for the used archives
    rem       that fit to the currently used Netweaver Developer Studio.
    call setvars.bat
    set CLASS_PATH=
    rem (2) Used Archives Settings:
    rem -
    rem Used Archives in 6.40 and 7.00 Netweaver Developer Studio installation:
    rem -
    set CLASS_PATH=%CLASS_PATH%;com_tssap_dtr_client_vfs.jar
    set CLASS_PATH=%CLASS_PATH%;httpclient.jar
    set CLASS_PATH=%CLASS_PATH%;httpclientext.jar
    set CLASS_PATH=%CLASS_PATH%;com_tssap_dtr_client_commandline.jar
    rem Archives from foreign Plugins:
    set CLASS_PATH=%CLASS_PATH%;..\com.tssap.sap.libs.xmltoolkit\lib\sapxmltoolkit.jar
    set CLASS_PATH=%CLASS_PATH%;..\com.tssap.sap.libs.logging\lib\logging.jar
    set CLASS_PATH=%CLASS_PATH%;..\com.sap.tc.jarm\lib\jARM.jar
    rem The recommended value for maximum heap size for the JVM to run DTR Commandline client is 256M or higher.
    rem You can change the settings based on system resources available.
    set VM_PARAMS=-Xmx256m
    rem (3) Run DTR Commandline Shell:
    rem -
    java %VM_PARAMS% -classpath %CLASS_PATH% %DEFAULT_PROPERTIES% com.tssap.dtr.client.commandline.DTRShell %*
    ===================
    I get an error saying:
    <i><b>Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/tc/logging/Lo
    cation
            at com.tssap.dtr.client.commandline.DTRShell.<clinit>(DTRShell.java:21)</b></i>
    Please guide......
    Awaiting Reply.
    Thanks & WArm Regards,
    Ritu
    Message was edited by:
            Ritu  Hunjan

    Hello Ritu,
    the problem is probably in these lines:
    rem Archives from foreign Plugins:
    set CLASS_PATH=%CLASS_PATH%;..com.tssap.sap.libs.xmltoolkitlibsapxmltoolkit.jar
    set CLASS_PATH=%CLASS_PATH%;..com.tssap.sap.libs.loggingliblogging.jar
    set CLASS_PATH=%CLASS_PATH%;..com.sap.tc.jarmlibjARM.jar
    For a NW04s studio these paths are not correct, the plugin directories have some version suffix.
    rem Archives from foreign Plugins:
    set CLASS_PATH=%CLASS_PATH%;..com.tssap.sap.libs.xmltoolkit_2.0.0libsapxmltoolkit.jar
    set CLASS_PATH=%CLASS_PATH%;..com.tssap.sap.libs.logging_2.0.0liblogging.jar
    set CLASS_PATH=%CLASS_PATH%;..com.sap.tc.jarm_2.0.0libjARM.jar
    Please check the folder names in the /eclipse/plugins/ directory to verify that this is correct for your installation.
    Regards,
    Marc

  • Problem with interputting  accessframe  example please help!!!

    A use code bellow to access every frame in the movie :
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.awt.Color.*;
    import java.awt.image.*;
    import java.util.*;
    import java.awt.image.*;
    import javax.media.util.*;
    import javax.swing.JFrame;
    public class Film2ramki implements ControllerListener {
    Processor p;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    public boolean alreadyPrnt = false;
    public void zakoncz(){
         p.stop();
         p.close();
         p.deallocate();
    public boolean open(MediaLocator ml) {
    try {
    p = Manager.createProcessor(ml);
    } catch (Exception e) {
    System.err.println("Failed to create a processor from the given url: " + e);
    return false;
    p.addControllerListener(this);
    // Put the Processor into configured state.
    p.configure();
    if (!waitForState(p.Configured)) {
    System.err.println("Failed to configure the processor.");
    return false;
    // So I can use it as a player.
    p.setContentDescriptor(null);
    // Obtain the track controls.
    TrackControl tc[] = p.getTrackControls();
    if (tc == null) {
    System.err.println("Failed to obtain track controls from the processor.");
    return false;
    // Search for the track control for the video track.
    TrackControl videoTrack = null;
    for (int i = 0; i < tc.length; i++) {
    if (tc.getFormat() instanceof VideoFormat) {
    videoTrack = tc[i];
    break;
    if (videoTrack == null) {
    System.err.println("The input media does not contain a video track.");
    return false;
    System.err.println("Video format: " + videoTrack.getFormat());
    // Instantiate and set the frame access codec to the data flow path.
    try {
    Codec codec[] = { new PreAccessCodec(),
    new PostAccessCodec()};
    videoTrack.setCodecChain(codec);
    } catch (UnsupportedPlugInException e) {
    System.err.println("The process does not support effects.");
    // Realize the processor.
    p.prefetch();
    if (!waitForState(p.Prefetched)) {
    System.err.println("Failed to realize the processor.");
    return false;
    p.start();
    return true;
    boolean waitForState(int state) {
    synchronized (waitSync) {
    try {
    while (p.getState() != state && stateTransitionOK)
    waitSync.wait();
    } catch (Exception e) {}
    return stateTransitionOK;
    public void controllerUpdate(ControllerEvent evt) {
    if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
    stateTransitionOK = true;
    waitSync.notifyAll();
    } else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
    stateTransitionOK = false;
    waitSync.notifyAll();
    } else if (evt instanceof EndOfMediaEvent) {
         p.stop();
         p.close();
         System.exit(0);
    Film2ramki(){}
    public void startnow (String plik) {
         //this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
    String url = "file:"+plik;
    if (url.indexOf(":") < 0) {
    prUsage();
    System.exit(0);
    MediaLocator ml;
    if ((ml = new MediaLocator(url)) == null) {
    System.err.println("Cannot build media locator from: " + url);
    System.exit(0);
    if (!open(ml))
    System.exit(0);
    static void prUsage() {
    System.err.println("Usage: java Film2ramki <url>");
    * Inner class.
    * A pass-through codec to access to individual frames.
    public class PreAccessCodec implements Codec {
    * Callback to access individual video frames.
    void accessFrame(Buffer frame) {
    // For demo, we'll just print out the frame #, time &
    // data length.
    long t = (long)(frame.getTimeStamp()/10000000f);
    System.err.println("Pre: frame #: " + frame.getSequenceNumber() +
    ", time: " + ((float)t)/100f +
    ", len: " + frame.getLength());
    * The code for a pass through codec.
    // We'll advertize as supporting all video formats.
    protected Format supportedIns[] = new Format [] {
    new VideoFormat(null)
    // We'll advertize as supporting all video formats.
    protected Format supportedOuts[] = new Format [] {
    new VideoFormat(null)
    Format input = null, output = null;
    public String getName() {
    return "Pre-Access Codec";
    // No op.
    public void open() {
    // No op.
    public void close() {
    // No op.
    public void reset() {
    public Format [] getSupportedInputFormats() {
    return supportedIns;
    public Format [] getSupportedOutputFormats(Format in) {
    if (in == null)
    return supportedOuts;
    else {
    // If an input format is given, we use that input format
    // as the output since we are not modifying the bit stream
    // at all.
    Format outs[] = new Format[1];
    outs[0] = in;
    return outs;
    public Format setInputFormat(Format format) {
    input = format;
    return input;
    public Format setOutputFormat(Format format) {
    output = format;
    return output;
    public int process(Buffer in, Buffer out) {
    // This is the "Callback" to access individual frames.
    accessFrame(in);
    // Swap the data between the input & output.
    Object data = in.getData();
    in.setData(out.getData());
    out.setData(data);
    // Copy the input attributes to the output
    out.setFlags(Buffer.FLAG_NO_SYNC);
    out.setFormat(in.getFormat());
    out.setLength(in.getLength());
    out.setOffset(in.getOffset());
    return BUFFER_PROCESSED_OK;
    public Object[] getControls() {
    return new Object[0];
    public Object getControl(String type) {
    return null;
    public class PostAccessCodec extends PreAccessCodec {
    // We'll advertize as supporting all video formats.
    public PostAccessCodec() {
    supportedIns = new Format [] {
    new RGBFormat()
    * Callback to access individual video frames.
    void accessFrame(Buffer frame) {
    // For demo, we'll just print out the frame #, time &
    // data length.
    if(!alreadyPrnt)
    BufferToImage stopBuffer = new BufferToImage((VideoFormat)frame.getFormat());
    System.out.println(stopBuffer.toString());
    System.out.println("CreatedBuffer");
    System.out.println("Created stopImage");
    Image stopImage = stopBuffer.createImage(frame);
    System.out.println("stopImage is full");
    if(stopImage == null)
    System.out.println("stopImage is null");
    try
    BufferedImage outImage = new BufferedImage (320, 240,BufferedImage.TYPE_INT_RGB);
    Graphics og = outImage.getGraphics();
    og.drawImage(stopImage,0,0,320,240,null);
    //prepareImage(outImage,rheight,rheight, null);
    Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
    ImageWriter writer = (ImageWriter)writers.next();
    //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
    File f = new File("frames\\"+frame.getSequenceNumber() + ".jpg");
    ImageOutputStream ios = ImageIO.createImageOutputStream(f);
    writer.setOutput(ios);
    //Finally, the image may be written to the output stream:
    //BufferedImage bi;
    //writer.write(imagebi);
    writer.write(outImage);
    ios.close();
    catch(IOException e)
    System.out.println("Error :" + e);
    //alreadyPrnt = true;
    long t = (long)(frame.getTimeStamp()/10000000f);
    System.err.println("Post: frame #: " + frame.getSequenceNumber() +
    ", time: " + ((float)t)/100f +
    ", len: " + frame.getLength());
    if(frame.getLength()==0){p.stop();p.close();p.deallocate();}
    public String getName() {
    return "Post-Access Codec";
    this code capture every frame from movie but it never ends running and i can't invoke any metod after grabing frames becouse its still running. How Can I stop this to enter the next metod.
    Please help me
    thx

    Answering sam04 question Yes this make that every frame is captured
    Back to my problem :
    I invoke caputre frames class from other class like this:
    Film2ramki f2r=new Film2ramki();
    f2r.startnow(pathtomov);
    System.out.println("End of capture");...........................
    So when capturing frames ends it should print "End of caputre" but I get something like this :
    JPEG, 320x240, FrameRate=13.0, Length=18198
    Video format: JPEG, 320x240, FrameRate=13.0, Length=18198
    Pre: frame #: 1, time: 0.0, len: 16282
    Post: frame #: 1, time: 0.0, len: 230400
    End of capture
    Pre: frame #: 2, time: 0.07, len: 16471
    Post: frame #: 2, time: 0.07, len: 230400
    Pre: frame #: 3, time: 0.15, len: 16620
    Post: frame #: 3, time: 0.15, len: 230400
    Pre: frame #: 4, time: 0.23, len: 16541
    Post: frame #: 4, time: 0.23, len: 230400
    Pre: frame #: 5, time: 0.3, len: 16749
    Pre: frame #: 18, time: 1.3, len: 15708
    Post: frame #: 18, time: 1.3, len: 230400
    Pre: frame #: 18, time: 1.3, len: 0
    Post: frame #: 18, time: 1.3, len: 0this is strange becouse it captures 1 frame end print "End of capture" and then its capures other frames. Why ?????

  • Serious audio glitch problem in 9.1.1 - please help!

    Got a problem with audio glitching that is driving me insane - hopefully someone can help (please! :_))
    I'm on Logic 9.1.1 on a recent MacPro using 10.5.8, 12Gb memory. I've created an arrangement in Logic with two multi timbral / multi-output instruments (Kontakt and Stylus RMX - both up to date versions) with aux outputs for all of the instruments channels; 16 in the case of Kontakt, 8 in the case of RMX.
    I'll work with this setup and after a while I find that whenever I play and then press stop, a tiny portion of audio will repeat rapidly, over and over again in the 'master' left output channel at +6.0dB - it also shows up on all the instrument auxes at a much lower level. It's as if Aphex Twin has invaded my Mac... Weirdly, this problem crops up even if I'm not outputting anything from the multi-instruments - it's enough that say, an EXS instrument, plays something, I'll press stop, and then the glitch signal will appear in all the level meters of the multi instruments and master output, but not on the EXS level meter. If I press play again, the glitch disappears and audio playback is perfect - it only happens when stop is pressed. And no sign of it if there's a silent part in the arrangement with no tracks playing anything.
    If I have any instances of reverb on bus channels, that audio will will also feed into the left channel of those busses, even when there are no channel strips sending to them. Weird as ****, and driving me up the wall with frustration.
    I've omitted it being down to my audio interface (Metric Halo 2882) as the problem persists if I switch to the Mac internal I/O.
    I'm trying to work through this at the mo as I've got a deadline for 2pm this afternoon - but I'm worried I might not make it due to throwing my feckin computer out the window. Please help - thanks!

    Alasdair Reid wrote:
    It's as if Aphex Twin has invaded my Mac...
    If your deadline wasn't looming, I'd say buss everything to a stereo track and record this stuff. It sounds great, you could use it in another project later...
    But to your problem: The only quick solution I can think of for you to try is to create a brand new fresh project and use the selective track import feature to bring your tracks into the new project. Don't start from an old template (that you may still be using since Logic 8 or something) because this could indeed be the root of the problem. Build a new template from Logic 9.1.1, then make a new project from that and import all your tracks. If it's your project that's corrupted somehow, this could be the trick to solve it, and it won't take too long to try, so it's worth a shot.
    I'm not sure of this, but something is telling me I've seen this problem before, and if so it was on Leopard (not Snow Leopard) on a MacPro in the studio. Have never had it on my personal MBP (which was only ever Tiger and then Snow Leopard - I skipped Leopard on purpose because the studio machines seemed so very dicey). Also, I don't use RMX on my own machine but in the studio, yes. Same deal for multiple output instruments, I rarely do that either. On that point, another thing you could try is to forget about multiple outs for now, and just work with stereo instances. Yes I realize this will mess up your entire painstakingly built-up mix.. but if this is causing the flakiness you may have no choice but to go back to stereo instances, finish your writing, then do the whole mute/solo thing to bounce your individual parts to audio and proceed from there. In this scenario, selective track import will be a timesaver too because once you've done all the bouncing, you can just create a new project and import all of your channel strips and so on, to then re-assign the individually bounced tracks to the assignments you had before. Will be quicker to recreate your mix than having to do it from scratch. Or you might not even need to do this step because if eliminating the multi-out instruments makes the prob go away, then you can just recreate your assignments within the same project using the bounced audio tracks.
    Get to it.
    Once you've delivered.. I'd open that project again and record all of that lovely Aphex Twin messiness for later use.

Maybe you are looking for