2013-05-11 2 views
3

Editor TopComponent를 구현했습니다. 어떤 이유로 문서를 저장할 때 오류가 발생합니다. 아래는 오류입니다. 이 예외로 어디에서 시작해야할지 모르겠습니다. 당신이 아는 것을 나눌 수 있습니까? 감사합니다Netbeans save hangs

java.lang.IllegalArgumentException: Self-causation not permitted 
    at java.lang.Throwable.initCause(Throwable.java:458) 
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport.addStack(MutualExclusionSupport.java:122) 
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport.addStack(MutualExclusionSupport.java:109) 
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport.addResource(MutualExclusionSupport.java:98) 
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getOutputStream(FileObj.java:127) 
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getOutputStream(FileObj.java:102) 
    at org.openide.text.DataEditorSupport$Env.outputStream(DataEditorSupport.java:891) 
    at org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:1172) 
    at org.openide.text.DataEditorSupport.superSaveDoc(DataEditorSupport.java:602) 
    at org.openide.text.DataEditorSupport$SaveImpl.run(DataEditorSupport.java:1315) 
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127) 
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:609) 
    at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:415) 
    at org.openide.text.DataEditorSupport.saveDocument(DataEditorSupport.java:598) 
    at org.netbeans.modules.openide.loaders.SimpleES$SaveCookieImpl.save(SimpleES.java:226) 
    at org.openide.actions.SaveAction.performAction(SaveAction.java:132) 
    at org.openide.actions.SaveAction.performAction(SaveAction.java:102) 
    at org.openide.actions.SaveAction$Delegate.actionPerformed(SaveAction.java:249) 
    at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:231) 
    at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:257) 
    at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109) 
    at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93) 
    at org.openide.util.actions.ActionInvoker$ActionRunnable.actionPerformed(ActionInvoker.java:162) 
    at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:109) 
    at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:60) 
    at org.openide.util.actions.ActionInvoker$ActionRunnable.doRun(ActionInvoker.java:153) 
    at org.openide.util.actions.ActionInvoker$2.run(ActionInvoker.java:110) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044) 
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to 
    at org.openide.util.RequestProcessor.post(RequestProcessor.java:424) 
    at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:114) 
    at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99) 
    at org.openide.awt.GeneralAction$BaseDelAction.actionPerformed(GeneralAction.java:234) 
    at org.openide.windows.TopComponent.processKeyBinding(TopComponent.java:1176) 
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2940) 
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2842) 
    at java.awt.Component.processEvent(Component.java:6282) 
    at java.awt.Container.processEvent(Container.java:2229) 
    at java.awt.Component.dispatchEventImpl(Component.java:4861) 
    at java.awt.Container.dispatchEventImpl(Container.java:2287) 
    at java.awt.Component.dispatchEvent(Component.java:4687) 
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1895) 
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:762) 
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1027) 
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:899) 
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:727) 
    at java.awt.Component.dispatchEventImpl(Component.java:4731) 
    at java.awt.Container.dispatchEventImpl(Container.java:2287) 
    at java.awt.Window.dispatchEventImpl(Window.java:2719) 
    at java.awt.Component.dispatchEvent(Component.java:4687) 
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723) 
    at java.awt.EventQueue.access$200(EventQueue.java:103) 
    at java.awt.EventQueue$3.run(EventQueue.java:682) 
    at java.awt.EventQueue$3.run(EventQueue.java:680) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) 
    at java.awt.EventQueue$4.run(EventQueue.java:696) 
    at java.awt.EventQueue$4.run(EventQueue.java:694) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) 
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:693) 
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159) 
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) 
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) 
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) 
[catch] at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) 

EDIT 1

나는 데이터 객체 및 구성된 새로운 MIME 타입 text/x-puml을 가지고 VisualElement 서브 클래스가 있습니다. 이걸 다시 text/plain으로 변경하면 일이 시작됩니다. text/plain을 검색하여 text/x-puml으로 변경하는 것을 놓친 경우 아무 것도 찾을 수 없습니다. MIME 유형을 text/x-puml으로 변경해야하는 다른 사항이 있습니까? 2

편집은 산발적으로 지금 일이 보이지만 못하는 것보다 더 자주 발생합니다. 커스텀 마임 타입을 가지고 있다면 내 SaveCookie 또는 Savable을 구현해야합니까?

+0

작성하거나 편집 한 클래스가 스택 트레이스의 어느 라인에 포함되어 있습니까? –

+0

그건 웃기는 부분이고, 내 코드를 말하는 라인이 없습니다. 그러나 나는 지금이 문제를 일으키는 것을 발견했다. 새로운 mime-type을'text/x-puml'으로 등록했는데, 문제가 사라지면'text/plain'으로 변경했습니다. 어떤 구성이 누락되었는지 알 수 있습니까? – ShaggyInjun

+0

NetBeans에서 사용자 정의 MIME 유형을 사용하지 않아 사용자를 도울 수 없습니다. –

답변

1

세마포어 문제처럼 나를 찾습니다.

이 파일에 단독 잠금이 있기 때문에 시스템에서 파일을 저장할 수 없습니다. 다른 독점 잠금 (저장에 필요)은 불가능합니다.

파일 처리를 살펴보십시오. 어딘가에 자물쇠가 있어야합니다.

0

이름 바꾸기로 인해 비슷한 오류가 발생했으며 이는 파일 잠금 때문이었습니다.

WindowManager.getDefault().invokeWhenUIReady(new Runnable() 
{ 
    @Override 
    public void run() 
    { 
     if (obj.getDomainModel() != null) 
     { 
      String newName = obj.getDomainModel().getName(); 
      FileObject primaryFile = obj.getPrimaryFile(); 
      try 
      { 
       primaryFile.rename(primaryFile.lock(), newName, primaryFile.getExt()); 
       callback.updateTitle(newName); 
      } 
      catch (IOException ex) 
      { 
       String message = String.format("The model couldn´t be renamed to \"%s\"", newName); 

       LOG.warning(message); 
      } 
     } 
    } 
}); 

파일이나 모두 어떤 경우 저장을 위해 그것을 사용 그래서 file's가 primaryFile.lock()에 함께 잠금 사용.

+1

나는 내 문제와 같은 문제가 있었지만 저장하는 대신 이름을 바꾸는 문제가있었습니다. 그러나 동일한 문제 : 이전에 열린 파일의 잠금. – EliuX

+0

죄송합니다. 답변을 잘못 읽었습니다. downvote를 제거했습니다. 정정 해 주셔서 감사합니다. – user2290362

+0

수정 해 주셔서 감사합니다. – EliuX