History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25161
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Peter Gromov
Reporter: Yann Cébron
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

NPE in SpringBeanCacher$2.run when running unit tests

Created: 26 Feb 08 00:37   Updated: 13 Mar 08 21:28
Component/s: J2EE.Spring
Fix Version/s: Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File springbug.patch (21 kb)


Build: 7,718
Fixed in build: 7,759


 Description  « Hide
Spring plugin is optional dependency and spring-plugin.jar is added to IDEA JDK
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -Didea.load.plugins.id=com.intellij.struts2
 -Xbootclasspath/p:/Applications/Selena-7718.app/lib/boot.jar -Didea.home.path=/Users/yann/Library/Caches/IntelliJIDEA70/plugins-sandbox/test 
-Didea.plugins.path=/Users/yann/Library/Caches/IntelliJIDEA70/plugins-sandbox/plugins -Dfile.encoding=MacRoman -classpath 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/tools.jar:/Applications/Selena-7718.app/lib/resources.jar:/Applications/Selena-7718.app/lib/idea.jar:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/deploy.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/dt.jar:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/javaws.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/jce.jar:/
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/plugin.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/sa-jdi.jar:/
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/charsets.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/
classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/
jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/jconsole.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/
jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/ui.jar:/
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/dnsns.jar:/
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunjce_provider.jar:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar:/Applications/Selena-7718.app/lib/alloy.jar:/Applications/Selena-7718.app/lib/annotations.jar
:/Applications/Selena-7718.app/lib/asm-commons.jar:/Applications/Selena-7718.app/lib/asm.jar:/Applications/Selena-7718.app/lib/boot.jar:/Applications/Selena-7718.app/lib/bootstrap.jar:
/Applications/Selena-7718.app/lib/cglib-nodep-2.1_3.jar:/Applications/Selena-7718.app/lib/commons-codec-1.3.jar:/Applications/Selena-7718.app/lib/commons-collections.jar:
/Applications/Selena-7718.app/lib/emma-agent.jar:/Applications/Selena-7718.app/lib/emma.jar:/Applications/Selena-7718.app/lib/extensions.jar:
/Applications/Selena-7718.app/lib/forms_rt.jar:/Applications/Selena-7718.app/lib/icons.jar:/Applications/Selena-7718.app/lib/j2ee.jar:/Applications/Selena-7718.app/lib/jasper2_rt.jar:/
Applications/Selena-7718.app/lib/javac2.jar:/Applications/Selena-7718.app/lib/javaee.jar:/Applications/Selena-7718.app/lib/jaxen.jar:/Applications/Selena-7718.app/lib/jdom.jar:/
Applications/Selena-7718.app/lib/jgoodies-forms.jar:/Applications/Selena-7718.app/lib/jh.jar:/Applications/Selena-7718.app/lib/jna-utils.jar:/Applications/Selena-7718.app/lib/jna.jar:/
Applications/Selena-7718.app/lib/JNIWrap.jar:/Applications/Selena-7718.app/lib/jsf-api.jar:/Applications/Selena-7718.app/lib/jsp-api.jar:/Applications/Selena-7718.app/lib/junit-4.4.jar
:/Applications/Selena-7718.app/lib/junit.jar:/Applications/Selena-7718.app/lib/log4j.jar:/Applications/Selena-7718.app/lib/microba.jar:/Applications/Selena-7718.app/lib/
nanoxml-2.2.3.jar:/Applications/Selena-7718.app/lib/openapi.jar:/Applications/Selena-7718.app/lib/org.eclipse.jdt.core.jar:/Applications/Selena-7718.app/lib/oromatcher
.jar:/Applications/Selena-7718.app/lib/picocontainer.jar:/Applications/Selena-7718.app/lib/quaqua.jar:/Applications/Selena-7718.app/lib/resolver.jar:/Applications/Selena-7
718.app/lib/resources_en.jar:/Applications/Selena-7718.app/lib/saxpath.jar:/Applications/Selena-7718.app/lib/servlet-api.jar:/Applications/Selena-7718.app/lib/trove4j.jar:/Ap
plications/Selena-7718.app/lib/trove4j_src.jar:/Applications/Selena-7718.app/lib/velocity.jar:/Applications/Selena-7718.app/lib/xerces.jar:/Applications/Selena-7718.app/lib/x
ml-apis.jar:/Applications/Selena-7718.app/lib/xmlrpc-2.0.jar:/Applications/Selena-7718.app/lib/xpp3-1.1.3.4d_b4_min.jar:/Applications/Selena-7718.app/lib/xstream.jar:/Appli
cations/Selena-7718.app/lib/yjp-controller-api-redist.jar:/Applications/Selena-7718.app/plugins/JavaEE/lib/javaee-openapi.jar:/Applications/Selena-7718.app/plugins/JavaEE
/lib/resources_en.jar:/Applications/Selena-7718.app/plugins/JSF/lib/jsf-openapi.jar:/Applications/Selena-7718.app/plugins/JSF/lib/resources_en.jar:/Applications/Selena-771
8.app/plugins/JavaEE/lib/javaee-impl.jar:/Applications/Selena-7718.app/plugins/Spring/lib/spring.jar:/Applications/Selena-7718.app/plugins/Spring/lib/spring-web.jar:/Applicat
ions/Selena-7718.app/plugins/aop-common/lib/aop-common.jar:/Users/yann/Documents/Projekte/s2plugin_svn/project/out/test/struts2-plugin:/Users/yann/Documents/Projekte
/s2plugin_svn/project/out/production/struts2-plugin:/Users/yann/Documents/Projekte/s2plugin_svn/project/plugin/lib/errorReporter.jar:/Users/yann/Documents/Projekte/s2plugi
n_svn/project/out/test/struts2-dom-api:/Users/yann/Documents/Projekte/s2plugin_svn/project/out/production/struts2-dom-api:/Applications/Selena-7718.app/lib/idea_rt.jar com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 com.intellij.struts2.dom.struts.StrutsHighlightingTestCase
ERROR: 
java.lang.NullPointerException
	at com.intellij.spring.SpringBeanCacher$2.run(SpringBeanCacher.java:59)
	at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:271)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:5)
	at com.intellij.spring.SpringBeanCacher.cacheSpringBeans(SpringBeanCacher.java:55)
	at com.intellij.spring.SpringProjectComponent$4.run(SpringProjectComponent.java:102)
	at com.intellij.ide.startup.impl.StartupManagerImpl.a(StartupManagerImpl.java:15)
	at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.java:10)
	at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.setUpProject(HeavyIdeaTestFixtureImpl.java:58)
	at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.setUp(HeavyIdeaTestFixtureImpl.java:62)
	at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:73)
	at com.intellij.struts2.BasicHighlightingTestCase.setUp(BasicHighlightingTestCase.java:74)
	at junit.framework.TestCase.runBare(TestCase.java:132)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.textui.TestRunner.doRun(TestRunner.java:116)
	at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
	at junit.textui.TestRunner.doRun(TestRunner.java:109)
	at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)


 All   Comments   Work Log   Change History      Sort Order:
Peter Gromov - 26 Feb 08 20:58
Can you see what the problem is? Is SpringManager.getInstance() null?

Yann Cébron - 26 Feb 08 21:12
I don't get StrutsManager.getInstance() running, not even in setup()

here's my plugin.xml

<?xml version="1.0" encoding="UTF-8"?>

<!--<!DOCTYPE idea-plugin PUBLIC "Plugin/DTD" "http://plugins.intellij.net/plugin.dtd">-->

<idea-plugin url="http://www.jetbrains.net/confluence/display/CONTEST/Struts2Plugin" version="2">
  <id>com.intellij.struts2</id>
  <name>Struts 2</name>
  <description>
    <![CDATA[
  Provides full integration of <a href="http://struts.apache.org/2.x/index.html">Struts 2</a>.
  ]]>
  </description>

  <change-notes>
    <![CDATA[
  Please see <a href="http://www.jetbrains.net/confluence/display/CONTEST/Struts2PluginChangeNotes">Struts2PluginChangeNotes</a>.
  ]]>
  </change-notes>

  <version>0.38</version>

  <!-- required dependencies -->
  <depends>com.intellij.javaee</depends>

  <!-- optional dependencies -->
  <depends optional="true" config-file="struts2-javascript.xml">JavaScript</depends>
  <depends optional="true" config-file="struts2-spring.xml">com.intellij.spring</depends>

  <vendor email="yann.cebron@googlemail.com"
          url="http://www.lineas.de/lineas-informationstechnik/"
          logo="/resources/icons/lineas.png">LINEAS Informationstechnik GmbH
  </vendor>

  <idea-version since-build="7590" until-build="7999"/>
[...]

optional struts2-spring.xml just loads extension point impls from my plugin


Yann Cébron - 26 Feb 08 21:13
I missed some part of the stracktrace, this one follows up:
java.lang.AssertionError: 
	at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:49)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:60)
	at com.intellij.ide.startup.impl.StartupManagerImpl.a(StartupManagerImpl.java:34)
	at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.java:10)
	at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.setUpProject(HeavyIdeaTestFixtureImpl.java:58)
	at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.setUp(HeavyIdeaTestFixtureImpl.java:62)
	at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:73)
	at com.intellij.struts2.BasicHighlightingTestCase.setUp(BasicHighlightingTestCase.java:75)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)

Peter Gromov - 27 Feb 08 18:12
I've checkouted Struts2, and all tests run just fine

Yann Cébron - 27 Feb 08 18:15
because it's not checked in yet I will attach the changes later to this JIRA as patch

Yann Cébron - 27 Feb 08 21:05
please apply this patch to current trunk to reproduce the bug

Yann Cébron - 01 Mar 08 18:41
patch is obsolete now, just check against current trunk: StrutsHighlightingTestCase

btw it was a funny experience to bypass PsiClass resolve checking in DOM-model


Peter Gromov - 03 Mar 08 14:51
Do you mean shouldCheckResolveProblems()?

Yann Cébron - 03 Mar 08 18:06
exactly

Peter Gromov - 03 Mar 08 18:09
If you have any ideas that could make API better, you're welcome

Yann Cébron - 03 Mar 08 18:14
I will think about improvement possibilities, right now I'm mostly interested in getting my tests up and running since this issue is holding up a release of S2 plugin

Peter Gromov - 03 Mar 08 18:35
The fix will be included in first 7.0.4 EAP