This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271097 - NullPointerException at java.net.URL.<init>
Summary: NullPointerException at java.net.URL.<init>
Status: NEW
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-14 10:08 UTC by jfelfouly
Modified: 2017-11-19 17:26 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 229720


Attachments
stacktrace (2.55 KB, text/plain)
2017-07-14 10:08 UTC, jfelfouly
Details
stacktrace (2.55 KB, text/plain)
2017-07-14 10:25 UTC, jfelfouly
Details
stacktrace (2.55 KB, text/plain)
2017-07-24 21:34 UTC, jfelfouly
Details
stacktrace (2.55 KB, text/plain)
2017-09-23 18:38 UTC, MackSix
Details
stacktrace (2.55 KB, text/plain)
2017-10-22 07:02 UTC, eduarddrenth
Details
stacktrace (2.55 KB, text/plain)
2017-11-08 21:43 UTC, dtrebbien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jfelfouly 2017-07-14 10:08:01 UTC
Build: NetBeans IDE Dev (Build 20170624-unknown-revn)
VM: Java HotSpot(TM) Client VM, 25.111-b14, Java(TM) SE Runtime Environment, 1.8.0_111-b14
OS: Windows 7

User Comments:
jfelfouly: The problem occured when pasting a <dependency> stanza (copied from spring.io) inside <dependencies> in a POM.

This appeared in Output - Retriever Output window:

14 juil. 2017 12:01:20 : Retrieving Location: http://maven.apache.org/xsd/maven-4.0.0.xsd 

	Retrieved :    http://maven.apache.org/xsd/maven-4.0.0.xsd 
	Saved at: D:\java\netbeans-9\netbeans-donation-review\nbbuild\testuserdir\var\cache\mavencachedirs\938109952\retriever\maven.apache.org\xsd\maven-4.0.0.xsd




Stacktrace: 
java.lang.NullPointerException
   at java.net.URL.<init>(URL.java:532)
   at java.net.URL.<init>(URL.java:490)
   at java.net.URL.<init>(URL.java:439)
   at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:620)
   at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:805)
Comment 1 jfelfouly 2017-07-14 10:08:03 UTC
Created attachment 164769 [details]
stacktrace
Comment 2 jfelfouly 2017-07-14 10:25:46 UTC
Created attachment 164770 [details]
stacktrace

Mistyping and retyping a > at the end of </dependencies>
Comment 3 jfelfouly 2017-07-14 17:16:49 UTC
Second stack trace was generated a few minutes later while editing the same POM.
Comment 4 jfelfouly 2017-07-24 21:34:52 UTC
Created attachment 164825 [details]
stacktrace

Trying to manually add a <version> to spring-cloud-starter-aws.
It seems the problem occurred while typing the closing > of the version tag.
Comment 5 MackSix 2017-09-23 18:38:34 UTC
Created attachment 165164 [details]
stacktrace

Editing maven-assembly-plugin version in pom.
Comment 6 Exceptions Reporter 2017-09-23 18:38:41 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=229720
Comment 7 eduarddrenth 2017-10-22 07:02:55 UTC
Created attachment 165333 [details]
stacktrace

edit pom.xml trying to change version of dependency
Comment 8 dtrebbien 2017-11-08 21:43:56 UTC
Created attachment 165418 [details]
stacktrace

Editing a Maven POM, I started from this:
<?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>test</groupId>
    <artifactId>HintsTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    
</project>

.. and I had just typed '<dependencies', ending with this:
<?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
Comment 9 dtrebbien 2017-11-08 21:51:21 UTC
.. ending up with this:
<?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>test</groupId>
    <artifactId>HintsTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies
</project>

Debugging the problem, I found that getSchemaStream() at AbstractSchemaBasedGrammar.java:68 returned null. The getSchemaStream() implementation is within MavenProjectGrammar:
    @Override
    protected InputStream getSchemaStream() {
        return getClass().getResourceAsStream("/org/netbeans/modules/maven/grammar/maven-4.0.0.xsd"); //NOI18N
    }

The getResourceAsStream() call returned null.
Comment 10 phansson 2017-11-19 14:43:53 UTC
You say you use "Build: NetBeans IDE Dev (Build 20170624-unknown-revn)".

Is this by any chance NetBeans source code you've build yourself based on source code from Apache NetBeans (incubating). This would explain the problem.

If this is the case, then I think this is the wrong bug tracker. Apache's bug tracker (https://issues.apache.org/jira , project=NETBEANS) is probably more appropriate.
Comment 11 dtrebbien 2017-11-19 17:26:08 UTC
Yes, I was using a build of Apache NetBeans that I made myself.

Comment #8 was submitted automatically on my behalf by the built-in exception reporter.