SpringManager ClassCastException

Hi,

I am trying to obtain the SpringManager using below line in-order to obtain the spring bean list of an XML file

final SpringManager instance = SpringManager.getInstance(this.project);

But I am keep getting below exception. I have added Spring.jar and Spring-api.jar into classpath and 

<depends>com.intellij.spring</depends>

line into plugin.xml file as well. How can I overcome this issue.

[ 21852] ERROR - llij.ide.plugins.PluginManager - com.intellij.spring.impl.SpringManagerImpl cannot be cast to com.intellij.spring.SpringManager
java.lang.ClassCastException: com.intellij.spring.impl.SpringManagerImpl cannot be cast to com.intellij.spring.SpringManager
at com.intellij.spring.SpringManager.getInstance(SpringManager.java:41)
at org.adroitlogic.tool.editor.UltraXMLPreviewEditor.selectNotify(UltraXMLPreviewEditor.java:106)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$14.run(FileEditorManagerImpl.java:956)
at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2426)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:876)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl3(FileEditorManagerImpl.java:810)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$11.run(FileEditorManagerImpl.java:790)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:787)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:728)
at com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.openFile(FileEditorManagerEx.java:151)
at com.intellij.codeInsight.navigation.NavigationUtil.a(NavigationUtil.java:200)
at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement(NavigationUtil.java:176)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:238)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:248)
at com.intellij.ide.projectView.impl.nodes.PsiFileNode.navigate(PsiFileNode.java:133)
at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:53)
at com.intellij.util.OpenSourceUtil.openSourcesFrom(OpenSourceUtil.java:31)
at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.processDoubleClick(EditSourceOnDoubleClickHandler.java:130)
at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.onDoubleClick(EditSourceOnDoubleClickHandler.java:122)
at com.intellij.ui.DoubleClickListener.onClick(DoubleClickListener.java:30)
at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:73)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6535)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:410)
at com.intellij.ide.dnd.aware.DnDAwareTree.processMouseEvent(DnDAwareTree.java:58)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.g(IdeEventQueue.java:857)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
[ 21857] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA (Minerva) IU-145.844.1 Build #IU-145.844.1
[ 21857] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_65
[ 21857] ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM
[ 21857] ERROR - llij.ide.plugins.PluginManager - Vendor: Oracle Corporation
[ 21857] ERROR - llij.ide.plugins.PluginManager - OS: Linux
[ 21857] ERROR - llij.ide.plugins.PluginManager - Last Action:

1 comment

You didn't add spring.jar to the IntelliJ SDK but to your module's classpath. Please see http://www.jetbrains.org/intellij/sdk/docs/reference_guide/frameworks_and_external_apis/spring_api.html first paragraph.

0

Please sign in to leave a comment.