[
https://issues.jboss.org/browse/JBIDE-10884?page=com.atlassian.jira.plugi...
]
Rob Stryker commented on JBIDE-10884:
-------------------------------------
I am completely incapable of tracking this down or even reproducing it. There are only
two entry points to addQuery(xpath), and only one entry point to
loadDefaultPortQueries(etc). (The other entry to addQuery is from the servers view after
the server is created and so does not apply here).
In the loadDefaultPortQueries entrypoint, a category is created WITH a server initially.
This server will always be non-null because it's ONLY entry point is from a
serverAdded() call from the server tools framework. So a category is created here,
it's server is set, and the default ports for the category are set. After it creates
each query, it adds it to the category. It then goes to setEffectiveBaseDir, and on line
119 we see the following:
dir = getCategory().getServer().getRuntime().getLocation().append(dir);
The only ways to get an error here are if category is null (impossible), it's server
is null (also impossible), the runtime is null (not possible for as71 servers as the
wizard sets it), the runtime's location is null (not possible), or "dir" is
null, which is not possible since the line directly before it has a null check on that
line.
Furthermore, this error, IF it could occur, would occur at the moment you finish making
the server and runtime objects. You would never need to finish a new dynamic web project
wizard to enter this code,ever. This code is only entered the moment a new IServer is
created, which is before you even finish the first page of teh dynamic web project
wizard.
I really can see absolutely no way this can happen. With only one entry point to this
code, everything seems in order already. I have no idea how people are getting this bug.
There are null checks everywhere.
NPE while creating dynamic web project and AS7.1 server
-------------------------------------------------------
Key: JBIDE-10884
URL:
https://issues.jboss.org/browse/JBIDE-10884
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: JBossAS/Servers
Affects Versions: 3.3.0.Beta1
Environment: JBT nightly, new workspace, L64
Reporter: Jiri Peterka
Assignee: Rob Stryker
Fix For: 3.3.0.Beta1
java.lang.NullPointerException
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery.setEffectiveBaseDir(XPathQuery.java:119)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery.setCategory(XPathQuery.java:248)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory.addQuery(XPathCategory.java:75)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel.addQueriesToCategoryFromDefaultFile(XPathModel.java:326)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel.loadDefaultPortQueries(XPathModel.java:299)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel.handleAddJBossXPaths(XPathModel.java:93)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel.access$1(XPathModel.java:92)
at
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel$1.run(XPathModel.java:79)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira