对于macIntellijIdeaTmocat启动报ErrorrunningTomcat:/conf/Catalina感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍ideatomcat启动报错
对于mac Intellij Idea Tmocat 启动报 Error running Tomcat: /conf/Catalina感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍ideatomcat启动报错,并为您提供关于Centos 中 tomcat 关闭报错,Could not contact localhost:8005. Tomcat may not be running、com.intellij.openapi.application.impl.LaterInvocator的实例源码、Error running ''tomcat:run'' Cannot run program..CreateProcess error=2, 系统找不到指定的文件、Error running Tomcat8: Address localhost:1099 is already in use(IDEA 错误)的有用信息。
本文目录一览:- mac Intellij Idea Tmocat 启动报 Error running Tomcat: /conf/Catalina(ideatomcat启动报错)
- Centos 中 tomcat 关闭报错,Could not contact localhost:8005. Tomcat may not be running
- com.intellij.openapi.application.impl.LaterInvocator的实例源码
- Error running ''tomcat:run'' Cannot run program..CreateProcess error=2, 系统找不到指定的文件
- Error running Tomcat8: Address localhost:1099 is already in use(IDEA 错误)
mac Intellij Idea Tmocat 启动报 Error running Tomcat: /conf/Catalina(ideatomcat启动报错)
原因:主要是 tomcat 下 Catalina 目录没有权限导致,将其设置读写权限即可
如果在刚刚启动 tomcat 时出现以下问题:
Error running Tomcat 8.5.31: Error copying configuration files from /usr/local/apache-tomcat-8.5.3/conf to /Users/zhouyuchen/Library/Caches/IntelliJIdea2016.1/tomcat/Tomcat_8_5_31_ttt/conf: Directory is invalid /usr/local/apache-tomcat-8.5.3/conf/Catalina
解决方案:
cd /Library/Tomcat/conf/
sudo chmod 777 Catalina
然后又出现这样的错误:
Error running tomcat8.5.15: Error copying configuration files from /home/dell/software/apache-tomcat-8.5.15/conf to /home/dell/.IntelliJIdea2017.1/system/tomcat/Unnamed_LibManage/conf: /home/dell/software/apache-tomcat-8.5.15/conf/Catalina/localhost (权限不够)
依次输入
最终在运行
可能会报 8080 端口被占用
在 IntelliJ IDEA 可以修改
或者在 run 下面也有
Centos 中 tomcat 关闭报错,Could not contact localhost:8005. Tomcat may not be running
在 Centos7 服务器中关闭 tomcat 一直出现 Could not contact localhost:8005. Tomcat may not be running。
经过网上查资料,需要做如下修改:
在 jdk 安装路径 jdk1.8.0_40/jre/lib/security 中修改 java.security 文件:
将 "securerandom.source=file:/dev/random"
修改为"securerandom.source=file:/dev/./urandom"
修改完后,重新启动 tomcat 即可。
com.intellij.openapi.application.impl.LaterInvocator的实例源码
public void testModalityState() { assertReady(null); myMonitor.addActivity(new UiActivity("non_modal_1"),ModalityState.NON_MODAL); assertBusy(null); LaterInvocator.enterModal("dialog"); try { assertReady(null); myMonitor.addActivity(new UiActivity("non_modal2"),ModalityState.NON_MODAL); assertReady(null); myMonitor.addActivity(new UiActivity("modal_1"),new ModalityStateEx(new Object[] {"dialog"})); assertBusy(null); myMonitor.addActivity(new UiActivity("modal_2"),new ModalityStateEx(new Object[] {"dialog","popup"})); assertBusy(null); } finally { LaterInvocator.leaveModal("dialog"); } assertBusy(null); }
public void makeModalAware(Project project) { MavenUtil.invokelater(project,new Runnable() { public void run() { final ModalityStateListener listener = new ModalityStateListener() { @Override public void beforeModalityStateChanged(boolean entering) { if (entering) { suspend(); } else { resume(); } } }; LaterInvocator.addModalityStateListener(listener,MavenMergingUpdateQueue.this); if (MavenUtil.isInModalContext()) { suspend(); } } }); }
private void processClose() { if (Registry.getInstance().isRestartNeeded()) { final ApplicationEx app = (ApplicationEx) ApplicationManager.getApplication(); final ApplicationInfo info = ApplicationInfo.getInstance(); final int r = Messages.showOkCancelDialog(myContent,"You need to restart " + info.getVersionName() + " for the changes to take effect","Restart required",(app.isRestartCapable() ? "Restart Now" : "Shutdown Now"),(app.isRestartCapable() ? "Restart Later": "Shutdown Later"),Messages.getQuestionIcon()); if (r == 0) { LaterInvocator.invokelater(new Runnable() { @Override public void run() { app.restart(true); } },ModalityState.NON_MODAL); } } }
public void makeModalAware(Project project) { MavenUtil.invokeAndWait(project,new Runnable() { public void run() { final ModalityStateListener listener = new ModalityStateListener() { public void beforeModalityStateChanged(boolean entering) { if (entering) { suspend(); } else { resume(); } } }; LaterInvocator.addModalityStateListener(listener,MavenMergingUpdateQueue.this); if (MavenUtil.isInModalContext()) { suspend(); } } }); }
private static ListPopupStep buildStep(@Nonnull final List<Pair<AnAction,Keystroke>> actions,final DataContext ctx) { return new BaseListPopupStep<Pair<AnAction,Keystroke>>("Choose an action",ContainerUtil.findAll(actions,pair -> { final AnAction action = pair.getFirst(); final Presentation presentation = action.getTemplatePresentation().clone(); AnActionEvent event = new AnActionEvent(null,ctx,ActionPlaces.UNKNowN,presentation,ActionManager.getInstance(),0); ActionUtil.performDumbAwareUpdate(LaterInvocator.isInModalContext(),action,event,true); return presentation.isEnabled() && presentation.isVisible(); })) { @Override public PopupStep onChosen(Pair<AnAction,Keystroke> selectedValue,boolean finalChoice) { invokeAction(selectedValue.getFirst(),ctx); return FINAL_CHOICE; } }; }
private void fillMenu() { DataContext context; boolean mayContextBeInvalid; if (myContext != null) { context = myContext; mayContextBeInvalid = false; } else { @SuppressWarnings("deprecation") DataContext contextFromFocus = DataManager.getInstance().getDataContext(); context = contextFromFocus; if (context.getData(PlatformDataKeys.CONTEXT_COMPONENT) == null) { IdeFrame frame = UIUtil.getParentOfType(IdeFrame.class,this); context = DataManager.getInstance().getDataContext(IdeFocusManager.getGlobalInstance().getLastFocusedFor(frame)); } mayContextBeInvalid = true; } Utils.fillMenu(myGroup.getAction(),this,myMnemonicEnabled,myPresentationFactory,context,myPlace,true,mayContextBeInvalid,LaterInvocator.isInModalContext()); }
public void testRenameFileWithoutDir() throws Exception { FileManager fileManager = myPsiManager.getFileManager(); VirtualFile file = myPrjdir1.createChildData(null,"a.txt"); PsiFile psiFile = fileManager.findFile(file); PlatformTestUtil.tryGcSoftlyReachableObjects(); if (((FileManagerImpl)fileManager).getCachedDirectory(myPrjdir1) != null) { Processor<PsiDirectory> isReallyLeak = new Processor<PsiDirectory>() { @Override public boolean process(PsiDirectory directory) { return directory.getVirtualFile().equals(myPrjdir1); } }; LeakHunter.checkLeak(ApplicationManager.getApplication(),PsiDirectory.class,isReallyLeak); LeakHunter.checkLeak(IdeEventQueue.getInstance(),isReallyLeak); LeakHunter.checkLeak(LaterInvocator.getLaterInvocatorQueue(),isReallyLeak); String dumpPath = FileUtil.createTempFile( new File(System.getProperty("teamcity.build.tempDir",System.getProperty("java.io.tmpdir"))),"testRenameFileWithoutDir",".hprof",false,false).getPath(); MemoryDumpHelper.captureMemoryDump(dumpPath); System.out.println(dumpPath); assertNull(((FileManagerImpl)fileManager).getCachedDirectory(myPrjdir1)); fail("directory just died"); } EventsTestListener listener = new EventsTestListener(); myPsiManager.addPsiTreechangelistener(listener,getTestRootdisposable()); file.rename(null,"b.txt"); String string = listener.getEventsstring(); String expected = "beforePropertyChange fileName\n" + "propertyChanged fileName\n"; assertEquals(psiFile.getName(),expected,string); }
@NotNull public static WindowWrapper.Mode getwindowMode(@NotNull DiffDialogHints hints) { WindowWrapper.Mode mode = hints.getMode(); if (mode == null) { boolean isUnderDialog = LaterInvocator.isInModalContext(); mode = isUnderDialog ? WindowWrapper.Mode.MODAL : WindowWrapper.Mode.FRAME; } return mode; }
@Override public void initComponent() { ModalityStateListener myModalityStateListener = new ModalityStateListener() { @Override public void beforeModalityStateChanged(boolean entering) { for (Editor editor : myEditors) { ((EditorImpl)editor).beforeModalityStateChanged(); } } }; LaterInvocator.addModalityStateListener(myModalityStateListener,ApplicationManager.getApplication()); }
@Override public AWTEvent peekEvent() { AWTEvent event = super.peekEvent(); if (event != null) { return event; } if (isTestMode() && LaterInvocator.ensureFlushRequested()) { return super.peekEvent(); } return null; }
@Override protected void tearDown() throws Exception { Object[] entities = LaterInvocator.getCurrentMoDalentities(); for (int i = entities.length - 1; i >= 0; i--) { Object state = entities[i]; LaterInvocator.leaveModal(state); } super.tearDown(); }
public void testModalityStateAny() { assertReady(null); myMonitor.addActivity(new UiActivity("non_modal_1"),ModalityState.any()); assertBusy(null); try { LaterInvocator.enterModal("dialog"); assertBusy(null); } finally { LaterInvocator.leaveModal("dialog"); } }
protected void updateModel(DataContext dataContext) { if (LaterInvocator.isInModalContext() || (updated && !isFixedComponent)) return; if (PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext) instanceof NavBarPanel) return; PsiElement psiElement = CommonDataKeys.PSI_FILE.getData(dataContext); if (psiElement == null) { psiElement = CommonDataKeys.PSI_ELEMENT.getData(dataContext); } psiElement = normalize(psiElement); if (!myModel.isEmpty() && myModel.get(myModel.size() - 1).equals(psiElement) && !myChanged) return; if (psiElement != null && psiElement.isValid()) { updateModel(psiElement); } else { if (UISettings.getInstance().SHOW_NAVIGATION_BAR && !myModel.isEmpty()) return; Object root = calculateRoot(dataContext); if (root != null) { setModel(Collections.singletonList(root)); } } setChanged(false); updated = true; }
@Override protected void prepareShowDialog() { if (myRunnable != null) { LaterInvocator.invokelater(myRunnable,getModalityState()); } showDialog(); }
@Override public void initComponent() { ModalityStateListener myModalityStateListener = new ModalityStateListener() { @Override public void beforeModalityStateChanged(boolean entering) { for (Editor editor : myEditors) { ((EditorImpl)editor).beforeModalityStateChanged(); } } }; LaterInvocator.addModalityStateListener(myModalityStateListener,ApplicationManager.getApplication()); }
protected void updateModel(DataContext dataContext) { if (LaterInvocator.isInModalContext() || (updated && !isFixedComponent)) return; if (PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext) instanceof NavBarPanel) return; PsiElement psiElement = LangDataKeys.PSI_FILE.getData(dataContext); if (psiElement == null) { psiElement = LangDataKeys.PSI_ELEMENT.getData(dataContext); } psiElement = normalize(psiElement); if (!myModel.isEmpty() && myModel.get(myModel.size() - 1).equals(psiElement) && !myChanged) return; if (psiElement != null && psiElement.isValid()) { updateModel(psiElement); } else { if (UISettings.getInstance().SHOW_NAVIGATION_BAR && !myModel.isEmpty()) return; Object moduleOrProject = LangDataKeys.MODULE.getData(dataContext); if (moduleOrProject == null) { moduleOrProject = PlatformDataKeys.PROJECT.getData(dataContext); } if (moduleOrProject != null) { setModel(Collections.singletonList(moduleOrProject)); } } setChanged(false); updated = true; }
@Nonnull public static WindowWrapper.Mode getwindowMode(@Nonnull DiffDialogHints hints) { WindowWrapper.Mode mode = hints.getMode(); if (mode == null) { boolean isUnderDialog = LaterInvocator.isInModalContext(); mode = isUnderDialog ? WindowWrapper.Mode.MODAL : WindowWrapper.Mode.FRAME; } return mode; }
public void testModalityState() { assumeFalse("Test cannot be run in headless environment",GraphicsEnvironment.isHeadless()); assertTrue(ApplicationManager.getApplication() instanceof ApplicationImpl); assertTrue(ApplicationManager.getApplication().isdispatchThread()); assertReady(null); myMonitor.addActivity(new UiActivity("non_modal_1"),ModalityState.NON_MODAL); assertBusy(null); Dialog dialog = new Dialog(new Dialog((Window)null),"d",true); LaterInvocator.enterModal(dialog); try { assertReady(null); myMonitor.addActivity(new UiActivity("non_modal2"),ModalityState.NON_MODAL); assertReady(null); ModalityState m1 = ApplicationManager.getApplication().getModalityStateForComponent(dialog); myMonitor.addActivity(new UiActivity("modal_1"),m1); assertBusy(null); Dialog popup = new Dialog(dialog,"popup",true); LaterInvocator.enterModal(popup); ModalityState m2 = ApplicationManager.getApplication().getModalityStateForComponent(popup); LaterInvocator.leaveModal(popup); assertTrue("m1: "+m1+"; m2:"+m2,m2.dominates(m1)); myMonitor.addActivity(new UiActivity("modal_2"),m2); assertBusy(null); } finally { LaterInvocator.leaveModal(dialog); } assertBusy(null); }
public void testModalityStateAny() { assertReady(null); myMonitor.addActivity(new UiActivity("non_modal_1"),ModalityState.any()); assertBusy(null); try { LaterInvocator.enterModal("dialog"); assertBusy(null); } finally { LaterInvocator.leaveModal("dialog"); } }
@Override public void addNotify() { super.addNotify(); if (myPresentationListener == null) { myPresentation.addPropertychangelistener(myPresentationListener = this::presentationPropertyChanded); } AnActionEvent e = AnActionEvent.createFromInputEvent(null,myPresentation,getDataContext(),true); ActionUtil.performDumbAwareUpdate(LaterInvocator.isInModalContext(),myAction,e,false); updatetoolTipText(); updateIcon(); }
@Override public void show(final Component component,int x,int y) { if (!component.isShowing()) { //noinspection HardCodedStringLiteral throw new IllegalArgumentException("component must be shown on the screen"); } removeAll(); // Fill menu. Only after filling menu has non zero size. int x2 = Math.max(0,Math.min(x,component.getWidth() - 1)); // fit x into [0,width-1] int y2 = Math.max(0,Math.min(y,component.getHeight() - 1)); // fit y into [0,height-1] myContext = myDataContextProvider != null ? myDataContextProvider.get() : DataManager.getInstance().getDataContext(component,x2,y2); Utils.fillMenu(myGroup,myContext,LaterInvocator.isInModalContext()); if (getComponentCount() == 0) { return; } if (myApp != null) { if (myApp.isActive()) { Component frame = UIUtil.findUltimateParent(component); if (frame instanceof IdeFrame) { myFrame = (IdeFrame)frame; } myConnection = myApp.getMessageBus().connect(); myConnection.subscribe(ApplicationActivationListener.TOPIC,ActionPopupMenuImpl.this); } } super.show(component,x,y); }
@Override public void initComponent() { ModalityStateListener myModalityStateListener = entering -> { for (Editor editor : myEditors) { ((EditorImpl)editor).beforeModalityStateChanged(); } }; LaterInvocator.addModalityStateListener(myModalityStateListener,ApplicationManager.getApplication()); }
@Nonnull private Presentation updateActionItem(@Nonnull ActionItem actionItem) { AnAction action = actionItem.getAction(); Presentation presentation = new Presentation(); presentation.setDescription(action.getTemplatePresentation().getDescription()); final AnActionEvent actionEvent = new AnActionEvent(null,DataManager.getInstance().getDataContext(myComponent),myActionPlace,0); actionEvent.setInjectedContext(action.isInInjectedContext()); ActionUtil.performDumbAwareUpdate(LaterInvocator.isInModalContext(),actionEvent,false); return presentation; }
@Override public AWTEvent peekEvent() { AWTEvent event = super.peekEvent(); if (event != null) { return event; } if (isTestMode() && LaterInvocator.ensureFlushRequested()) { return super.peekEvent(); } return null; }
@Nonnull public static List<AnAction> registerUnversionedActionsShortcuts(@Nonnull DataContext dataContext,@Nonnull JComponent component) { ActionManager manager = ActionManager.getInstance(); List<AnAction> actions = ContainerUtil.newArrayList(); Utils.expandActionGroup(LaterInvocator.isInModalContext(),getUnversionedActionGroup(),actions,new PresentationFactory(),dataContext,"",manager); for (AnAction action : actions) { action.registerCustomShortcutSet(action.getShortcutSet(),component); } return actions; }
protected void updateModel(DataContext dataContext) { if (LaterInvocator.isInModalContext() || (updated && !isFixedComponent)) return; if (dataContext.getData(PlatformDataKeys.CONTEXT_COMPONENT) instanceof NavBarPanel) return; PsiElement psiElement = dataContext.getData(CommonDataKeys.PSI_FILE); if (psiElement == null) { psiElement = dataContext.getData(CommonDataKeys.PSI_ELEMENT); } psiElement = normalize(psiElement); if (!myModel.isEmpty() && myModel.get(myModel.size() - 1).equals(psiElement) && !myChanged) return; if (psiElement != null && psiElement.isValid()) { updateModel(psiElement); } else { if (UISettings.getInstance().getShowNavigationBar() && !myModel.isEmpty()) return; Object root = calculateRoot(dataContext); if (root != null) { setModel(Collections.singletonList(root)); } } setChanged(false); updated = true; }
public static boolean isInModalContext() { if (isNoBackgroundMode()) return false; return LaterInvocator.isInModalContext(); }
public Result doFix(@NotNull final Editor editor,boolean allowPopup,final boolean allowCaretNearRef) { List<PsiClass> classesToImport = getClassesToImport(); if (classesToImport.isEmpty()) return Result.POPUP_NOT_SHOWN; try { String name = getQualifiedname(myElement); if (name != null) { Pattern pattern = Pattern.compile(DaemonCodeAnalyzerSettings.getInstance().NO_AUTO_IMPORT_PATTERN); Matcher matcher = pattern.matcher(name); if (matcher.matches()) { return Result.POPUP_NOT_SHOWN; } } } catch (PatternSyntaxException e) { //ignore } final PsiFile psiFile = myElement.getContainingFile(); if (classesToImport.size() > 1) { reduceSuggestedClassesBasedOnDependencyRuleViolation(psiFile,classesToImport); } PsiClass[] classes = classesToImport.toArray(new PsiClass[classesToImport.size()]); final Project project = myElement.getProject(); CodeInsightUtil.sortIdenticalShortNameClasses(classes,myRef); final QuestionAction action = createAddImportAction(classes,project,editor); boolean canImportHere = true; if (classes.length == 1 && (canImportHere = canImportHere(allowCaretNearRef,editor,psiFile,classes[0].getName())) && (FileTypeUtils.isInServerPageFile(psiFile) ? CodeInsightSettings.getInstance().JSP_ADD_UNAMBIGIoUS_IMPORTS_ON_THE_FLY : CodeInsightSettings.getInstance().ADD_UNAMBIGIoUS_IMPORTS_ON_THE_FLY) && (ApplicationManager.getApplication().isUnitTestMode() || DaemonListeners.canChangeFileSilently(psiFile)) && !autoImportwillInsertUnexpectedCharacters(classes[0]) && !LaterInvocator.isInModalContext() ) { CommandProcessor.getInstance().runUndoTransparentAction(new Runnable() { @Override public void run() { action.execute(); } }); return Result.CLASS_AUTO_IMPORTED; } if (allowPopup && canImportHere) { String hintText = ShowAutoImportPass.getMessage(classes.length > 1,classes[0].getQualifiedname()); if (!ApplicationManager.getApplication().isUnitTestMode() && !HintManager.getInstance().hasShownHintsThatwillHideByOtherHint(true)) { HintManager.getInstance().showQuestionHint(editor,hintText,getStartOffset(myElement,myRef),getEndOffset(myElement,action); } return Result.POPUP_SHOWN; } return Result.POPUP_NOT_SHOWN; }
private void doEnterModality() { if (!myModalityEntered) { LaterInvocator.enterModal(this); myModalityEntered = true; } }
private void doExitModality() { if (myModalityEntered) { myModalityEntered = false; LaterInvocator.leaveModal(this); } }
@Override public Object[] getCurrentMoDalentities() { return LaterInvocator.getCurrentMoDalentities(); }
@Override public ActionCallback show() { LOG.assertTrue(EventQueue.isdispatchThread(),"Access is allowed from event dispatch thread only"); if (myTypeAheadCallback != null) { IdeFocusManager.getInstance(myProject).typeAheadUntil(myTypeAheadCallback); } LOG.assertTrue(EventQueue.isdispatchThread(),"Access is allowed from event dispatch thread only"); final ActionCallback result = new ActionCallback(); final AnCancelAction anCancelAction = new AnCancelAction(); final JRootPane rootPane = getRootPane(); anCancelAction.registerCustomShortcutSet(CommonShortcuts.ESCAPE,rootPane); mydisposeActions.add(new Runnable() { @Override public void run() { anCancelAction.unregisterCustomShortcutSet(rootPane); } }); if (!myCanBeParent && myWindowManager != null) { myWindowManager.doNotSuggestAsParent(myDialog.getwindow()); } final CommandProcessorEx commandProcessor = ApplicationManager.getApplication() != null ? (CommandProcessorEx)CommandProcessor.getInstance() : null; final boolean appStarted = commandProcessor != null; boolean changeModalityState = appStarted && myDialog.isModal() && !isProgressDialog(); // ProgressWindow starts a modality state itself if (changeModalityState) { commandProcessor.enterModal(); LaterInvocator.enterModal(myDialog); } if (appStarted) { hidePopupsIfNeeded(); } try { myDialog.show(); } finally { if (changeModalityState) { commandProcessor.leaveModal(); LaterInvocator.leaveModal(myDialog); } myDialog.getFocusManager().doWhenFocusSettlesDown(result.createSetDoneRunnable()); } return result; }
public void installListener() { LaterInvocator.addModalityStateListener(this,this); }
private boolean canSyncOrSave() { return !LaterInvocator.isInModalContext() && !myProgressManager.hasModalProgressIndicator(); }
public void testCommitDocumentInModalDialog() throws IOException { VirtualFile vFile = getVirtualFile(createTempFile("a.txt","abc")); PsiFile psiFile = getPsiManager().findFile(vFile); final Document document = getPsiDocumentManager().getDocument(psiFile); final DialogWrapper dialog = new DialogWrapper(getProject()) { @Nullable @Override protected JComponent createCenterPanel() { return null; } }; dispoSEOnTearDown(new disposable() { @Override public void dispose() { dialog.close(DialogWrapper.OK_EXIT_CODE); } }); ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { // commit thread is paused document.setText("xx"); LaterInvocator.enterModal(dialog); } }); assertNotSame(ModalityState.NON_MODAL,ApplicationManager.getApplication().getCurrentModalityState()); long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < 10000) { UIUtil.dispatchAllInvocationEvents(); // must not be committed until exit modal dialog assertFalse(getPsiDocumentManager().isCommitted(document)); } LaterInvocator.leaveModal(dialog); assertEquals(ModalityState.NON_MODAL,ApplicationManager.getApplication().getCurrentModalityState()); start = System.currentTimeMillis(); // must committ while (System.currentTimeMillis() - start < 10000 && !getPsiDocumentManager().isCommitted(document)) { UIUtil.dispatchAllInvocationEvents(); } assertTrue(getPsiDocumentManager().isCommitted(document)); // check that inside modal dialog commit is possible ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { // commit thread is paused LaterInvocator.enterModal(dialog); document.setText("yyy"); } }); assertNotSame(ModalityState.NON_MODAL,ApplicationManager.getApplication().getCurrentModalityState()); // must committ while (System.currentTimeMillis() - start < 10000 && !getPsiDocumentManager().isCommitted(document)) { UIUtil.dispatchAllInvocationEvents(); } assertTrue(getPsiDocumentManager().isCommitted(document)); LaterInvocator.leaveModal(dialog); }
public RollbackChangesDialog(final Project project,List<Localchangelist> changelists,final List<Change> changes,final boolean refreshSynchronously,final Runnable afterVcsRefreshInAwt) { super(project,true); myProject = project; myRefreshSynchronously = refreshSynchronously; myAfterVcsRefreshInAwt = afterVcsRefreshInAwt; myInvokedFromModalContext = LaterInvocator.isInModalContext(); myInfoCalculator = new ChangeInfoCalculator(); myCommitLegendPanel = new CommitLegendPanel(myInfoCalculator); myListchangelistener = new Runnable() { @Override public void run() { if (mybrowser != null) { myInfoCalculator.update(new ArrayList<Change>(mybrowser.getAllChanges()),new ArrayList<Change>(mybrowser.getChangesIncludedInAllLists())); myCommitLegendPanel.update(); Collection<Change> selected = mybrowser.getChangesIncludedInAllLists(); List<Change> visibleSelected = mybrowser.getCurrentIncludedChanges(); if (selected.size() != visibleSelected.size()) { setErrorText("Selection contains changes from other changelist"); } else { setErrorText(null); } } } }; mybrowser = new Multiplechangelistbrowser(project,changelists,changes,getdisposable(),null,myListchangelistener,myListchangelistener); myOperationName = operationNameByChanges(project,changes); setoKButtonText(myOperationName); myOperationName = UIUtil.removeMnemonic(myOperationName); setTitle(VcsBundle.message("changes.action.rollback.custom.title",myOperationName)); setCancelButtonText(CommonBundle.getCloseButtonText()); mybrowser.setToggleActionTitle("&Include in " + myOperationName.toLowerCase()); for (Change c : changes) { if (c.getType() == Change.Type.NEW) { myDeleteLocallyAddedFiles = new JCheckBox(VcsBundle.message("changes.checkBox.delete.locally.added.files")); myDeleteLocallyAddedFiles.setSelected(PropertiesComponent.getInstance().isTrueValue(DELETE_LOCALLY_ADDED_FILES_KEY)); myDeleteLocallyAddedFiles.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final boolean value = myDeleteLocallyAddedFiles.isSelected(); PropertiesComponent.getInstance().setValue(DELETE_LOCALLY_ADDED_FILES_KEY,String.valueOf(value)); } }); break; } } init(); myListchangelistener.run(); }
public static boolean isInModalContext() { if (isNoBackgroundMode()) return false; return LaterInvocator.isInModalContext(); }
public Result doFix(@NotNull final Editor editor,editor); DaemonCodeAnalyzerImpl codeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(project); boolean canImportHere = true; if (classes.length == 1 && (canImportHere = canImportHere(allowCaretNearRef,classes[0].getName())) && (JspPsiUtil.isInjspFile(psiFile) ? CodeInsightSettings.getInstance().JSP_ADD_UNAMBIGIoUS_IMPORTS_ON_THE_FLY : CodeInsightSettings.getInstance().ADD_UNAMBIGIoUS_IMPORTS_ON_THE_FLY) && (ApplicationManager.getApplication().isUnitTestMode() || codeAnalyzer.canChangeFileSilently(psiFile)) && !autoImportwillInsertUnexpectedCharacters(classes[0]) && !LaterInvocator.isInModalContext() ) { CommandProcessor.getInstance().runUndoTransparentAction(new Runnable() { @Override public void run() { action.execute(); } }); return Result.CLASS_AUTO_IMPORTED; } if (allowPopup && canImportHere) { String hintText = ShowAutoImportPass.getMessage(classes.length > 1,action); } return Result.POPUP_SHOWN; } return Result.POPUP_NOT_SHOWN; }
public void projectOpened() { //myFocusWatcher.install(myWindows.getComponent ()); getMainSplitters().startListeningFocus(); MessageBusConnection connection = myProject.getMessageBus().connect(myProject); final FileStatusManager fileStatusManager = FileStatusManager.getInstance(myProject); if (fileStatusManager != null) { /** * Updates tabs colors */ final MyFileStatusListener myFileStatusListener = new MyFileStatusListener(); fileStatusManager.addFileStatusListener(myFileStatusListener,myProject); } connection.subscribe(FileTypeManager.TOPIC,new MyFileTypeListener()); connection.subscribe(ProjectTopics.PROJECT_ROOTS,new MyRootsListener()); /** * Updates tabs names */ final MyVirtualFileListener myVirtualFileListener = new MyVirtualFileListener(); VirtualFileManager.getInstance().addVirtualFileListener(myVirtualFileListener,myProject); /** * Extends/cuts number of opened tabs. Also updates location of tabs. */ final MyUISettingsListener myUISettingsListener = new MyUISettingsListener(); UISettings.getInstance().addUISettingsListener(myUISettingsListener,myProject); StartupManager.getInstance(myProject).registerPostStartupActivity(new DumbAwareRunnable() { public void run() { setTabsMode(UISettings.getInstance().EDITOR_TAB_PLACEMENT != UISettings.TABS_NONE); ToolWindowManager.getInstance(myProject).invokelater(new Runnable() { public void run() { CommandProcessor.getInstance().executeCommand(myProject,new Runnable() { public void run() { LaterInvocator.invokelater(new Runnable() { public void run() { long currentTime = System.nanoTime(); Long startTime = myProject.getUserData(ProjectImpl.CREATION_TIME); if (startTime != null) { LOG.info("Project opening took " + (currentTime - startTime.longValue()) / 1000000 + " ms"); PluginManager.dumpPluginClassstatistics(); } } }); // group 1 } },null); } }); } }); }
private void doEnterModality() { if (!myModalityEntered) { LaterInvocator.enterModal(this); myModalityEntered = true; } }
Error running ''tomcat:run'' Cannot run program..CreateProcess error=2, 系统找不到指定的文件
Error running ''tomcat:run'': Cannot run program "tomcat:run" (in directory "D:\WorkTest\Maven\maven02"): CreateProcess error=2, 系统找不到指定的文件
当看到这样的报错真的难受!!
搞了一下午,换了 maven 的好多版本,又试了 jdk 的配置,maven 配置也没问题,idea 配置也没问题!!!
1. 重点来了 用 tomcat:run 在工程目录下运行还是一直报错!王德发!!!
难受不!!! (我是跟着视频学敲的)
最后配置了
mvn tomcat7:run 这样才行,码的默认的 tomcat 有问题啊!考虑默认版本 tomcat6 有问题, 记住 mvn tomcat7:run 才可以运行
这是 pom.xml


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>zo1</groupId>
<artifactId>maven02</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>maven02 Maven Webapp</name>
<!-- FIXME change it to the project''s website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Servlet核心包 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!--JSP -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>maven02</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>8080</port>
<path>/</path>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
点击输入 mvn tomcat7:run
ok!!!
你 ** 的终于出来了!
原文出处:https://www.cnblogs.com/july7/p/11632004.html
Error running Tomcat8: Address localhost:1099 is already in use(IDEA 错误)
Error running Tomcat8: Address localhost:1099 is already in use(IDEA 错误)
有时候运行 web 项目的时候会遇到 Error running Tomcat8: Address localhost:1099 is already in use 的错误,导致 web 项目无法运行。
这明显是 1099 端口已经被占用,解决办法如下:
第一步,命令提示符号,执行命令:netstat –ano 或者 netstat -ano|findstr 1099
可见,占用 1099 端口的进程的 PID 是 6368。
第二步,命令提示符号,执行命令:tasklist
可见,该占用 1099 端口的进程是 java.exe
第三步,通过任务管理器 -> 详细信息,终止进程 java.exe
我们会看到开启了多个 java.exe, 找到 1099 对应的进程给它结束掉。
第四步,重新启动 tomcat,即可正常启动
今天关于mac Intellij Idea Tmocat 启动报 Error running Tomcat: /conf/Catalina和ideatomcat启动报错的介绍到此结束,谢谢您的阅读,有关Centos 中 tomcat 关闭报错,Could not contact localhost:8005. Tomcat may not be running、com.intellij.openapi.application.impl.LaterInvocator的实例源码、Error running ''tomcat:run'' Cannot run program..CreateProcess error=2, 系统找不到指定的文件、Error running Tomcat8: Address localhost:1099 is already in use(IDEA 错误)等更多相关知识的信息可以在本站进行查询。
本文标签: