.FindText not respecting parameters in Acrobat 10

Hello to all,
New to programming with Adobe. Experienced in MS Office VBA.
I have some code in VBA (EXCEL) that opens pdf files (created from WORD 2007 and searchable) and searches each one for a series of key words.
The example below works fine on Acrobat 8, but not on my newly installed Acrobat 10 (Acrobat X version 10.0.0).
The text to find is "CO" (whole word only, case sensistive) - not present as such in the test pdf file, but the word "COMMITTEE" is.
The code used is: spfd = AVDoc.FindText("CO", 1, 1, 1)
This results in spfd=False for Acrobat 8 (which is correct), but results in spfd=True in acrobat 10.
If I do the same search through the Acrobat application interface on the same pdf file, specifying whole words only & case sensitive, it does not find a match, which is correct.
Any thoughts?
Many thanks in advance for any help!
timo_mika

Hello to all,
This is justto say that the problem also occurs on a brand new machine with new Acrobat X installation. Any help would be appreciated, including other methods to find text (over 100 key words, noting that some of the strings contain more than one word...).
Thanks!

Similar Messages

  • Tablet Wacom has wrong behaviour, not respect alt right mouse in Photoshop CC 2014

    I have set my Wacom Bamboo tablet to send modifier Alt+Right button when I press the button, then I can change size or hardness of the cursor.
    I works in CS6 and CC but not in CC 2014. The bubble "alt" is now displayed but Photoshop not respect the alt button and I cannot change the size of cursor. When I press the alt+right button on mouse, it works.
    When I change mode of tablet from Pen to Mouse, it works but I cannot map the cursor to main display - this workaround is not applicable for me :-(
    Any suggestions?
    Thanks

    I'm having the same issue. Scroll wheel works fine in all Adobe products besides Photoshop. I've tried reinstalling Photoshop, plugging in the mouse to a different USB port, reinstalling the mouse driver, and restarting my computer multiple times. This bug makes Photoshop practically useless, as everything takes about twice as long to get done.
    I really hope we get a fix for this soon. So far CC has been a huge disappointment, filled with small, productivity-destroying bugs like this one.

  • NavBarByRelationshipItem: Does not respect ViewId

    Hi experts,
    From an opportunity I would like to show activities in the Navigation bar to the left. Thats no problem. But changing the view from the associated view to a custom view - does not work.
    I tried to fill in the Optional attribute "ViewId" with the ID for the view in question, but dyn crm still shows the associated view.
    Microsoft actually address this problem in rollup10, I'm on rollup18. So it should work.
    This is the snippet from my customization.xml file
    <NavBarByRelationshipItem RelationshipName="Opportunity_ActivityPointers" Id="navActivities" Show="true" Sequence="10000" ViewId="{987239E3-8E9C-E411-9580-D485640E8203}" Area="Info">
      <Titles>
        <Title LCID="1030" Text="Aktiviteter" />
      </Titles>
    </NavBarByRelationshipItem>
    Any help would be appreciated
    Henrik
    --- Best regards Henrik Skydtsgaard

    Found a solution. If you use the standard Id, in this case "navActivities", then ViewId is not respected. Choose another Id and it works.
    /henrik
    --- Best regards Henrik Skydtsgaard

  • This.print(pp) with interactive type silent or automatic does not work  after upgrade acrobat reader 9 to acrobat reader 11

    After an upgrade of acrobat reader 9 to acrobat reader 11 the automatic printing of a pdf. The pdf is opened, but the print does not happen. With acrobat reader 9 it works. But with acrobat reader 11 the printing does not happen.
    I discovered when you specify pp.constants.interactionLevel.full it works on acrobat reader 11. But when you specify pp.constants.interactionLevel.silent or pp.constants.interactionLevel.automatic it does not work on acrobat reader 11. But with the full option we have a dialog  print box
    we do not want.
    In our jsp we load a pdf document and create a message handler to detect the print events of a pdf document that is in an <object> tag.
    In the pdf document we add
    package be.post.lpo.util;
    import org.apache.commons.lang.StringEscapeUtils;
    import org.apache.commons.lang.StringUtils;
    public class AcrobatJavascriptUtil {  
        public String getPostMessageToHostContainer(String messageName, String messageBody){
            return "var aMessage=['"+messageName+ "', '"+ messageBody+"'];this.hostContainer.postMessage(aMessage);";
        public String getAutoPrintJavaScript(String interactiveType, String printerName,String duplexType) {    
            String interactiveTypeCommand = "";
            if (StringUtils.isNotBlank(interactiveType)){
                interactiveTypeCommand = "pp.interactive = " + interactiveType + ";";
            String duplexTypeCommand = "";
            if (StringUtils.isNotBlank(duplexType)){
                duplexTypeCommand = "pp.DuplexType = " + duplexType + ";";
            return "" + // //
                    "var pp = this.getPrintParams();" + // //
                    // Nointeraction at all dialog, progress, cancel) //
                    interactiveTypeCommand + //
                    // Always print to a printer (not to a file) //
                    "pp.printerName = \"" + StringEscapeUtils.escapeJavaScript(printerName) + "\";" + //
                    // Never print to a file. //
                    "pp.fileName = \"\";" + //
                    // Print images using 600 DPI. This option MUST be set or some barcodes cannot //
                    // be scanned anymore. //
                    "pp.bitmapDPI = 600;" + //
                    // Do not perform any page scaling //
                    "pp.pageHandling = pp.constants.handling.none;" + //
                    // Always print all pages //
                    "pp.pageSubset = pp.constants.subsets.all;" + //
                    // Do not autocenter //
                    "pp.flags |= pp.constants.flagValues.suppressCenter;" + //
                    // Do not autorotate //
                    "pp.flags |= pp.constants.flagValues.suppressRotate;" + //
                    // Disable setPageSize i.e. do not choose paper tray by PDF page size //
                    "pp.flags &= ~pp.constants.flagValues.setPageSize;" + //
                    // Emit the document contents. Document comments are not printed //
                    "pp.printContent = pp.constants.printContents.doc;" + //
                    // printing duplex mode to simplex, duplex long edge, or duplex short edge feed //
                    duplexTypeCommand +
                    // Print pages in the normal order. //
                    "pp.reversePages = false;" + //
                    // Do the actual printing //
                    "this.print(pp);";
    snippets for java code that adds
    package be.post.lpo.util;
    import org.apache.commons.lang.StringUtils;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.pdf.PdfAction;
    import com.lowagie.text.pdf.PdfDestination;
    import com.lowagie.text.pdf.PdfImportedPage;
    import com.lowagie.text.pdf.PdfName;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    public class PdfMergerUtil{
        private static final PdfName DID_PRINT = PdfName.DP;
        private static final PdfName WILL_PRINT = PdfName.WP;
        private List<PdfActionJavaScriptHolder> actionJavaScripts = new ArrayList<PdfActionJavaScriptHolder>();
        private class PdfActionJavaScriptHolder{
            private final PdfName actionType;
            private final String javaScript;
            public PdfActionJavaScriptHolder(PdfName actionType, String javaScript) {
                super();
                this.actionType = actionType;
                this.javaScript = javaScript;
            public PdfName getActionType(){
                return this.actionType;
            public String getJavaScript(){
                return this.javaScript;
        public void writePdfs(OutputStream outputStream, List<InputStream> documents, String documentLevelJavaScript) throws Exception {
            Document document = new Document();
            try {          
              // Create a writer for the outputstream
              PdfWriter writer = PdfWriter.getInstance(document, outputStream);
              document.open();      
              // Create Readers for the pdfs.
              Iterator<PdfReader> iteratorPDFReader = getPdfReaders(documents.iterator());
              writePdfReaders(document, writer, iteratorPDFReader);
              if (StringUtils.isNotBlank(documentLevelJavaScript)){
                  writer.addJavaScript(documentLevelJavaScript);
              addAdditionalActions(writer);
              outputStream.flush();      
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                if (document.isOpen()){
                    document.close();
                try {
                    if (outputStream != null){
                        outputStream.close();
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                    throw ioe;
        public void addAdditionalDidPrintAction(String javaScript){
            actionJavaScripts.add(new PdfActionJavaScriptHolder(DID_PRINT, javaScript));   
        public void addAdditionalWillPrintAction(String javaScript){
            actionJavaScripts.add(new PdfActionJavaScriptHolder(WILL_PRINT, javaScript));   
        private void writePdfReaders(Document document, PdfWriter writer,
                Iterator<PdfReader> iteratorPDFReader) {
            int pageOfCurrentReaderPDF = 0;      
              // Loop through the PDF files and add to the output.
              while (iteratorPDFReader.hasNext()) {
                PdfReader pdfReader = iteratorPDFReader.next();
                // Create a new page in the target for each source page.
                while (pageOfCurrentReaderPDF < pdfReader.getNumberOfPages()) {
                  document.newPage();
                  pageOfCurrentReaderPDF++;          
                  PdfImportedPage page = writer.getImportedPage(pdfReader, pageOfCurrentReaderPDF);
                  writer.getDirectContent().addTemplate(page, 0, 0);          
                pageOfCurrentReaderPDF = 0;
        private void addAdditionalActions(PdfWriter writer) throws DocumentException{
            if (actionJavaScripts.size() != 0 ){
                PdfAction action = PdfAction.gotoLocalPage(1, new PdfDestination(PdfDestination.FIT), writer);
                writer.setOpenAction(action);
                for (PdfActionJavaScriptHolder pdfAction : actionJavaScripts ){
                    if (StringUtils.isNotBlank(pdfAction.getJavaScript())){
                        action = PdfAction.javaScript(pdfAction.getJavaScript(), writer);
                        writer.setAdditionalAction(pdfAction.getActionType(), action);
        private Iterator<PdfReader> getPdfReaders(Iterator<InputStream> iteratorPDFs) throws IOException {
            List<PdfReader> readers = new ArrayList<PdfReader>();
              while (iteratorPDFs.hasNext()) {
                InputStream pdf = iteratorPDFs.next();
                PdfReader pdfReader = new PdfReader(pdf);
                readers.add(pdfReader);        
            return readers.iterator();
    JSP code
    <script type="text/javascript" src="<bean:message key="scripts.js.internal.jquery" bundle="app"/>"></script>
        <script language="javascript">
        function goToDidPrintUrl(){
            var url = "<%=didPrintUrl%>";
            window.location.assign(url);
        function createMessageHandler() {
            var PDFObject = document.getElementById("myPdf");
            PDFObject.messageHandler = {
                onMessage: function(msg) {
                     if (msg[0] == "WILL_PRINT"){      
                        $("#printingTransitFeedBackMessage").text('<%=willPrintMessage%>');                   
                     if(msg[0] == "DID_PRINT"){
                        $("#printingTransitFeedBackMessage").text('<%=didPrintMessage%>');               
                        setTimeout('goToDidPrintUrl()',4000);
                onError: function(error, msg) {
                    alert(error.message);
        </script>
    </head>
    <body onLoad="createMessageHandler();">
    <div id="printingTransitFeedbackArea">
      <div class="info" id="printingTransitFeedBackMessage"><%=documentOpenMessage%></div>
    </div>
    <object id="myPdf" type="application/pdf" width="100%" height="100%"  data="<%=toBePrintedUrl%>">
    </object>
    </body>

    From the JS API Reference of the print method:
    Non-interactive printing can only be executed during batch, console, and menu
    events.
    Outside of batch, console, and menu events, the values of bUI and of interactive are ignored
    and a print dialog box will always be presented.

  • How can I change the default pdf reader from the installed (but not yet registered) Adobe Acrobat 9 Pro to Adobe Reader XI?

    How can I change the default pdf reader from the installed (but not yet registered) Adobe Acrobat 9 Pro to Adobe Reader XI? I'm having some hiccups getting Adobe to register the software, but since I set it as the default .pdf reader during setup, things try (and fail) to open in the as yet unregistered software. How can I change it temporariiy to the Acrobat Reader XI that I have installed?

    Anubha,
    It worked! Thank you so much.
    I'd opened file with the 'Open with' feature then clicking Adobe Reader,
    but that didn't do it. When I used 'Open with', then 'Choose default
    program...', it worked like a charm.
    Again, thank you!
    Jonathan
    On Wed, Mar 18, 2015 at 10:16 PM, Anubha Goel <[email protected]>

  • I can not re install Adobe Acrobat 7.0 professional on my computer.  It is saying a qualifying product is not detected. I cant even get through using the customer service line they provide 800-272-3623.  This is the worst interactionI have ever had with a

    i can not re install Adobe Acrobat 7.0 professional on my computer.  It is saying a qualifying product is not detected. I cant even get through using the customer service line they provide 800-272-3623.  This is the worst interactionI have ever had with a company.

    Hi joej49728017,
    I am so sorry for the inconvenience caused. However this is just because Adobe Acrobat 7.0 is an outdated version & the now the activation server for it does not exist.
    Please refer to the following KB doc.  Error: "Activation Server Unavailable" | CS2, Acrobat 7, Audition 3
    The above link will help you to  install a special version that does not require activation.
    In case you further need any help, please let us know. We will be more than happy to help you.
    Regards,
    Aadesh

  • I purchased Adobe CS4.  I am now being asked for my serial number and when I put it in the program does not recognize it for Acrobat Pro 9 though it does for PhotoShop, Bridge and the rest of the suite.  What can I do?

    I purchased Adobe CS4.  I am now being asked for my serial number and when I put it in the program does not recognize it for Acrobat Pro 9 though it does for PhotoShop, Bridge and the rest of the suite.  What can I do?

    Contact support if you have serial number issues. Otherwise start by checking this stuff:
    Sign in, activation, or connection errors
    Mylenium

  • I can not download the Adobe Acrobat program.

    I can not download the Adobe Acrobat program. The following message is displayed:
    "Language / not supported platform.
    adobe acrobat is not available in your language or platform. For a list of supported platforms and languages, click here. "I tried it in Spanish, English French and Italian, and always the same message.
      What can I do?

    You can try downloading from: http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html
    As "Test Screen Name" said, Vista isn't officially supported, it is quite possible you face further problems down the road.

  • I have a window XP , lotus notes 6.5 and acrobat pro 8 , and when i am in lotus i habve the icon to convert my message in PDF,

    I'
    I have a window XP , lotus notes 6.5 and acrobat pro 8 , and when i am in lotus i have the icon to convert my message in PDF, this work well,
    but  i have switch my pc in windows 7 and now when i am in lotus i have always the icon but when i click on it doesn't happen anything.
    is it suppose to work with 7 if not did somebody have an other suggestion to do the same thin in lotus.
    thank very much

    Hi benlebvb,
    Are you running a 32- or 64-bit OS? Please see this thread: Acrobat 8 and Windows 7 Don't Work
    While that is not a supported configuration (Acrobat 7 on Windows 8), some customers have been able to make it work. The thread I've referenced should give you some good pointers.
    Best,
    Sara

  • When printing in Excel It is always want to use the acrobat X pro trial, which the trial is expired. I do not want to use acrobat X pro trial anymore. How can I reset it and use simple acrobat to print my PDF document?

    When printing in Excel It is always want to use the acrobat X pro trial, which the trial is expired. I do not want to use acrobat X pro trial anymore. How can I reset it and use simple acrobat to print my PDF document?

    Hi screen name,
    Adobe PDF printer gets installed when you install Acrobat 10 Pro.
    To use this printer you need to purchase Acrobat. Once the trial period is over you cannot use the printer to create pdf files.
    An alternative way for you is to utilize Microsoft's own inbuilt pdf engine.
    You can simply open the file and select 'Save as' and in the type list select 'pdf'
    Please refer : http://office.microsoft.com/en-in/excel-help/save-as-pdf-HA010354239.aspx
    Regards,
    Rave

  • [SOLVED] Xfce composite settings are not respected

    I have come across a problem with the Xfce composite manager. I enable this primarily to have conky draw transparently on the desktop wallpaper, but then found shadows and transparency did not cause much more impact on performance after enabling composite effects in the first place.
    But now I'm experiencing that some settings in the Tweaks settings menu are not respected. For instance, I've enabled transparency both when moving and resizing windows, but they only turn transparent when moving them. Also, I've enabled transparency for notifications, which to my understanding includes the desktop right-click menu, but they are opaque. Anybody else experience this? I've tried turning composite effects off, logging out and back in and turning them on again. No luck there. Also, if you should know where these settings are stored (text file somewhere/Xconf...) I'd be happy to inspect them
    Thank you!
    Last edited by mariusmeyer (2011-08-02 14:12:37)

    stqn wrote:Uh? I really don't see why the desktop right-click menu would be using notifications' opacity setting... Anyway here it works as expected (notifications are transparent, not the menu.)
    Now it does for me as well. The reason I thought the menu was a part of it was because it became transparent when I enabled notification transparency the first time but this behaviour went away after a logoff-login I think.
    The big problem I'm struggeling with now is still the fact that xfwm does not respect the settings as found in Xfconf / Settings -> Tweaks. The shadows on the borders won't go away no matter what I do; however and I'm able to turn off the resize/move transparency in-session. When I log out and back in again, the behaviour reverts, although the settings as I set them remain unchanged =_=
    If anything, does anybody know how to return all of xfwm's settings to the default, so I can start over? All I really need compositing for is transparent conky anyways....
    EDIT: Okey, it seems this has something to do with the xfwm theme I use :s after switching to other themes in the list I am suddenly in control of the composite effects again... Does this mean that the theme I use stores info on what composite effects it should use??
    Last edited by mariusmeyer (2011-08-02 14:08:17)

  • HT202774 Captions are not respected when turned off under Accessibility and still appear in the native player, how do I turn of captions?

    Captions are not respected when turned off under Accessibility and still appear in the native player, how do I turn of captions for the native player?

    Restart your computer while holding down left mouse key. That will eject the CD and your Mac will start as normal.
    Lupunus

  • Why ScheduledThreadPoolExecutor is not respecting the delay?

    I have a Customized implementation for ScheduledThreadPoolExecutor using which I am trying to execute a task for continuous execution. The problem I have faced here with the implementation is, some tasks executed continuously where as two of them are not respecting the delay and executed continuously. I am using the scheduleWithFixedDelay method.
    Even I have tried reproducing, but I couldn't.
    Here is my customized implementation.
    package com.portware.utils.snapmarketdata.test;
    import java.util.Collections;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Set;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    import java.util.concurrent.RejectedExecutionHandler;
    import java.util.concurrent.ScheduledFuture;
    import java.util.concurrent.ScheduledThreadPoolExecutor;
    import java.util.concurrent.ThreadFactory;
    import java.util.concurrent.ThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.atomic.AtomicInteger;
    import com.indigo.utils.Log;
    * To schedule the tasks in timely manner.
    public class TestScheduledExecutorService  {
      private static String CLASS_NAME = TestScheduledExecutorService.class.getName();
      protected final ThreadPoolExecutor executor;
      static int totalCount = 0;
      public static void main(String[] args) throws InterruptedException {
        TestScheduledExecutorService executorService = new TestScheduledExecutorService("Test", 10, null);
        final AtomicInteger integer = new AtomicInteger();
        final Set<Integer> testSet = new HashSet<Integer>();
        for (int i = 0; i < 10; i++) {
          testSet.add(i);
        Iterator<Integer> iterator = testSet.iterator();
        synchronized (testSet) {
        while(iterator.hasNext()) {
          integer.set(iterator.next());
          executorService.submitTaskForContinuousExecution(new Runnable() {
          @Override
          public void run() {
              System.out.println(Thread.currentThread().getName()+" Hello : "+integer.get() + " count value is:"+totalCount++);
        }, integer.toString());
        while (true) {
          synchronized (TestScheduledExecutorService.class) {
            TestScheduledExecutorService.class.wait();
      private static class MyRunnableTask implements Runnable{
        ScheduledFuture<?> future;
         * The task to be run.
        private Runnable runnable;
         * The number of attempt.
        private int count;
         * Maximum attempts configured under TCA configuration.
        private int maximumAttempts;
        private String id;
        public MyRunnableTask(Runnable runnable, int maximumAttempts, String id) {
          this.runnable = runnable;
          this.maximumAttempts = maximumAttempts;
          this.id = id;
        @Override
        public void run() {
          if (count >= maximumAttempts) {
            this.future.cancel(true);
            System.out.println("Cancelling the task with id :"+id+" after count :"+count);
            return;
          count++;
          this.runnable.run();
         * Return the number of attempt.
         * @return
        public int getCount() {
          return count;
      private void submitTaskForContinuousExecution(Runnable runnable, String id){
        int numOfAttempts = 10;
        MyRunnableTask runnableTask = new MyRunnableTask(runnable, numOfAttempts, id);
        int interval = 1;
        ScheduledFuture<?> scheduleWithFixedDelay = this.scheduleWithFixedDelay(runnableTask, 0, TimeUnit.SECONDS.toMillis(interval), TimeUnit.MILLISECONDS);
        if(id != null) {
          /*System.out.println("Submitted the task for continuous execution for the ticket id :"+id+"  with maximum attempts : "+numOfAttempts
              + " and interval : "+ interval);*/
          runnableTask.future = scheduleWithFixedDelay;
       * Creates an Executor Service to provide customized execution for tasks to be scheduled.
       * @param threadName is the name that shows in logs.
       * @param maximumThreads is the number of threads can be created.
       * @param rejectedExecutionHandler is if the Queue reaches it's maximum capacity and all the executor gives
       * the tasks to rejectedExecutionHandler.
      public TestScheduledExecutorService(String threadName, int maximumThreads, RejectedExecutionHandler rejectedExecutionHandler) {
        this.executor = createExecutor(threadName, maximumThreads, rejectedExecutionHandler);
      protected ThreadPoolExecutor createExecutor(String threadName, int minimumThreads, RejectedExecutionHandler rejectedExecutionHandler) {
        ThreadPoolExecutor threadPoolExecutor = new ScheduledThreadPoolExecutor(minimumThreads)
          @Override
          protected void beforeExecute(Thread t, Runnable r) {
            TestScheduledExecutorService.this.beforeExecute(t, r);
            this.purge();
          @Override
          protected void afterExecute(Runnable r, Throwable t) {
            TestScheduledExecutorService.this.afterExecute(r, t);
        if(rejectedExecutionHandler != null) {
          threadPoolExecutor.setRejectedExecutionHandler(rejectedExecutionHandler);
        }else{
          threadPoolExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        threadPoolExecutor.setThreadFactory(new TestThreadFactory(threadName, threadPoolExecutor));
        threadPoolExecutor.setKeepAliveTime(120, TimeUnit.SECONDS);
        threadPoolExecutor.allowCoreThreadTimeOut(true);
        return threadPoolExecutor;
       * Executes the task repeatedly with the given delay
       * @param task
       * @param initialDelay
       * @param delay
       * @param unit
       * @return
      public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, int initialDelay, long delay, TimeUnit unit) {
        return ((ScheduledThreadPoolExecutor)executor).scheduleWithFixedDelay(task, initialDelay, delay, unit);
       * To provide threads with specific features.
      protected static class TestThreadFactory implements ThreadFactory {
        private ThreadFactory threadFactory = Executors.defaultThreadFactory();
        private ThreadPoolExecutor threadPoolExecutor;
        private String groupName;
        public TestThreadFactory(String groupName, ThreadPoolExecutor threadPoolExecutor) {
          this.groupName = groupName;
          this.threadPoolExecutor = threadPoolExecutor;
        @Override
        public Thread newThread(Runnable r) {
          Thread thread = threadFactory.newThread(r);
          int activeCount = this.threadPoolExecutor.getPoolSize();
          activeCount++;
          thread.setName(this.groupName+"-"+activeCount);
          thread.setDaemon(true);
          return thread;
       * Performs initialization tasks before starting this thread.
       * @param thread
       * @param runnable
      protected void beforeExecute(Thread thread, Runnable runnable){
       * Performs tasks after execution of this runnable.
       * @param thread
       * @param runnable
      protected void afterExecute(Runnable runnable, Throwable t){
       * Initiates an orderly shutdown in which previously submitted
       * tasks are executed, but no new tasks will be
       * accepted. Invocation has no additional effect if already shut
       * down.
      public void shutdown() {
        if(this.executor != null) {
          Log.notice(CLASS_NAME, "shutdown", "Shutting down Executor Service");
          this.executor.shutdown();
       * Attempts to stop all actively executing tasks, halts the
       * processing of waiting tasks, and returns a list of the tasks
       * that were awaiting execution. These tasks are drained (removed)
       * from the task queue upon return from this method.
       * <p>There are no guarantees beyond best-effort attempts to stop
       * processing actively executing tasks.  This implementation
       * cancels tasks via {@link Thread#interrupt}, so any task that
       * fails to respond to interrupts may never terminate.
      public List<Runnable> shutdownNow() {
       if(this.executor != null) {
         Log.notice(CLASS_NAME, "shutdownNow", "Immediately shutting down Executor Service");
         try {
          return this.executor.shutdownNow();
        } catch (Exception e) {
          Log.notice(CLASS_NAME, "shutdownNow", e.getMessage());
       return Collections.emptyList();
       * Returns a Future for the given runnable task.
      public Future<?> submit(Runnable runnable) {
        if(this.executor != null) {
          return this.executor.submit(runnable);
        return null;
    Is there any possibility for the continuous execution or not?

    I have a Customized implementation for ScheduledThreadPoolExecutor using which I am trying to execute a task for continuous execution. The problem I have faced here with the implementation is, some tasks executed continuously where as two of them are not respecting the delay and executed continuously. I am using the scheduleWithFixedDelay method.
    Even I have tried reproducing, but I couldn't.
    Here is my customized implementation.
    package com.portware.utils.snapmarketdata.test;
    import java.util.Collections;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Set;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    import java.util.concurrent.RejectedExecutionHandler;
    import java.util.concurrent.ScheduledFuture;
    import java.util.concurrent.ScheduledThreadPoolExecutor;
    import java.util.concurrent.ThreadFactory;
    import java.util.concurrent.ThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.atomic.AtomicInteger;
    import com.indigo.utils.Log;
    * To schedule the tasks in timely manner.
    public class TestScheduledExecutorService  {
      private static String CLASS_NAME = TestScheduledExecutorService.class.getName();
      protected final ThreadPoolExecutor executor;
      static int totalCount = 0;
      public static void main(String[] args) throws InterruptedException {
        TestScheduledExecutorService executorService = new TestScheduledExecutorService("Test", 10, null);
        final AtomicInteger integer = new AtomicInteger();
        final Set<Integer> testSet = new HashSet<Integer>();
        for (int i = 0; i < 10; i++) {
          testSet.add(i);
        Iterator<Integer> iterator = testSet.iterator();
        synchronized (testSet) {
        while(iterator.hasNext()) {
          integer.set(iterator.next());
          executorService.submitTaskForContinuousExecution(new Runnable() {
          @Override
          public void run() {
              System.out.println(Thread.currentThread().getName()+" Hello : "+integer.get() + " count value is:"+totalCount++);
        }, integer.toString());
        while (true) {
          synchronized (TestScheduledExecutorService.class) {
            TestScheduledExecutorService.class.wait();
      private static class MyRunnableTask implements Runnable{
        ScheduledFuture<?> future;
         * The task to be run.
        private Runnable runnable;
         * The number of attempt.
        private int count;
         * Maximum attempts configured under TCA configuration.
        private int maximumAttempts;
        private String id;
        public MyRunnableTask(Runnable runnable, int maximumAttempts, String id) {
          this.runnable = runnable;
          this.maximumAttempts = maximumAttempts;
          this.id = id;
        @Override
        public void run() {
          if (count >= maximumAttempts) {
            this.future.cancel(true);
            System.out.println("Cancelling the task with id :"+id+" after count :"+count);
            return;
          count++;
          this.runnable.run();
         * Return the number of attempt.
         * @return
        public int getCount() {
          return count;
      private void submitTaskForContinuousExecution(Runnable runnable, String id){
        int numOfAttempts = 10;
        MyRunnableTask runnableTask = new MyRunnableTask(runnable, numOfAttempts, id);
        int interval = 1;
        ScheduledFuture<?> scheduleWithFixedDelay = this.scheduleWithFixedDelay(runnableTask, 0, TimeUnit.SECONDS.toMillis(interval), TimeUnit.MILLISECONDS);
        if(id != null) {
          /*System.out.println("Submitted the task for continuous execution for the ticket id :"+id+"  with maximum attempts : "+numOfAttempts
              + " and interval : "+ interval);*/
          runnableTask.future = scheduleWithFixedDelay;
       * Creates an Executor Service to provide customized execution for tasks to be scheduled.
       * @param threadName is the name that shows in logs.
       * @param maximumThreads is the number of threads can be created.
       * @param rejectedExecutionHandler is if the Queue reaches it's maximum capacity and all the executor gives
       * the tasks to rejectedExecutionHandler.
      public TestScheduledExecutorService(String threadName, int maximumThreads, RejectedExecutionHandler rejectedExecutionHandler) {
        this.executor = createExecutor(threadName, maximumThreads, rejectedExecutionHandler);
      protected ThreadPoolExecutor createExecutor(String threadName, int minimumThreads, RejectedExecutionHandler rejectedExecutionHandler) {
        ThreadPoolExecutor threadPoolExecutor = new ScheduledThreadPoolExecutor(minimumThreads)
          @Override
          protected void beforeExecute(Thread t, Runnable r) {
            TestScheduledExecutorService.this.beforeExecute(t, r);
            this.purge();
          @Override
          protected void afterExecute(Runnable r, Throwable t) {
            TestScheduledExecutorService.this.afterExecute(r, t);
        if(rejectedExecutionHandler != null) {
          threadPoolExecutor.setRejectedExecutionHandler(rejectedExecutionHandler);
        }else{
          threadPoolExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        threadPoolExecutor.setThreadFactory(new TestThreadFactory(threadName, threadPoolExecutor));
        threadPoolExecutor.setKeepAliveTime(120, TimeUnit.SECONDS);
        threadPoolExecutor.allowCoreThreadTimeOut(true);
        return threadPoolExecutor;
       * Executes the task repeatedly with the given delay
       * @param task
       * @param initialDelay
       * @param delay
       * @param unit
       * @return
      public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, int initialDelay, long delay, TimeUnit unit) {
        return ((ScheduledThreadPoolExecutor)executor).scheduleWithFixedDelay(task, initialDelay, delay, unit);
       * To provide threads with specific features.
      protected static class TestThreadFactory implements ThreadFactory {
        private ThreadFactory threadFactory = Executors.defaultThreadFactory();
        private ThreadPoolExecutor threadPoolExecutor;
        private String groupName;
        public TestThreadFactory(String groupName, ThreadPoolExecutor threadPoolExecutor) {
          this.groupName = groupName;
          this.threadPoolExecutor = threadPoolExecutor;
        @Override
        public Thread newThread(Runnable r) {
          Thread thread = threadFactory.newThread(r);
          int activeCount = this.threadPoolExecutor.getPoolSize();
          activeCount++;
          thread.setName(this.groupName+"-"+activeCount);
          thread.setDaemon(true);
          return thread;
       * Performs initialization tasks before starting this thread.
       * @param thread
       * @param runnable
      protected void beforeExecute(Thread thread, Runnable runnable){
       * Performs tasks after execution of this runnable.
       * @param thread
       * @param runnable
      protected void afterExecute(Runnable runnable, Throwable t){
       * Initiates an orderly shutdown in which previously submitted
       * tasks are executed, but no new tasks will be
       * accepted. Invocation has no additional effect if already shut
       * down.
      public void shutdown() {
        if(this.executor != null) {
          Log.notice(CLASS_NAME, "shutdown", "Shutting down Executor Service");
          this.executor.shutdown();
       * Attempts to stop all actively executing tasks, halts the
       * processing of waiting tasks, and returns a list of the tasks
       * that were awaiting execution. These tasks are drained (removed)
       * from the task queue upon return from this method.
       * <p>There are no guarantees beyond best-effort attempts to stop
       * processing actively executing tasks.  This implementation
       * cancels tasks via {@link Thread#interrupt}, so any task that
       * fails to respond to interrupts may never terminate.
      public List<Runnable> shutdownNow() {
       if(this.executor != null) {
         Log.notice(CLASS_NAME, "shutdownNow", "Immediately shutting down Executor Service");
         try {
          return this.executor.shutdownNow();
        } catch (Exception e) {
          Log.notice(CLASS_NAME, "shutdownNow", e.getMessage());
       return Collections.emptyList();
       * Returns a Future for the given runnable task.
      public Future<?> submit(Runnable runnable) {
        if(this.executor != null) {
          return this.executor.submit(runnable);
        return null;
    Is there any possibility for the continuous execution or not?

  • I installed Adobe Web and Design Preium CS6 on windows 8.1, but when I open the program the size of the menus and tools are so tiny. It is not like that for Acrobat, but all the other programs. Is there a fix for this?

    I installed Adobe Web and Design Preium CS6 on windows 8.1, but when I open the program the size of the menus and tools are so tiny. It is not like that for Acrobat, but all the other programs. Is there a fix for this?

    Thanks for the help. I installed CC and it fixed everything but Photoshop. I guess I will have to use my old laptop for images until Adobe fixes the problem. Do you know of a place where we can send issues like these to Adobe?

  • KEYNOTE: Why change the format of the presentations? not respect the original format!

    Why change the format of the presentations? Keynote not respect the original format!
    This new versionof Keynot (6.1-1769) is very poor:
    is very slow
    missing fonts
    changes the selected letters
    change the formats of the presentations
    Carousel animations missing
    Please correct the defects before releasing a new version. (The previous version was much better).

    Found the solution!
    I must set the Formats in the CODEC to get the Format that I want to play with! I was trying to complicate too much!
    The correct format class to is RGBFormat.
    RGB

Maybe you are looking for

  • Server connections not working

    Hi, I have a Windows Server 2012 I use as a file server, with all the latest updates, that I had disconnected from power for about a week because i wasn't going to be home. When i cam back and booted everything up, the remote desktop wouldn't work, f

  • Problem with condition IF THEN in Message MApping

    Hi, We are not getting correct ouput when we use condition IF THEN without else in message Mapping .We are sending data from File to XI to R/3. We are using file adapter and IDOC adapter to create customer in R/3. In message Mapping we are creating S

  • Is the -userThreads switch required when using internal connection?

    Hi, Maybe someone can help me with this. I have an ADF application module (JDeveloper 10.1.3.4) that uses something similar to dynamic credentials. It's configured so that it uses the jbo.server.internal_connection configuration parameter. Everything

  • N85, 20.175, lock code corrupted after *#7370#

    I upgraded using FOTA to 20.175 and all was perfect for some day, my original  lock code was retained and working as usual. Today I tried *#7370#, put my lock code to execute the reset and it was performed. After that I noticed that the security opti

  • Data retrieval from N95 8GB/Restoring NGage games ...

    Hi everything from my Nokia got deleted when I was deleting items from the LifeBlog.  I did a recovery from it using recovery software, however some items were retrieved no problems but some video files and pictures are unable to open or to view. I h