Org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)

I started up FB 4 today and got this error in my log:
Any ideas good friends?
!SESSION 2009-10-28 12:33:26.601 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86 -clean -data H:\My Documents\Flash Builder 4 -clean
!ENTRY org.eclipse.update.configurator 4 0 2009-10-28 12:33:30.367
!MESSAGE Unable to find feature.xml in directory: C:\Program Files\Adobe\Adobe Flash Builder Beta 2\features\com.adobe.ide.coldfusion.feature_1.0.0.253229-8LAqPgroE9KlmfZZdDcADiNC
!ENTRY org.eclipse.ui 4 0 2009-10-28 12:34:13.745
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
    at org.eclipse.swt.SWT.error(SWT.java:3777)
    at org.eclipse.swt.SWT.error(SWT.java:3695)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at com.adobe.flexbuilder.standalone.FlexBuilderApplication.start(FlexBuilderApplication.java :99)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.NullPointerException
    at org.eclipse.eclipsemonkey.actions.RecreateMonkeyMenuAction.createTheMenu(RecreateMonkeyMe nuAction.java:118)
    at org.eclipse.eclipsemonkey.actions.RecreateMonkeyMenuAction.run(RecreateMonkeyMenuAction.j ava:71)
    at org.eclipse.eclipsemonkey.UpdateMonkeyActionsResourceChangeListener$2.run(UpdateMonkeyAct ionsResourceChangeListener.java:256)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
    ... 22 more
!SESSION 2009-10-29 09:05:49.373 -----------------------------------------------
eclipse.buildId=unknown

I went and deleted my metadata folder it FB4 stared ok _

Similar Messages

  • Frequent error Failed to execute runnable (java.lang.NullPointerException)

    Would anyone know what module this stack-dump is related to? I get it quite often in OSB during the publish event.:
    org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
    at org.eclipse.swt.SWT.error(SWT.java:3563)
    at org.eclipse.swt.SWT.error(SWT.java:3481)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3296)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2974)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
    at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1173)

    I went and deleted my metadata folder it FB4 stared ok _

  • Search replace Word doc - Getting Erro : org.eclipse.swt.SWTException:

    Hi
    All
    I'm runing this Java class by a jsp to Search and Replace and saveAs a word document, when run the fisrt time it works OK, but if I run again I got this error:
    What is happing there?
    Following the Error and Source Java.
    Thanks
    11:59:49,234 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:3563)
    at org.eclipse.swt.SWT.error(SWT.java:3481)
    at org.eclipse.swt.SWT.error(SWT.java:3452)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:274)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:265)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:218)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:156)
    at br.com.tryblob.view.WordSearchReplace.<init>(WordSearchReplace.java:36)
    at org.apache.jsp.replacedoc_jsp._jspService(replacedoc_jsp.java:48)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Unknown Source)
    12:00:56,843 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:3563)
    at org.eclipse.swt.SWT.error(SWT.java:3481)
    at org.eclipse.swt.SWT.error(SWT.java:3452)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:274)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:265)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:218)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:156)
    at br.com.tryblob.view.WordSearchReplace.<init>(WordSearchReplace.java:36)
    at org.apache.jsp.replacedoc_jsp._jspService(replacedoc_jsp.java:48)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Unknown Source)
    ==================JAVA CLASS=====================
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.SWTException;
    import org.eclipse.swt.internal.ole.win32.TYPEATTR;
    import org.eclipse.swt.ole.win32.OLE;
    import org.eclipse.swt.ole.win32.OleAutomation;
    import org.eclipse.swt.ole.win32.OleClientSite;
    import org.eclipse.swt.ole.win32.OleFrame;
    import org.eclipse.swt.ole.win32.OleFunctionDescription;
    import org.eclipse.swt.ole.win32.OlePropertyDescription;
    import org.eclipse.swt.ole.win32.OleParameterDescription;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.ole.win32.Variant;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.BufferedWriter;
    import java.io.IOException;
    public class WordSearchReplace {
         private static final String PROG_ID = "Word.Application";
         private static final int WD_REPLACE_ALL = 2;
         private static final int WD_FIND_CONTINUE = 1;
         private Shell shell = null;
         private OleFrame frame = null;
         private OleClientSite wordSite = null;
         private OleAutomation wordAutomation = null;
         private OleAutomation activeDocumentAutomation = null;
         private boolean cleaned = false;
         * Create a new instance of the WordSearchReplace class.
         public WordSearchReplace() {
              this.shell = new Shell();
              this.frame = new OleFrame(this.shell, SWT.NONE);
              this.wordSite = new OleClientSite(this.frame, SWT.NONE, WordSearchReplace.PROG_ID);
         this.wordAutomation = new OleAutomation(this.wordSite);
         * Open an MS Word file. This is a file whose name ends with the extension
         * .doc or .doc and which conforms to the correct format.
         * Note; if it is possible to open the named file, an attempt is made
         * to cache an OleAutomation object referencing that file which will be
         * referred to in future as the active document. Most other methods
         * need to capture references to further OleAutomation(s) that have the
         * active document as their root.
         * @param fileName An instance of the String class that encapsulates the
         * path to and name of the file that is to be opened.
         * Note; the full path name must be supplied as Word
         * will be opening the file and no assumptions can
         * safely be made concerning the applications 'home'
         * folder.
         * @throws NullPointerException if a null value is passed to the fileName
         * parameter.
         * @throws FileNotFoundException if it is not possible to locate the
         * file.
         * @throws IllegalArgumentException if the name of the file does not end
         * with either the .dot or .doc extensions.
         * @throws SWTException if a problem occurs whilst invoking any of the OLE
         * methods.
         public void openFile(String fileName) throws SWTException,
         NullPointerException,
         FileNotFoundException,
         IllegalArgumentException {
              OleAutomation documentsAutomation = null;
              int[] id = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              try {
                   // Check the the file name is not null
                   if(fileName == null) {
                        throw new NullPointerException("Null value passed to " +
                             "fileName parameters of the openFile() method.");
                   // Check the the file names ends with '.dot' or '.doc'.
                   // Remember to include templates and docuemnts
                   if(!(fileName.endsWith(".doc")) && !(fileName.endsWith(".dot"))) {
                        throw new IllegalArgumentException(
                             "The filename must end with the extensions \'.doc\' or \'.dot\'");
                   // Check that the file exists
                   File fileToPrint = new File(fileName);
                   if(!(fileToPrint.exists())) {
                        throw new FileNotFoundException("The file " +
                        fileName +
                        "cannot be found.");
                   // From the application, get an automation for the Documents property
                   documentsAutomation = this.getChildAutomation(this.wordAutomation,
                   "Documents");
                   // Get the ID of the Open method
                   id = documentsAutomation.getIDsOfNames(new String[]{"Open"});
                   if(id == null) {
                        throw new SWTException("It was not possible to recover an " +
                        "identifer for the Open method in WordSearchReplace.openFile().");
                   // Build an array of parameters - holds just the file name
                   arguments = new Variant[1];
                   arguments[0] = new Variant(fileName);
                   // Invoke the Open method on the Documents property
                   invokeResult = documentsAutomation.invoke(id[0], arguments);
                   // If the call to invoke the open method failed, throw an SWTException
                   // to terminate processing.
                   if(invokeResult == null) {
                        throw new SWTException("An error occurred whilst invoking the " +
                             "Open method for the following file: " +
                             fileName +
                             " in WordSearchReplace.openFile().");
                   // If it was possible to open the document successfully, grab an
                   // automation object referencing the active document here.               
                   else {
                        this.activeDocumentAutomation = this.getChildAutomation(
                             this.wordAutomation, "ActiveDocument");
              finally {
                   // If the automation was instantiated then dispose of it to
                   // release resources. This OleAutomation was only required
                   // to open the file and can safely be released here.
                   if(documentsAutomation != null) {
                        documentsAutomation.dispose();
         * Save the currently open file - the active document.
         * @throws SWTException if a problem occurs whilst invoking any of the OLE
         * methods.
         public void save() throws SWTException {
              int[] id = null;
              Variant invokeResult = null;
              // From the automation for the ActiveDocument object, get an id for
              // the Save method
              id = this.activeDocumentAutomation.getIDsOfNames(new String[]{"Save"});
              // If it was not possible to recover the id of the Save
              // method, throw an exception to notify the user and terminate
              // processing.
              if(id == null) {
                   throw new SWTException("Unable to obtain an automation for " +
                        "the Save method in WordSearchReplace.save().");
              // Invoke the Save method and catch the value returned
              invokeResult = this.activeDocumentAutomation.invoke(id[0]);
              // If a null value was returned then the invocation of the
              // Save method failed. Throw an exception to notify the
              // user and terminate processing.
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "Save method in WordSearchReplace.save().");
         * Save the active document using the name provided.
         * @param fileName Am instance of the String class encapsulating the name
         * for the file. Again, the path to and name of the file should
         * be supplied.
         * @throws NullPointerException if a null value is passed to the fileName
         * parameter.
         * @throws IllegalArgumentException if either an empty String is passed
         * to the fileName parameter or if the files name does not end
         * with one of the two permissible extensions - .dot and .doc
         public void saveAs(String fileName) throws SWTException,
         NullPointerException,
         IllegalArgumentException {
              int[] id = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              // If the fileName parameter is passed a null
              // value, throw an exception.
              if(fileName == null) {
                   throw new NullPointerException("A null value was passed to " +
                        "the fileName parameter of WordSearchReplace.saveAs().");
              // If the fileName parameter has been passed an empty String
              // then again throw an exception.
              if(fileName.length() == 0) {
                   throw new NullPointerException("An empty string was passed " +
                        "to the fileName parameter of WordSearchReplace.saveAs().");
              // Finally, make sure the file name ends in either
              // .doc or .dot.
              if((!fileName.endsWith(".dot")) && (!fileName.endsWith(".doc"))) {
                   throw new IllegalArgumentException("An illegal file name was " +
                        "passed to the fileName parameter of " +
                        "WordSearchReplace.saveAs(). The file name must " +
                        "end in \'.dot\' or \'.doc\'.");
              // From the automation for the ActiveDocument object, get an id for
              // the SaveAs method
              id = this.activeDocumentAutomation.getIDsOfNames(new String[]{"SaveAs"});
              // If it was not possible to recover the id of the SaveAs
              // method, throw an exception to notify the user and terminate
              // processing.
              if(id == null) {
                   throw new SWTException("Unable to obtain an automation for " +
                        "the SaveAs method in WordSearchReplace.saveAs().");
              // Build the array of arguments that will be passed to the invoke
              // method when the SaveAs method is invoked. In this case, this
              // array will contain a single member - a String object encapsulating
              // the path to and name of the output file.
              arguments = new Variant[1];
              arguments[0] = new Variant(fileName);
              // Invoke the SaveAs method and catch the value returned
              invokeResult = this.activeDocumentAutomation.invoke(id[0], arguments);
              // If a null value was returned then the invocation of the
              // PrintOut method failed. Throw an exception to notify the
              // user and terminate processing.
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "SaveAs method in WordSearchReplace.saveAs().");
         * Mimics Words 'replace' functionality by searching the active
         * document for evey string of characters that matches the value passed to
         * the searchTerm parameter and replacing them with the string of
         * characters passed to the replacementTerm method.
         * It is possible to code a VBA macro within Word that will perfrom a serach
         * and replace. That code would look like the following;
         * <pre>
         *      Selection.Find.ClearFormatting
    *     Selection.Find.Replacement.ClearFormatting
    *     With Selection.Find
    *      .Text = "serach"
    *      .Replacement.Text = "search"
    *      .Forward = True
    *      .Wrap = wdFindContinue
    *      .Format = False
    *      .MatchCase = False
    *      .MatchWholeWord = False
    *      .MatchWildcards = False
    *      .MatchSoundsLike = False
    *      .MatchAllWordForms = False
    *     End With
    *     Selection.Find.Execute Replace:=wdReplaceAll
    * <pre>
    * and this method will 'automate' it.
         * @param searchTerm An instance of the String class that will encapsulate
         * the series of characters that should be replaced.
         * @param replacementTerm An instance of the String class that will
         * encapsulate the series of characters that should replace the
         * searchTerm.
         * @throws NullPointerException if a null value is passed to either the
         * searchTerm or replacementTerm methods.
         * @throws SWTException if a problem occurs when invoking any of the
         * OLE methods.
         public void replace(String searchTerm,
         String replacementTerm) throws SWTException,
         NullPointerException {
              OleAutomation selectionFindAutomation = null;
              OleAutomation childAutomation = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              int[] id = null;
              int[] namedArguments = null;
              boolean success = true;
              // Validate the searchTerm parameter and throw exception if
              // null value passed.
              if(searchTerm == null) {
                   throw new NullPointerException("Null value passed to " +
                             "searchTerm parameter of the replace() method.");
              // Validate the replacementTerm parameter and throw exception if
              // null value passed.
              if(replacementTerm == null) {
                   throw new NullPointerException("Null value passed to " +
                             "replacementTerm parameter of the replace() method.");
              // Most of the VBA instructions used to perform the search and
              // replace functionality and child automations of Selection.Find,
              // therefore, it is wise to cache that automation first.
              // From the application, get an automation for the Selection property
              childAutomation = this.getChildAutomation(this.wordAutomation,
                   "Selection");
              selectionFindAutomation = this.getChildAutomation(childAutomation,
              "Find");
              // Next, using the cached automation, invoke the 'ClearFormatting'
              // method, validate the returned value and invoke the method.
              // Selection.Find.ClearFormatting
              id = selectionFindAutomation.getIDsOfNames(new String[]{"ClearFormatting"});
              if(id == null) {
                   throw new SWTException("It is not possible to recover an identifier " +
                        "for the ClearFormatting method in WordSearchReplace.replace() " +
                        "when clearing the formatting for the search string.");
              invokeResult = selectionFindAutomation.invoke(id[0]);
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "ClearFormatting method in WordSearchReplace.repace() " +
                        "when clearing formatting for the search string.");
              // Now, perform the same function but for the replacement string.
              // Selection.Find.Replacement.ClearFormatting
              childAutomation = this.getChildAutomation(selectionFindAutomation,
              "Replacement");
              id = childAutomation.getIDsOfNames(new String[]{"ClearFormatting"});
              if(id == null) {
                   throw new SWTException("It is not possible to recover an identifier " +
                        "for the ClearFormatting method in WordSearchReplace.replace() " +
                        "when clearing the formatting for the replacement string.");
              invokeResult = childAutomation.invoke(id[0]);
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "ClearFormatting method in WordSearchReplace.repace() " +
                        "when clearing formatting for the replacement string.");
              // Firstly, set the search text.
              // .Text = "search term"
              arguments = new Variant[1];
              arguments[0] = new Variant(searchTerm);
              success = this.setPropertyValue(selectionFindAutomation, "Text", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Text " +
                        "property for the search string in WordSearchReplace.replace().");
              // Next, the replacement text
              // .Replacement.Text = "replacement term"
              childAutomation = this.getChildAutomation(selectionFindAutomation,
              "Replacement");
              arguments[0] = new Variant(replacementTerm);
              success = this.setPropertyValue(childAutomation, "Text", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Text property" +
                        " for the replacement string in WordSearchReplace.replace().");
              // Set the direction of the search - forward in this case.
              // .Forward = True
              arguments[0] = new Variant(true);
              success = this.setPropertyValue(selectionFindAutomation, "Forward", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Forward " +
                        "property in WordSearchReplace.replace().");
              // Tell the search to wrap. Note the literal wdFindContinue relates to
              // a constant that is defined within Word. I have provided a static
              // final to replace it called WD_FIND_CONTINUE
              // .Wrap = wdFindContinue
              arguments[0] = new Variant(WordSearchReplace.WD_FIND_CONTINUE);
              success = this.setPropertyValue(selectionFindAutomation, "Wrap", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Wrap " +
                        "property in WordSearchReplace.replace().");
              // Set the Format property to False.
              // .Format = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "Format", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Format " +
                        "property in WordSearchReplace.replace().");
              // Set the MatchCase property to false.
              // .MatchCase = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchCase", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the MatchCase " +
                        "property in WordSearchReplace.replace().");
              // Set the MatchWholeWord property to false.
              // .MatchWholeWord = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchWholeWord", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchWholeWord property in WordSearchReplace.replace().");
              // Set the MatchWildCards property to false.
              // .MatchWildcards = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchWildCards", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchWildCards property in WordSearchReplace.replace().");
              // Set the MatchSoundsLike property to false.
              // .MatchSoundsLike = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchSoundsLike", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchSoundsLike property in WordSearchReplace.replace().");
              // Set the MatchAllWordForms property to false.
              // .MatchAllWordForms = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchAllWordForms", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchAllWordForms property in WordSearchReplace.replace().");
              // Invoke the Execute command passing the correct value to the Replace
              // parameter. Again, wdReplaceAll is a constant that I have provided
              // a ststic final for called WD_REPLACE_ALL
              // Selection.Find.Execute Replace:=wdReplaceAll
              id = selectionFindAutomation.getIDsOfNames(new String[]{"Execute", "Replace"});
              if(id == null) {
                   throw new SWTException("It was not possible to recover an identifier " +
                        "for the Execute method in WordSearchReplace.replace().");
              arguments = new Variant[1];
              arguments[0] = new Variant(WordSearchReplace.WD_REPLACE_ALL);
              namedArguments = new int[1];
              namedArguments[0] = id[1];
              // There was some indication that the invokeNoReply method should
              // be used when making this call but no, invoke SEEMS to work well
              //selectionFindAutomation.invokeNoReply(id[0], arguments, namedArguments);
              invokeResult = selectionFindAutomation.invoke(id[0], arguments, namedArguments);
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred trying to invoke the " +
                   "Execute method in WordSearchReplace.replace().");
         * Close the active document.
         * @throws SWTException if a problem is encountered invoking any of the
         * OLE methods.
         public void closeFile() throws SWTException {
              int[] id = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              try {
                   // From the OleAutomation referencing the active document, recover
                   // the id of the Close method.
                   id = this.activeDocumentAutomation.getIDsOfNames(new String[]{"Close"});
                   // If it was not possible to recover the id of the Close
                   // method then throw an exception to notify the user and
                   // terminate processing.
                   if(id == null) {
                        throw new SWTException("It was not possible to recover an " +
                             "identifier for the Close method in " +
                             "WordSearchReplace.closeFile().");
                   // Invoke the Close method on the ActiveDocument automation
                   invokeResult = this.activeDocumentAutomation.invoke(id[0]);
                   // If the invocation of the Close method failed, throw an
                   // exception to notify the user and terminate processing.
                   if(invokeResult == null) {
                        throw new SWTException(
                             "An error occurred invoking the Close method in " +
                             "WordSearchReplace.closeFile().");
              finally {
                   if(this.activeDocumentAutomation != null) {
                        this.activeDocumentAutomation.dispose();
         * Release resources.
         public void dispose() throws SWTException {
              try {
                   // Set the cleaned flag to true. This prevents the method from
                   // running again if it is called from the finalize() method
                   this.cleaned = true;
                   // From the word automation, recover the id of the Quit method
                   int[] id = this.wordAutomation.getIDsOfNames(new String[]{"Quit"});
                   // If the id of the Quit method cannot be recovered
                   // throw an exception - not much good really though.
                   if(id == null) {
                        throw new SWTException("Unable to obtain an id for the Quit " +
                             "property in WordSearchReplace.dispose().");
                   // Invoke Quit
              Variant result = this.wordAutomation.invoke(id[0]);
              // If an error occurs during the invocation, throw an exception.
              // Again though that exception is of limited value.
              if(result == null) {
                   throw new SWTException("A problem occurred trying to invoke the " +
                        "Quit method in WordSearchReplace.dispose().");
         finally {
              // Finally, dispose of the word application automation.
              this.wordAutomation.dispose();
         * The finalize() method has been over-ridden to ensure that resources
         * are correctly released if a WordSearchReplace object is created but
         * not disposed of properly before it becomes eligible for garbage
         * collection. The cleaned flag is used as acheck to ensure that the
         * dispose() method cannot be called more than once.
         public void finalize() throws Throwable {
              if(!this.cleaned) {
                   this.dispose();
         * Creates and returns a 'child' OleAutomation object. The object model
         * employed by Word, Excel and the like, arrange objects, methods and
         * properties hierarchically. To invoke a method, it is often necessary
         * to iterate through this hierarchy from parent to child and this method
         * supports that process.
         * @param automation An OleAutomation object that references the parent
         * automation.
         * @param childName An instance of the String class that encapsulates the
         * name of the child automation.
         * @throws SWTException if a problem is encountered invoking one or
         * other of the OLE methods.
         private OleAutomation getChildAutomation(OleAutomation automation,
         String childName) throws SWTException {
              // Try to recove the unique identifier for the child automation
              int[] id = automation.getIDsOfNames(new String[]{childName});
              // If the identifier cannot be found then throw an exception to
              // terminate processing.           
              if (id == null) {
                   throw new SWTException(
                        "A problem occurred trying to obtain and id for: " +
                   childName +
                   "in the getC

    When you call it the first time, it new Shell() constructs a new Display for you (the default).
    The second time, it gets the default display, but you are in a different Thread now. Since you have to create your widgets in the UI thread, it gives you that error.
    To run code in the UI thread, Display provides two methods:
    display.syncexec(..)and
    display.asyncexec(...)see
    http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/swt_threading.htm
    for more details.

  • Org.eclipse.swt.SWTException: Invalid thread access - Action struts

    Hi
    I�m runing this WordSearchReplace java class that I got here in this forum, and I�m runing it doing search and replace in Ms word document if I run just one time it works ok, but if I run twice i got that erro, I�m runing that java class in my Action on struts.
    I don�t know what is occur.
    Can you help me?
    Thanks
    Following the example of call, mistakes and java class.
    //======RUNING THE WordSearchReplace JAVA CLASS=========
    WordSearchReplace wordSR = null;
    try {
    String[] v_text = {"#V46#","#V42#"};
    String[] v_replace = {"Texto1","Texto2"};
    wordSR = new WordSearchReplace();
    wordSR.openFile(v_path+v_file_name);
    for ( int i=0; i<v_text.length; i++ )
    wordSR.replace( v_text, v_replace[i] );
    wordSR.save();
    wordSR.closeFile();
    catch(Exception e) {
    System.out.println("Caught: ERRO ao Executar WordSearchReplace " + e.getClass().getName());
    System.out.println(e.getMessage());
    e.printStackTrace(System.out);
    finally {
    if(wordSR != null) {
    try {
    wordSR.dispose();
    catch(Exception innerE) {
    System.out.println("Caught: " + innerE.getClass().getName());
    System.out.println(innerE.getMessage());
    innerE.printStackTrace(System.out);
    //========ERRO ===========================
    17:24:49,093 INFO [STDOUT] Invalid thread access
    17:24:49,093 INFO [STDOUT] org.eclipse.swt.SWTException: Invalid thread access
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.SWT.error(SWT.java:3563)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.SWT.error(SWT.java:3481)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.SWT.error(SWT.java:3452)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.widgets.Shell.<init>(Shell.java:274)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.widgets.Shell.<init>(Shell.java:265)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.widgets.Shell.<init>(Shell.java:218)
    17:24:49,093 INFO [STDOUT] at org.eclipse.swt.widgets.Shell.<init>(Shell.java:156)
    17:24:49,093 INFO [STDOUT] at br.com.tryblob.view.WordSearchReplace.<init>(WordSearchReplace.java:38)
    17:24:49,093 INFO [STDOUT] at br.com.tryblob.view.WordAction.execute(WordAction.java:70)
    17:24:49,093 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    17:24:49,093 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    17:24:49,093 INFO [STDOUT] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    17:24:49,093 INFO [STDOUT] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    17:24:49,093 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
    //====== WordSearchReplace JAVA CLASS=========
    import java.util.ArrayList;
    import java.util.Iterator;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.SWTException;
    import org.eclipse.swt.internal.ole.win32.TYPEATTR;
    import org.eclipse.swt.ole.win32.OLE;
    import org.eclipse.swt.ole.win32.OleAutomation;
    import org.eclipse.swt.ole.win32.OleClientSite;
    import org.eclipse.swt.ole.win32.OleFrame;
    import org.eclipse.swt.ole.win32.OleFunctionDescription;
    import org.eclipse.swt.ole.win32.OlePropertyDescription;
    import org.eclipse.swt.ole.win32.OleParameterDescription;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.ole.win32.Variant;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.BufferedWriter;
    import java.io.IOException;
    public class WordSearchReplace {
         private static final String PROG_ID = "Word.Application";
         private static final int WD_REPLACE_ALL = 2;
         private static final int WD_FIND_CONTINUE = 1;
         private Shell shell = null;
         private OleFrame frame = null;
         private OleClientSite wordSite = null;
         private OleAutomation wordAutomation = null;
         private OleAutomation activeDocumentAutomation = null;
         private boolean cleaned = false;
         * Create a new instance of the WordSearchReplace class.
         public WordSearchReplace() {
              this.shell = new Shell();
              this.frame = new OleFrame(this.shell, SWT.NONE);
              this.wordSite = new OleClientSite(this.frame, SWT.NONE, WordSearchReplace.PROG_ID);
         this.wordAutomation = new OleAutomation(this.wordSite);
         * Open an MS Word file. This is a file whose name ends with the extension
         * .doc or .doc and which conforms to the correct format.
         * Note; if it is possible to open the named file, an attempt is made
         * to cache an OleAutomation object referencing that file which will be
         * referred to in future as the active document. Most other methods
         * need to capture references to further OleAutomation(s) that have the
         * active document as their root.
         * @param fileName An instance of the String class that encapsulates the
         * path to and name of the file that is to be opened.
         * Note; the full path name must be supplied as Word
         * will be opening the file and no assumptions can
         * safely be made concerning the applications 'home'
         * folder.
         * @throws NullPointerException if a null value is passed to the fileName
         * parameter.
         * @throws FileNotFoundException if it is not possible to locate the
         * file.
         * @throws IllegalArgumentException if the name of the file does not end
         * with either the .dot or .doc extensions.
         * @throws SWTException if a problem occurs whilst invoking any of the OLE
         * methods.
         public void openFile(String fileName) throws SWTException,
         NullPointerException,
         FileNotFoundException,
         IllegalArgumentException {
              OleAutomation documentsAutomation = null;
              int[] id = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              try {
                   // Check the the file name is not null
                   if(fileName == null) {
                        throw new NullPointerException("Null value passed to " +
                             "fileName parameters of the openFile() method.");
                   // Check the the file names ends with '.dot' or '.doc'.
                   // Remember to include templates and docuemnts
                   if(!(fileName.endsWith(".doc")) && !(fileName.endsWith(".dot"))) {
                        throw new IllegalArgumentException(
                             "The filename must end with the extensions \'.doc\' or \'.dot\'");
                   // Check that the file exists
                   File fileToPrint = new File(fileName);
                   if(!(fileToPrint.exists())) {
                        throw new FileNotFoundException("The file " +
                        fileName +
                        "cannot be found.");
                   // From the application, get an automation for the Documents property
                   documentsAutomation = this.getChildAutomation(this.wordAutomation,
                   "Documents");
                   // Get the ID of the Open method
                   id = documentsAutomation.getIDsOfNames(new String[]{"Open"});
                   if(id == null) {
                        throw new SWTException("It was not possible to recover an " +
                        "identifer for the Open method in WordSearchReplace.openFile().");
                   // Build an array of parameters - holds just the file name
                   arguments = new Variant[1];
                   arguments[0] = new Variant(fileName);
                   // Invoke the Open method on the Documents property
                   invokeResult = documentsAutomation.invoke(id[0], arguments);
                   // If the call to invoke the open method failed, throw an SWTException
                   // to terminate processing.
                   if(invokeResult == null) {
                        throw new SWTException("An error occurred whilst invoking the " +
                             "Open method for the following file: " +
                             fileName +
                             " in WordSearchReplace.openFile().");
                   // If it was possible to open the document successfully, grab an
                   // automation object referencing the active document here.               
                   else {
                        this.activeDocumentAutomation = this.getChildAutomation(
                             this.wordAutomation, "ActiveDocument");
              finally {
                   // If the automation was instantiated then dispose of it to
                   // release resources. This OleAutomation was only required
                   // to open the file and can safely be released here.
                   if(documentsAutomation != null) {
                        documentsAutomation.dispose();
         * Save the currently open file - the active document.
         * @throws SWTException if a problem occurs whilst invoking any of the OLE
         * methods.
         public void save() throws SWTException {
              int[] id = null;
              Variant invokeResult = null;
              // From the automation for the ActiveDocument object, get an id for
              // the Save method
              id = this.activeDocumentAutomation.getIDsOfNames(new String[]{"Save"});
              // If it was not possible to recover the id of the Save
              // method, throw an exception to notify the user and terminate
              // processing.
              if(id == null) {
                   throw new SWTException("Unable to obtain an automation for " +
                        "the Save method in WordSearchReplace.save().");
              // Invoke the Save method and catch the value returned
              invokeResult = this.activeDocumentAutomation.invoke(id[0]);
              // If a null value was returned then the invocation of the
              // Save method failed. Throw an exception to notify the
              // user and terminate processing.
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "Save method in WordSearchReplace.save().");
         * Save the active document using the name provided.
         * @param fileName Am instance of the String class encapsulating the name
         * for the file. Again, the path to and name of the file should
         * be supplied.
         * @throws NullPointerException if a null value is passed to the fileName
         * parameter.
         * @throws IllegalArgumentException if either an empty String is passed
         * to the fileName parameter or if the files name does not end
         * with one of the two permissible extensions - .dot and .doc
         public void saveAs(String fileName) throws SWTException,
         NullPointerException,
         IllegalArgumentException {
              int[] id = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              // If the fileName parameter is passed a null
              // value, throw an exception.
              if(fileName == null) {
                   throw new NullPointerException("A null value was passed to " +
                        "the fileName parameter of WordSearchReplace.saveAs().");
              // If the fileName parameter has been passed an empty String
              // then again throw an exception.
              if(fileName.length() == 0) {
                   throw new NullPointerException("An empty string was passed " +
                        "to the fileName parameter of WordSearchReplace.saveAs().");
              // Finally, make sure the file name ends in either
              // .doc or .dot.
              if((!fileName.endsWith(".dot")) && (!fileName.endsWith(".doc"))) {
                   throw new IllegalArgumentException("An illegal file name was " +
                        "passed to the fileName parameter of " +
                        "WordSearchReplace.saveAs(). The file name must " +
                        "end in \'.dot\' or \'.doc\'.");
              // From the automation for the ActiveDocument object, get an id for
              // the SaveAs method
              id = this.activeDocumentAutomation.getIDsOfNames(new String[]{"SaveAs"});
              // If it was not possible to recover the id of the SaveAs
              // method, throw an exception to notify the user and terminate
              // processing.
              if(id == null) {
                   throw new SWTException("Unable to obtain an automation for " +
                        "the SaveAs method in WordSearchReplace.saveAs().");
              // Build the array of arguments that will be passed to the invoke
              // method when the SaveAs method is invoked. In this case, this
              // array will contain a single member - a String object encapsulating
              // the path to and name of the output file.
              arguments = new Variant[1];
              arguments[0] = new Variant(fileName);
              // Invoke the SaveAs method and catch the value returned
              invokeResult = this.activeDocumentAutomation.invoke(id[0], arguments);
              // If a null value was returned then the invocation of the
              // PrintOut method failed. Throw an exception to notify the
              // user and terminate processing.
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "SaveAs method in WordSearchReplace.saveAs().");
         * Mimics Words 'replace' functionality by searching the active
         * document for evey string of characters that matches the value passed to
         * the searchTerm parameter and replacing them with the string of
         * characters passed to the replacementTerm method.
         * It is possible to code a VBA macro within Word that will perfrom a serach
         * and replace. That code would look like the following;
         * <pre>
         *      Selection.Find.ClearFormatting
    *     Selection.Find.Replacement.ClearFormatting
    *     With Selection.Find
    *      .Text = "serach"
    *      .Replacement.Text = "search"
    *      .Forward = True
    *      .Wrap = wdFindContinue
    *      .Format = False
    *      .MatchCase = False
    *      .MatchWholeWord = False
    *      .MatchWildcards = False
    *      .MatchSoundsLike = False
    *      .MatchAllWordForms = False
    *     End With
    *     Selection.Find.Execute Replace:=wdReplaceAll
    * <pre>
    * and this method will 'automate' it.
         * @param searchTerm An instance of the String class that will encapsulate
         * the series of characters that should be replaced.
         * @param replacementTerm An instance of the String class that will
         * encapsulate the series of characters that should replace the
         * searchTerm.
         * @throws NullPointerException if a null value is passed to either the
         * searchTerm or replacementTerm methods.
         * @throws SWTException if a problem occurs when invoking any of the
         * OLE methods.
         public void replace(String searchTerm,
         String replacementTerm) throws SWTException,
         NullPointerException {
              OleAutomation selectionFindAutomation = null;
              OleAutomation childAutomation = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              int[] id = null;
              int[] namedArguments = null;
              boolean success = true;
              // Validate the searchTerm parameter and throw exception if
              // null value passed.
              if(searchTerm == null) {
                   throw new NullPointerException("Null value passed to " +
                             "searchTerm parameter of the replace() method.");
              // Validate the replacementTerm parameter and throw exception if
              // null value passed.
              if(replacementTerm == null) {
                   throw new NullPointerException("Null value passed to " +
                             "replacementTerm parameter of the replace() method.");
              // Most of the VBA instructions used to perform the search and
              // replace functionality and child automations of Selection.Find,
              // therefore, it is wise to cache that automation first.
              // From the application, get an automation for the Selection property
              childAutomation = this.getChildAutomation(this.wordAutomation,
                   "Selection");
              selectionFindAutomation = this.getChildAutomation(childAutomation,
              "Find");
              // Next, using the cached automation, invoke the 'ClearFormatting'
              // method, validate the returned value and invoke the method.
              // Selection.Find.ClearFormatting
              id = selectionFindAutomation.getIDsOfNames(new String[]{"ClearFormatting"});
              if(id == null) {
                   throw new SWTException("It is not possible to recover an identifier " +
                        "for the ClearFormatting method in WordSearchReplace.replace() " +
                        "when clearing the formatting for the search string.");
              invokeResult = selectionFindAutomation.invoke(id[0]);
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "ClearFormatting method in WordSearchReplace.repace() " +
                        "when clearing formatting for the search string.");
              // Now, perform the same function but for the replacement string.
              // Selection.Find.Replacement.ClearFormatting
              childAutomation = this.getChildAutomation(selectionFindAutomation,
              "Replacement");
              id = childAutomation.getIDsOfNames(new String[]{"ClearFormatting"});
              if(id == null) {
                   throw new SWTException("It is not possible to recover an identifier " +
                        "for the ClearFormatting method in WordSearchReplace.replace() " +
                        "when clearing the formatting for the replacement string.");
              invokeResult = childAutomation.invoke(id[0]);
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred invoking the " +
                        "ClearFormatting method in WordSearchReplace.repace() " +
                        "when clearing formatting for the replacement string.");
              // Firstly, set the search text.
              // .Text = "search term"
              arguments = new Variant[1];
              arguments[0] = new Variant(searchTerm);
              success = this.setPropertyValue(selectionFindAutomation, "Text", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Text " +
                        "property for the search string in WordSearchReplace.replace().");
              // Next, the replacement text
              // .Replacement.Text = "replacement term"
              childAutomation = this.getChildAutomation(selectionFindAutomation,
              "Replacement");
              arguments[0] = new Variant(replacementTerm);
              success = this.setPropertyValue(childAutomation, "Text", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Text property" +
                        " for the replacement string in WordSearchReplace.replace().");
              // Set the direction of the search - forward in this case.
              // .Forward = True
              arguments[0] = new Variant(true);
              success = this.setPropertyValue(selectionFindAutomation, "Forward", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Forward " +
                        "property in WordSearchReplace.replace().");
              // Tell the search to wrap. Note the literal wdFindContinue relates to
              // a constant that is defined within Word. I have provided a static
              // final to replace it called WD_FIND_CONTINUE
              // .Wrap = wdFindContinue
              arguments[0] = new Variant(WordSearchReplace.WD_FIND_CONTINUE);
    // System.out.println("jose vieira WD_FIND_CONTINUE:" + arguments[0]);
              success = this.setPropertyValue(selectionFindAutomation, "Wrap", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Wrap " +
                        "property in WordSearchReplace.replace().");
              // Set the Format property to False.
              // .Format = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "Format", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the Format " +
                        "property in WordSearchReplace.replace().");
              // Set the MatchCase property to false.
              // .MatchCase = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchCase", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the MatchCase " +
                        "property in WordSearchReplace.replace().");
              // Set the MatchWholeWord property to false.
              // .MatchWholeWord = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchWholeWord", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchWholeWord property in WordSearchReplace.replace().");
              // Set the MatchWildCards property to false.
              // .MatchWildcards = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchWildCards", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchWildCards property in WordSearchReplace.replace().");
              // Set the MatchSoundsLike property to false.
              // .MatchSoundsLike = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchSoundsLike", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchSoundsLike property in WordSearchReplace.replace().");
              // Set the MatchAllWordForms property to false.
              // .MatchAllWordForms = False
              arguments[0] = new Variant(false);
              success = this.setPropertyValue(selectionFindAutomation, "MatchAllWordForms", arguments);
              if(!success) {
                   throw new SWTException("A problem occurred setting the " +
                        "MatchAllWordForms property in WordSearchReplace.replace().");
              // Invoke the Execute command passing the correct value to the Replace
              // parameter. Again, wdReplaceAll is a constant that I have provided
              // a ststic final for called WD_REPLACE_ALL
              // Selection.Find.Execute Replace:=wdReplaceAll
              id = selectionFindAutomation.getIDsOfNames(new String[]{"Execute", "Replace"});
              if(id == null) {
                   throw new SWTException("It was not possible to recover an identifier " +
                        "for the Execute method in WordSearchReplace.replace().");
              arguments = new Variant[1];
              arguments[0] = new Variant(WordSearchReplace.WD_REPLACE_ALL);
              namedArguments = new int[1];
              namedArguments[0] = id[1];
              // There was some indication that the invokeNoReply method should
              // be used when making this call but no, invoke SEEMS to work well
              //selectionFindAutomation.invokeNoReply(id[0], arguments, namedArguments);
              invokeResult = selectionFindAutomation.invoke(id[0], arguments, namedArguments);
              if(invokeResult == null) {
                   throw new SWTException("A problem occurred trying to invoke the " +
                   "Execute method in WordSearchReplace.replace().");
         * Close the active document.
         * @throws SWTException if a problem is encountered invoking any of the
         * OLE methods.
         public void closeFile() throws SWTException {
              int[] id = null;
              Variant[] arguments = null;
              Variant invokeResult = null;
              try {
                   // From the OleAutomation referencing the active document, recover
                   // the id of the Close method.
                   id = this.activeDocumentAutomation.getIDsOfNames(new String[]{"Close"});
                   // If it was not possible to recover the id of the Close
                   // method then throw an exception to notify the user and
                   // terminate processing.
                   if(id == null) {
                        throw new SWTException("It was not possible to recover an " +
                             "identifier for the Close method in " +
                             "WordSearchReplace.closeFile().");
                   // Invoke the Close method on the ActiveDocument automation
                   invokeResult = this.activeDocumentAutomation.invoke(id[0]);
                   // If the invocation of the Close method failed, throw an
                   // exception to notify the user and terminate processing.
                   if(invokeResult == null) {
                        throw new SWTException(
                             "An error occurred invoking the Close method in " +
                             "WordSearchReplace.closeFile().");
              finally {
                   if(this.activeDocumentAutomation != null) {
                        this.activeDocumentAutomation.dispose();
         * Release resources.
         public void dispose() throws SWTException {
              try {
                   // Set the cleaned flag to true. This prevents the method from
                   // running again if it is called from the finalize() method
                   this.cleaned = true;
                   // From the word automation, recover the id of the Quit method
                   int[] id = this.wordAutomation.getIDsOfNames(new String[]{"Quit"});
                   // If the id of the Quit method cannot be recovered
                   // throw an exception - not much good really though.
                   if(id == null) {
                        throw new SWTException("Unable to obtain an id for the Quit " +
                             "property in WordSearchReplace.dispose().");
                   // Invoke Quit
              Variant result = this.wordAutomation.invoke(id[0]);
              // If an error occurs during the invocation, throw an exception.
              // Again though that exception is of limited value.
              if(result == null) {
                   throw new SWTException("A problem occurred trying to invoke the " +
                        "Quit method in WordSearchReplace.dispose().");
         finally {
              // Finally, dispose of the word application automation.
              this.wordAutomation.dispose();
         * The finalize() method has been over-ridden to ensure that resources
         * are correctly released if a WordSearchReplace object is created but
         * not disposed of properly before it becomes eligible for garbage
         * collection. The cleaned flag is used as acheck to ensure that the
         * dispose() method cannot be called more than once.
         public void finalize() throws Throwable {
              if(!this.cleaned) {
                   this.dispose();
         * Creates and returns a 'child' OleAutomation object. The object model
         * employed by Word, Excel and the like, arrange objects, methods and
         * properties hierarchically. To invoke a method, it is often necessary
         * to iterate through this hierarchy from parent to child and this method
         * supports that process.
         * @param automation An OleAutomation object that references the parent
         * automation.
         * @param childName An instance of the String class that encapsulates the
         * name of the child automation.
         * @throws SWTException if a problem is encountered invoking one or
         * other of the OLE methods.
         private OleAutomation getChildAutomation(OleAutomation automation,
         String childName) throws SWTException {
              // Try to recove the unique identifier for the child automation
              int[] id = automation.getIDsOfNames(new String[]{childName});
              // If the identifier cannot be found then throw an exception to
              // terminate processing.           
              if (id == null) {
                   throw new SWTException(
                        "A problem occurred trying to obtain and id for: " +
                   childName +
                   "in the getChildAutomation() method.");
              // SWT's implementation of OLE referes to all of Words objects, methods
              // and properties using the single term 'property'. The next stage
              // therefore is to recover a refence to the 'property' that relates
              // to the child automation.
              Variant pVarResult = automation.getProperty(id[0]);
              // If it is not possible to recover a 'property' for the child
              // automation, then throw an SWTException.
              if (pVarResult == null) {
                   throw new SWTException(
                        "A problem occurred trying to obtain an automation for property: " +
                   id[0] +
                   " in the getChildAutomation() method.");
              // As we are after a child automation in this instance, call the
              // getAutomation() method on the 'property'.
              return(pVarResult.getAutomation());
         * Sets the value of a property.
         * @param automation An instance of the OleAutomation class that will
         * hold a reference to the properties parent automation object
         * @param propertyName An instance of the String class that encapsulates the
         * name of the property whose value is to be set.
         * @param arguments An array of type Variant whose elements contain the
         * values that will be set for the named property.
         * @return A primitive boolean value that indicates whether or not the
         * properties value was successfully set.
         * @throws NullPointerException will be thrown if a null value is passed to
         * any of the methods three arguments.
         * @throws IllegalArgumentException will be thrown if an empty String
         * is passed to the propertyName parameter or if an empty array
         * is passed to the arguments parameter. Note, no check is made
         * on the vallues of the elements in the arguments array.
         * @throws SWTException will be thrown if a problem is encountered
         * imvoking any of the OLE methods.
         private boolean setPropertyValue(OleAutomation automation,
         String propertyName,
         Variant[] arguments) throws SWTException,
         NullPointerException,
         IllegalArgumentException {
              // Validate the various parameters
              if(automation == null) {
                   throw new NullPointerException(
                        "A null value was pas

    Alright, I'll try to keep it as simple as possible. If that's not going to work out, we can always complicate it later :)
    I suppose you had a look at the link and I assume you know about threads.
    We can easily fix this issue if you are instantiating, calling and disposing the object within one thread, e.g. you use it only in one method like
    public mySwtExecutionMethod(String fileName){
      WordSearchReplace replace = new WordSearchReplace();
      // do your replacing here
      replace.dispose();
      // no reference to replace is left so it won't escape this thread
    }Now the fix for your class becomes simple. As you remember from the link, you have to call all methods from within the UI thread. We will now create a Display every time upon instantiation of WordSearchReplace, so the current thread becomes the UI thread.
    I had a look at the constructor, and the overhead doesn't seem that bad, provided this is not a dedicated search&replace server.
    private final Display display;
    public WordSearchReplace()
         display = new Display(); // create display
         this.shell = new Shell(display);   // initialize shell with new display so this thread becomes the UI thread
         this.frame = new OleFrame(this.shell, SWT.NONE);
         this.wordSite = new OleClientSite(this.frame, SWT.NONE, WordSearchReplace.PROG_ID);
         this.wordAutomation = new OleAutomation(this.wordSite);
    }Since we always create a new Display, we should also dispose it. There is already a dispose() method, so we just have to add to it
    display.dispose();That's it!
    If you hold on longer to your reference and this isn't working for you, you'd have to do a lot more synchronizing and that the UI thread still exist as long as the reference.
    Wish you good luck

  • Org.eclipse.swt.SWTException: Widget is disposed

    Hello ,
    I am using SWT for creating UI , I am written following code for creating pop up window
    Button ok = componentsRenderer.createButtonWidget(versionTreeComponentsShell, SWT.PUSH,
                        PropertyClass.getPropertyLabel(QTLConstants.OK_BUTTON));
              Button cancel = componentsRenderer.createButtonWidget(versionTreeComponentsShell, SWT.PUSH,
                        PropertyClass.getPropertyLabel(QTLConstants.CANCEL_BUTTON));
              ok.addSelectionListener(new SelectionAdapter() {
              @Override
                   public void widgetSelected(SelectionEvent e) {
                   StringBuffer sbDefaultVersionSplitter = new StringBuffer();
                   String defaultVersionSplitterSelected = "";
                        if(versionSplitterCheckBoxList.size() > 0){
                             String[] defaultVersionSplitters = PropertyClass.getPropertyLabel(QTLConstants.VERSIONING_ASSISTENT_PAGE_SPLLITER).split(QTLConstants.MULTIPLE_EXTENSIONS_SPLITER);
                             for(Button cbButton : versionSplitterCheckBoxList){
                                  if(cbButton.getSelection() && !cbButton.getText().equalsIgnoreCase(defaultVersionSplitters[3])){
                                       // check is added for version number string equal to "<fileName><number>" i.e splitter is not present
                                       if(!cbButton.getText().equalsIgnoreCase(defaultVersionSplitters[2])){
                                            String tempVersionStringWithSplitter = cbButton.getText().substring(cbButton.getText().indexOf("_")+1,cbButton.getText().length());                                   
                                            String selectedSplitter = tempVersionStringWithSplitter.substring(0,tempVersionStringWithSplitter.indexOf("<"));                              
                                            sbDefaultVersionSplitter.append(selectedSplitter);
                                            sbDefaultVersionSplitter.append("|");
                             }//end of for loop
                             if(customVersionSplitterText.isEnabled() && customVersionSplitterText.getCharCount() > 0){
                                  sbDefaultVersionSplitter.append(customVersionSplitterText.getText());
                                  defaultVersionSplitterSelected = sbDefaultVersionSplitter.toString();
                             } else if(sbDefaultVersionSplitter.length() > 0 && (!customVersionSplitterText.isEnabled() || customVersionSplitterText.getCharCount() == 0)){
                                  defaultVersionSplitterSelected = sbDefaultVersionSplitter.toString().substring(0, sbDefaultVersionSplitter.length()-2);
                        }//end of if loop
                        dataBean.setVersionSplitterSelected(defaultVersionSplitterSelected);                    
                        versionTreeComponentsShell.close();     
              cancel.addSelectionListener(new SelectionAdapter() {
                   @Override
                   public void widgetSelected(SelectionEvent e) {               
                        versionTreeComponentsShell.setVisible(false);                    
    when i am clicking multiple time on "OK" button i am getting following error
    org.eclipse.swt.SWTException: Widget is disposed
         at org.eclipse.swt.SWT.error(SWT.java:4361)
         at org.eclipse.swt.SWT.error(SWT.java:4276)
         at org.eclipse.swt.SWT.error(SWT.java:4247)
         at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
         at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340)
         at org.eclipse.swt.widgets.Button.getSelection(Button.java:721)
         at com.impact.qtl12.imports.UI.CSVWizard.FileInputPage$10.widgetSelected(FileInputPage.java:784)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
         at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
         at org.eclipse.jface.window.Window.open(Window.java:801)
         at com.impact.qtl12.imports.UI.CSVFile.QTL$4.widgetSelected(QTL.java:427)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
         at com.impact.qtl12.imports.UI.CSVFile.QTL.createShell(QTL.java:767)
         at com.impact.qtl12.imports.UI.CSVFile.QTL.launch(QTL.java:826)
         at com.impact.qtl12.imports.UI.CSVFile.QTL.main(QTL.java:847)
    whats solution for this ?
    Regards

    You can try asking third party API questions here, but you'll likely be waiting a long time. You are better off looking for a forum that is specifically for your third party technology; in this case I would look around on the Eclipse website since its their tech.

  • Failed to send mail: java.lang.NullPointerException

    Hi @,
    I have configured my receiver mail adpter and while running it is throwing the following error in adapter engine and there is no trace availble to analyse the same Only the follwoing error :
    "failed to send mail: java.lang.NullPointerException"
    Any help Its urgent.
    Regards

    This is strange...some times this types of errors drives crazy isn't....delete it and recreate it.
    just curious the service for mail adapter  in Visaual admin is up right?

  • MailServiceHelper Failed while sending email java.lang.NullPointerException

    Hi guys,
    I am trying to send email with Adobe CQ API.
    But i am getting a nullpointer exception at this line:  MsgGateway.send(htmlEmail);    
    This is my method that i am using to send.
    import com.day.cq.mailer.MessageGateway;
    import com.day.cq.mailer.MessageGatewayService;
    import javax.mail.internet.InternetAddress;
       public boolean sendHtmlEmail(SlingHttpServletRequest sling,
                String fromMailAdress, List<String> recepientmailAddress,
                String emailSubject, String htmlbodyMail) {
            HtmlEmail htmlEmail = new HtmlEmail();
            List<InternetAddress> emailAddress = new ArrayList<InternetAddress>();
            try {
                for (String recipient : recepientmailAddress) {
                    if (!StringUtil.isEmpty(recipient)) {
                        emailAddress.add(new InternetAddress(recipient));
                        log.error(recipient);
                if (!StringUtil.isEmpty(fromMailAdress)) {
                    htmlEmail.setFrom(fromMailAdress);
                htmlEmail.setTo(emailAddress);
                htmlEmail.setSubject(emailSubject);
                htmlEmail.setHtmlMsg(htmlbodyMail);
                htmlEmail.setCharset("utf-8");
                MessageGatewayService MsgService = getMessageGateWayService(sling);
                MessageGateway<HtmlEmail> MsgGateway = MsgService.getGateway(HtmlEmail.class);
                MsgGateway.send(htmlEmail);   //nullpointer exception caught here        
                return true;
            } catch (Exception e) {
                log.error("Failed while sending email", e);
            return false;
    I have checked to ensure the bundle com.day.cq.cq-mail and my own bundle is running .
    I am also sure that 'htmlEmail' is not null by retrieving the email subject via .getSubject and it did return me the subject.
    I do not understand what is returning the nullpointerexception.
    Thanks in advance !

    The MessageGateway instance (MessageGateway<HtmlEmail> MsgGateway) is null therby throwing a null pointer.
    Instead of instanciating msgGateway as :
    MessageGatewayService MsgService = getMessageGateWayService(sling);
    MessageGateway<HtmlEmail> MsgGateway = MsgService.getGateway(HtmlEmail.class);
    Inject your MessageGateway as:
    @Reference
    private MessageGateway<HtmlEmail> msgGateway;
    and then call send on msgGateway as msgGateway.send(htmlEmail)
    ~ Aditya

  • Jar file of org.eclipse.swt.ole.win32.OLE

    Hi,
    Can anyone provide me the jar file for org.eclipse.swt.ole.win32.OLE.
    or can let me know where I will get it..
    Thanks in advanced,
    Sang

    hello ritu...
    you would require standard-1.1.2.jar .....
    try with that....
    u can download it from -
    http://www.java2s.com/Code/Jar/CatalogJar.htm
    classes contained in standard-1.1.2.jar -
    org.apache.taglibs.standard.tag.el.core.OutTag.class
    org.apache.taglibs.standard.tag.el.core.ParamTag.class
    org.apache.taglibs.standard.tag.el.core.RedirectTag.class
    org.apache.taglibs.standard.tag.el.core.SetTag.class
    org.apache.taglibs.standard.tag.el.core.UrlTag.class
    org.apache.taglibs.standard.tag.el.core.WhenTag.class
    org.apache.taglibs.standard.tag.el.fmt.BundleTag.class
    org.apache.taglibs.standard.tag.el.fmt.FormatDateTag.class
    org.apache.taglibs.standard.tag.el.fmt.FormatNumberTag.class
    regards
    vamsi

  • "UDDIClerkServlet" failed to preload on startup in Web application: "uddiportlets". java.lang.NullPointerException

    Hi,
    I was trying to implement jUDDI on weblogic. I have set up all the prerequisites, i have set up the db also. I am trying to deploy the application as an ear file which contains jUDDI war file, pluto portal war file, UDDI portlet war file. Everything is working without this UDDI portlet war file now when i added this UDDI its showing the following error in logs::
    Error is: 'weblogic.application.ModuleException: [HTTP:101216]Servlet: "UDDIClerkServlet" failed to preload on startup in Web application: "uddiportlets".
    java.lang.NullPointerException
        at org.apache.juddi.v3.client.config.UDDIClerkServlet.init(UDDIClerkServlet.java:49)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
        at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
        at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1981)
        at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1955)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1874)
        at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3154)
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
        at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:671)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
        at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:59)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
        at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    any help will be so helpful for me... Thanks in advance, have a nice day
    Thanks
    Sharath.

    Let's say your Weblogic domain for Contract Management is located in
    C:\Oracle\Middleware\user_projects\domains\cm, please first check if the com folder exists in the domain folder. If the folder not exists, you have to reinstall Contract Management using an administrative account.

  • Java.lang.NullPointerException when executing search

    I am doing the hibernate tutorial at http://www.roseindia.net/struts/struts-hibernate/struts-web-modules.shtml and have made the following hibernate config files and have deployed it on with the following hibernate config file to make the connection with oracle do I need to add any jars to the JBoss Application Server or is the following connection sufficient:
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory>
    <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="hibernate.connection.url">jdbc:oracle:thin:@10.5.80.43:1526:orcl</property>
    <property name="hibernate.connection.username">system</property>
    <property name="hibernate.connection.password">password</property>
    <property name="hibernate.connection.pool_size">10</property>
    <property name="show_sql">true</property>
    <property name="dialect">org.hibernate.dialect.OracleDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- Mapping files -->
    <mapping resource="/roseindia/net/dao/hibernate/Tutorial.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    since I am getting the error
    java.lang.NullPointerException
         roseindia.web.SearchTutorialAction.execute(Unknown Source)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.

    fixed it had to copy the jar files for the jdbc stuff

  • Importing security 11.1.1.3 fails "java.lang.NullPointerException"

    Hi Form,
    I'm importing Hyperion Planning security from one server (11.1.1.1) to a new installation (11.1.1.3).
    The Import fails - no access rights are imported at all.
    Here's the screen output (removed some names ...)
    D:\Hyperion\products\Planning\bin>ImportSecurity.cmd "<APP>,<USER>,SL_COMMA"
    Mon Jun 21 14:19:33 CEST 2010 :: The length of the string:: 1
    Enter password:
    Mon Jun 21 14:20:05 CEST 2010 :: Validating the Secfile.txt...
    [INFO] RegistryLogger - REGISTRY LOG INITIALIZED
    [INFO] RegistryLogger - REGISTRY LOG INITIALIZED
    D:\Hyperion\common\config\9.5.0.0\product\planning\9.5.0.0\planning_1.xml
    displayName = Planning
    componentTypes =
    priority = 50
    version = 9.5.0.0
    build = 1
    location = D:\Hyperion\products\Planning
    taskSequence =
    task =
    *******D:\Hyperion\common\config\9.5.0.0\registry.properties
    java.util.MissingResourceException: Can't find bundle for base name HspCustomMsgs, locale de_DE
    java.util.MissingResourceException: Can't find bundle for base name HspImgs, locale de_DE
    java.util.MissingResourceException: Can't find bundle for base name HspCustomImgs, locale de_DE
    Mon Jun 21 14:20:12 CEST 2010 :: Logging into the application
    using Java property for Hyperion Home D:\Hyperion
    Setting Arbor path to: D:\Hyperion\common\EssbaseRTC\9.5.0.0
    Setting HBR Mode to: 2
    =2010-06-21 14:20:23,015 WARN main com.hyperion.hbr.security.HbrSecurityAPI - Error retrieving user by identity
    d{ISO8601} WARN main com.hyperion.hbr.security.HbrSecurityAPI - Error retrieving user by identity
    Embedded HBR initialized.
    d{ISO8601} INFO main com.hyperion.audit.client.runtime.AuditRuntime - Audit Client has been created for the server http://demswbappx8111.de.ad.tmo:28080/interop/Audit
    d{ISO8601} INFO pinging com.hyperion.audit.client.cache.AuditConfigFilter - Client Enable Status false
    d{ISO8601} INFO filterConfig com.hyperion.audit.client.cache.AuditConfigFilter - Client Enable Status false
    Mon Jun 21 14:20:33 CEST 2010 :: Logged in successfully
    Mon Jun 21 14:20:34 CEST 2010 :: Error : Import Security Failed - null
    java.lang.NullPointerException
    at com.hyperion.planning.HspImportSecurityCmd.parseSecFile(Unknown Source)
    at com.hyperion.planning.HspImportSecurityCmd.importSecurity(Unknown Source)
    at com.hyperion.planning.HspImportSecurityCmd.main(Unknown Source)
    Mon Jun 21 14:20:34 CEST 2010 :: Logging off from application ....
    Mon Jun 21 14:20:34 CEST 2010 :: Logged out of the application.
    Mon Jun 21 14:20:34 CEST 2010 :: Import security failed.
    This is sysout.log of the Planning service:
    *[ERROR] [jsp] - Servlet.service() for servlet jsp threw exception <java.lang.NullPointerException>java.lang.NullPointerException*
         at org.apache.jsp.CustomDim_jsp._jspService(CustomDim_jsp.java:2339)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
         at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         at org.apache.jsp.Dimensions_jsp._jspService(Dimensions_jsp.java:2882)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at HspValidationFilter.doFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Any suggestions?
    Sascha.

    Hi Sascha,
    If you go through the following post (2 pages of replies), it is based around the same erorr you are getting, does it help you?
    Re: Export/Import of Security
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Failed to load servlet: java.lang.ExceptionInInitializerError

    Hi everybody,
    I got this webapp developed in Websphere Studio that generates this weird error when I fire up the test server.
    Everything else works fine, no errors.
    Any suggestions/advices??
    [Servlet.LOG]: JSP 1.2 Processor: init
    [Servlet.LOG]: FormLoginServlet: init
    [Servlet.LOG]: FormLogoutServlet: init
    [Servlet.LOG]: SimpleFileServlet: init
    [Servlet.LOG]: InvokerServlet: init
    [Servlet Error]-[action]: Failed to load servlet: java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:79)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))
         at java.lang.Class.newInstance3(Class.java(Compiled Code))
         at java.lang.Class.newInstance(Class.java(Compiled Code))
         at java.beans.Beans.instantiate(Beans.java:218)
         at java.beans.Beans.instantiate(Beans.java:62)
         at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:188)
         at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
         at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
         at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
         at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
         at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
         at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:1005)
         at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
         at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:505)
         at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:808)
         at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
         at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:578)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:299)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:256)
         at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
         at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
         at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:128)
         at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
         at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
         at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
         at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
         at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
         at java.lang.reflect.Method.invoke(Method.java:386)
         at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:105)
         at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
    Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassCastException: com.ibm.ws.commons.logging.TrLogFactory
         at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
         at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:352)
         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
         at      at org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:375).null(Unknown Source)
         ... 37 more
    Caused by: java.lang.ClassCastException: com.ibm.ws.commons.logging.TrLogFactory
         at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:571)
         ... 42 more
    [11/5/04 10:56:20:833 CST] 3cbe53b6 TraceNLS u No message text associated with key Servlet.[action]:.could.not.be.loaded in bundle com.ibm.ejs.resources.seriousMessages
    [11/5/04 10:56:20:833 CST] 3cbe53b6 WebAppServlet E Servlet [action]: could not be loaded
    Thanks for all time you took to look over this mess ! :-)

    Actually, best thing to do is switch to use internal commons-logging, or if you have to use another implementation such as log4j, you'll need to configure your server .. see http://www-1.ibm.com/support/docview.wss?uid=swg27004610
    to switch to internal commons-logging is easy
    change all
    import org.apache.log4j.Logger;to
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;and then go
    private static Log logger = LogFactory.getLog(Whatever.class);to get the logger

  • Failed to load servlet: java.lang.ClassNotFoundException

    I've been working on a project with other developers and we've all have our own sections of a large web application that we are working on. When we are each done working on our part we send our JSPs, Beans, and servlets to the lead developer that then deploys one EAR file on our Test/QA server. I now asked the tech lead if he could send me the EAR file so I can load the application in its entirety on my local machine. When I start up the server, I get the error "Failed to load servlet: java.lang.ClassNotFoundException" for each one of my servlets. Even if the servlet path is correct I still get that error. I also tried removing the servlet in the web.xml file and then adding it again, but I still get that error. Has anyone experienced anything like this before? Is this error appearing because I have two projects (my part of the application with only my code and the complete project from the EAR file) that point to the same servlets? I'm not sure how to resolve this. Any advice would be greatly appreciated. Thanks in advance!

    That's what I thought too. But I'm installing an EAR file exported directly from another persons computer and the application is working fine on his machine. So the EAR file will automatically place the servlets in their proper path and directory structure when I import it. In any case I checked the paths myself and they are correct (the servlet file does exist in the same path). I also removed the servlet from the web.xml file and added it again through the websphere UI so if there was any miss-type in the directory path it would have been corrected by websphere. I also tried making a minor change to the servlet file and resaving it thinking that it might correct something or do something that would allow my websphere environment to see/recognize the existance of the servlet, but that did not work. I'm out of ideas. Does anyone have any suggestions? Here is a part of my log file if it helps: Thanks!
    *** Starting the server ***
    IBM WebSphere Application Server, Release 4.0.4
    Advanced Single Server Edition for Multiplatforms
    Copyright IBM Corp., 1997-2001
    ************ Start Display Current Environment ************
    WebSphere AEs 4.0.4 ptf40230.02 running with process name localhost/Default Server and process id 3188
    Host Operating System is Windows 2000, version 5.0
    Java version = J2RE 1.3.1 IBM Windows 32 build cn131w-20020710 ORB130 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
    server.root = C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4
    Java Home = C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4\java\jre
    ws.ext.dirs = C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/java/lib;C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/classes;C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/lib;C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/lib/ext;C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/web/help;C:/Program Files/IBM/WebSphere Studio/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.0.1/runtime/wasListener.jar;C:/Program Files/IBM/WebSphere Studio/wstools/eclipse/plugins/com.ibm.etools.webservice_5.0.1/runtime/worf.jar
    Classpath = C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/properties;C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/lib/bootstrap.jar;C:/Program Files/IBM/WebSphere Studio/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.0.1/runtime/wteServers.jar;C:/Program Files/IBM/WebSphere Studio/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.0.1/runtime/wasToolsCommon.jar
    Java Library path = C:\Program Files\IBM\WebSphere Studio\runtimes\aes_v4/bin;C:\Program Files\IBM\WebSphere Studio\eclipse\jre\bin;.;C:\WINNT\system32;C:\WINNT;C:\Program Files\CA\Dcs\DMScripting\;C:\Program Files\CA\DCS\CAWIN\;C:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\CA_APPSW;C:\TNGSD\BIN;C:\Program Files\QuickTime\QTSystem\;C:\PROGRA~1\MICROS~2\Office;C:\Program Files\Microsoft SQL Server\80\Tools\BINN
    Current trace specification = *=all=disabled
    ************* End Display Current Environment *************
    [9/13/06 9:25:18:620 EDT] 64a937ec Server U Version : 4.0.4
    [9/13/06 9:25:18:636 EDT] 64a937ec Server U Edition: Advanced Single Server Edition for Multiplatforms
    [9/13/06 9:25:18:636 EDT] 64a937ec Server U Build date: Thu Sep 05 00:00:00 EDT 2002
    [9/13/06 9:25:18:636 EDT] 64a937ec Server U Build number: ptf40230.02
    [9/13/06 9:25:21:933 EDT] 64a937ec DrAdminServer I WSVR0053I: DrAdmin available on port 7000
    [9/13/06 9:25:21:995 EDT] 64a937ec ResourceBinde I WSVR0049I: Binding Session Persistence datasource as jdbc/Session
    [9/13/06 9:25:22:136 EDT] 64a937ec ResourceBinde I WSVR0049I: Binding IDS as jdbc/IDS
    [9/13/06 9:25:23:120 EDT] 64a937ec ServletEngine A SRVE0161I: IBM WebSphere Application Server - Web Container. Copyright IBM Corp. 1998-2001
    [9/13/06 9:25:23:183 EDT] 64a937ec ServletEngine A SRVE0162I: Servlet Specification Level: 2.2
    [9/13/06 9:25:23:183 EDT] 64a937ec ServletEngine A SRVE0163I: Supported JSP Specification Level: 1.1
    [9/13/06 9:25:23:292 EDT] 64a937ec ServletEngine A SRVE0167I: Session Manager is Configured - Initializing...
    [9/13/06 9:25:23:401 EDT] 64a937ec CacheManager A DYNA0011E: Servlet cache file dynacache.xml not found; caching is disabled
    [9/13/06 9:25:23:417 EDT] 64a937ec ServletEngine A SRVE0169I: Loading Web Module: IBM Universal Test Client.
    [9/13/06 9:25:23:761 EDT] 64a937ec WebGroup I SRVE0091I: [Servlet LOG]: JSP 1.1 Processor: init
    [9/13/06 9:25:23:792 EDT] 64a937ec WebGroup I SRVE0091I: [Servlet LOG]: SimpleFileServlet: init
    [9/13/06 9:25:24:511 EDT] 64a937ec ServletEngine A SRVE0169I: Loading Web Module: IDS.
    [9/13/06 9:25:24:683 EDT] 64a937ec WebGroup I SRVE0091I: [Servlet LOG]: JSP 1.1 Processor: init
    [9/13/06 9:25:24:683 EDT] 64a937ec WebGroup I SRVE0091I: [Servlet LOG]: SimpleFileServlet: init
    [9/13/06 9:25:24:698 EDT] 64a937ec WebGroup I SRVE0091I: [Servlet LOG]: InvokerServlet: init
    [9/13/06 9:25:24:714 EDT] 64a937ec WebGroup X Servlet Error-[SettingsServlet]: Failed to load servlet: java.lang.ClassNotFoundException: com.comp.ids.admin.servlet.SettingsServlet
         at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:382)
         at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:248)
         at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
         at com.ibm.ws.classloader.ReloadableClassLoader.loadClass(ReloadableClassLoader.java:79)
         at java.beans.Beans.instantiate(Beans.java:216)
         at java.beans.Beans.instantiate(Beans.java:77)
         at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:141)
         at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:325)
         at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:1218)
         at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:145)
         at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:259)
         at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:168)
         at com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:652)
         at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:36)
         at com.ibm.ws.runtime.Server.startModule(Server.java:617)
         at com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:333)
         at com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349)
         at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:884)
         at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)
         at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV4$1.run(ServerRunnerV4.java:56)
    Message was edited by:
    MCJasper

  • SPNego fails: Error creating GSS context - java.lang.NullPointerException

    Hi,
    I have successfully configured SPNego logon to the first portal in our landscape, however, on the next portal I've got to the SPNego logon is failing.
    When using the diagtool to analyse the problem tests 1-5 and 7 are passing successfully, however, test 6 is failing.
    I am configuring against the following software components:
    SAP J2EE - 7.00 SP13
    Sun JDK version: 1.4.2_14
    diagtool version 1.7.2
    MS Active Directory is configured as the EP UME with resolution mode simple.
    I believe the problem is in some way related to the authentication of the j2ee-<sid> user, however, I cannot narrow it down further. The password for this user has not changed since I generated the keytab file.
    Any help greatly appreciated.
    The following error is written to the diagtool trace file:
    Error creating GSS context.
    [EXCEPTION]
    GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new ACCEPT credentials failed!)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getKeyFromSubject(Krb5AcceptCredential.java:189)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getInstance(Krb5AcceptCredential.java:80)
    at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:75)
    at sun.security.jgss.GSSManagerImpl.getCredentialElement(GSSManagerImpl.java:149)
    at sun.security.jgss.GSSCredentialImpl.add(GSSCredentialImpl.java:334)
    at sun.security.jgss.GSSCredentialImpl.<init>(GSSCredentialImpl.java:44)
    at sun.security.jgss.GSSManagerImpl.createCredential(GSSManagerImpl.java:102)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.createGSSContext(Krb5ServerTest.java:104)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.execute(Krb5ServerTest.java:75)
    at com.sap.engine.config.diagtool.Task.execute(Task.java:55)
    at com.sap.engine.config.diagtool.Launcher.run(Launcher.java:343)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.engine.config.diagtool.Launcher.main(Launcher.java:394)
    Caused by: javax.security.auth.login.LoginException: java.lang.NullPointerException
    at java.lang.StringBuffer.append(StringBuffer.java:467)
    at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:576)
    at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:475)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
    at sun.security.jgss.LoginUtility.run(LoginUtility.java:57)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getKeyFromSubject(Krb5AcceptCredential.java:186)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getInstance(Krb5AcceptCredential.java:80)
    at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:75)
    at sun.security.jgss.GSSManagerImpl.getCredentialElement(GSSManagerImpl.java:149)
    at sun.security.jgss.GSSCredentialImpl.add(GSSCredentialImpl.java:334)
    at sun.security.jgss.GSSCredentialImpl.<init>(GSSCredentialImpl.java:44)
    at sun.security.jgss.GSSManagerImpl.createCredential(GSSManagerImpl.java:102)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.createGSSContext(Krb5ServerTest.java:104)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.execute(Krb5ServerTest.java:75)
    at com.sap.engine.config.diagtool.Task.execute(Task.java:55)
    at com.sap.engine.config.diagtool.Launcher.run(Launcher.java:343)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.engine.config.diagtool.Launcher.main(Launcher.java:394)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:730)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
    at sun.security.jgss.LoginUtility.run(LoginUtility.java:57)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getKeyFromSubject(Krb5AcceptCredential.java:186)
    ... 15 more
    Acquire credential failed for realm EUR.EMIGRP.COM

    Hello CJH,
    Thank you for following up.
    I will set the thread status to "assumed answered".
    Cheers,
    Julius

  • Getting "java.lang.NullPointerException" error message when trying to run an OATS OpenScript file from Eclipse to Create a record in Oracle EBS

    Hello,
    I'm trying to run a simple OpenScript script in Eclipse that creates a record (a Supplier in this case) in Oracle E-Business Suite. So I copied the the script file from OpenScript and created it as a Class in Eclipse.  Then I created a main class to call the methods within the script class but no matter what method I call (initialize, run or finalize) I'm getting the java.lang.NullPointerException message. The error doesn't seem to be related with any specific line in the script but with the way that I'm calling it.
    Should I call the OpenScript class from my main class in a different way? (see my examples below)
    BTW, all external .jar files coming with OATS have been added to my project in Eclipse.
    1) Here's the main class I created to call the OpenScript method (Eclipse auto-corrected my main class adding a Try and Catch around the method call):
    public class Test {
        public static void main(String[] args) {
            nvscript nvs = new nvscript();
            try {
                nvs.initialize();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
    2) Here's the script from OpenScript (the actual script has more steps but I'm just using the first one for a proof of concept):
    import oracle.oats.scripting.modules.basic.api.*;
    import oracle.oats.scripting.modules.browser.api.*;
    import oracle.oats.scripting.modules.functionalTest.api.*;
    import oracle.oats.scripting.modules.utilities.api.*;
    import oracle.oats.scripting.modules.utilities.api.sql.*;
    import oracle.oats.scripting.modules.utilities.api.xml.*;
    import oracle.oats.scripting.modules.utilities.api.file.*;
    import oracle.oats.scripting.modules.webdom.api.*;
    import oracle.oats.scripting.modules.formsFT.api.*;
    import oracle.oats.scripting.modules.applet.api.*;
    public class nvscript extends IteratingVUserScript {
        @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
        @ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
        @ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
        @ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
        @ScriptService oracle.oats.scripting.modules.applet.api.AppletService applet;
        @ScriptService oracle.oats.scripting.modules.formsFT.api.FormsService forms;
        public void initialize() throws Exception {
            this.getSettings().set("formsft.useformsonly",true);
            browser.launch();
        public void run() throws Exception {
            beginStep(
                    "[1] E-Business Suite Home Page Redirect (/ebs12cloud.winshuttle.com:8000/)",
                    0);
                web.window(2, "/web:window[@index='0' or @title='about:blank']")
                        .navigate("http://ebs12.xxxxxxx.com:8000/");
                web.window(4, "/web:window[@index='0' or @title='Login']")
                        .waitForPage(null);
                    think(4.969);
                web.textBox(
                        7,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_text[@id='usernameField' or @name='usernameField' or @index='0']")
                        .setText("winshuttle_user");
                    think(2.0);
                web.textBox(
                        8,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
                        .click();
                    think(1.109);
                web.textBox(
                        9,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
                        .setPassword(deobfuscate("kjhkjhkj=="));
                    think(1.516);
                web.button(
                        10,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:button[@id='SubmitButton' or @value='Login' or @index='0']")
                        .click();
            endStep();
        public void finish() throws Exception {       
    3) Here's the error messages I'm getting based on the method I call from my main class:
    3.a) when calling Initialize():
    java.lang.NullPointerException
        at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.getSettings(IteratingVUserScript.java:723)
        at nvscript.initialize(nvscript.java:22)
        at Test.main(Test.java:9)
    3 b) when calling Run():
    java.lang.NullPointerException
        at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.beginStep(IteratingVUserScript.java:260)
        at nvscript.run(nvscript.java:30)
        at Test.main(Test.java:9)
    Any help and/or constructive comment will be appreciated it.
    Thanks.
    Federico.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

Maybe you are looking for