java.lang.NullPointerException

Atlassian JIRA | Jonathan Nolen [Atlassian] | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The new WebDAV plugin contains a servlet filter module. In testing it, I tried to uninstall it. As soon as I did, all requests to Confluence started returning the error (attached.) {code} Dec 10, 2008 11:30:43 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet css threw exception java.lang.NullPointerException at java.util.AbstractCollection.addAll(AbstractCollection.java:316) at com.atlassian.plugin.servlet.util.DefaultPathMapper.getAll(DefaultPathMapper.java:139) at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:129) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:52) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:40) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:613) {code} I'm also attaching a build of the plugin, in case that helps diagnose the problem.

    Atlassian JIRA | 8 years ago | Jonathan Nolen [Atlassian]
    java.lang.NullPointerException
  2. 0

    The new WebDAV plugin contains a servlet filter module. In testing it, I tried to uninstall it. As soon as I did, all requests to Confluence started returning the error (attached.) {code} Dec 10, 2008 11:30:43 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet css threw exception java.lang.NullPointerException at java.util.AbstractCollection.addAll(AbstractCollection.java:316) at com.atlassian.plugin.servlet.util.DefaultPathMapper.getAll(DefaultPathMapper.java:139) at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:129) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:52) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:40) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:613) {code} I'm also attaching a build of the plugin, in case that helps diagnose the problem.

    Atlassian JIRA | 8 years ago | Jonathan Nolen [Atlassian]
    java.lang.NullPointerException
  3. 0

    Hi! The method *getOutput* in *JavaParserMutableClassOrInterfaceTypeDetails* adds null into *typeParameters* field when creates the constructors for a class: {code:title=JavaParserMutableClassOrInterfaceTypeDetails.java|borderStyle=solid} // Add constructors for (ConstructorMetadata candidate : cit.getDeclaredConstructors()) { JavaParserConstructorMetadata.addConstructor(compilationUnitServices, typeDeclaration.getMembers(), candidate, false, null); } {code} This throws a *NullPointerException* when you create a class with more than one constructor with the same *number* of input parameters: {noformat} java.lang.NullPointerException at java.util.AbstractCollection.addAll(AbstractCollection.java:316) at org.springframework.roo.classpath.javaparser.details.JavaParserConstructorMetadata.<init>(JavaParserConstructorMetadata.java:65) at org.springframework.roo.classpath.javaparser.details.JavaParserConstructorMetadata.addConstructor(JavaParserConstructorMetadata.java:249) at org.springframework.roo.classpath.javaparser.JavaParserMutableClassOrInterfaceTypeDetails.getOutput(JavaParserMutableClassOrInterfaceTypeDetails.java:516) at org.springframework.roo.classpath.javaparser.JavaParserMutableClassOrInterfaceTypeDetails.createType(JavaParserMutableClassOrInterfaceTypeDetails.java:532) at org.springframework.roo.classpath.javaparser.JavaParserMetadataProvider.createPhysicalType(JavaParserMetadataProvider.java:87) at org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:121) ... {noformat} This exception is launched when *JavaParserConstructorMetadata.addConstructor* method is checking if exists a constructor with the same parameter types in line 242: {code:title=JavaParserConstructorMetadata.java|borderStyle=solid} // Locate where to add this constructor; also verify if this method already exists for (BodyDeclaration bd : members) { if (bd instanceof ConstructorDeclaration) { // Next constructor should appear after this current constructor ConstructorDeclaration cd = (ConstructorDeclaration) bd; if (cd.getParameters().size() == d.getParameters().size()) { // Possible match, we need to consider parameter types as well now JavaParserConstructorMetadata jpmm = new JavaParserConstructorMetadata(constructor.getDeclaredByMetadataId(), cd, compilationUnitServices, typeParameters); boolean matchesFully = true; for (AnnotatedJavaType existingParameter : jpmm.getParameterTypes()) { if (!existingParameter.getJavaType().equals(constructor.getParameterTypes().get(index))) { matchesFully = false; break; } } if (matchesFully) { throw new IllegalStateException("Constructor '" + constructor.getParameterNames() + "' already exists with identical parameters"); } } } } {code} Thanks!

    Spring JIRA | 6 years ago | Ricardo García
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hi! The method *getOutput* in *JavaParserMutableClassOrInterfaceTypeDetails* adds null into *typeParameters* field when creates the constructors for a class: {code:title=JavaParserMutableClassOrInterfaceTypeDetails.java|borderStyle=solid} // Add constructors for (ConstructorMetadata candidate : cit.getDeclaredConstructors()) { JavaParserConstructorMetadata.addConstructor(compilationUnitServices, typeDeclaration.getMembers(), candidate, false, null); } {code} This throws a *NullPointerException* when you create a class with more than one constructor with the same *number* of input parameters: {noformat} java.lang.NullPointerException at java.util.AbstractCollection.addAll(AbstractCollection.java:316) at org.springframework.roo.classpath.javaparser.details.JavaParserConstructorMetadata.<init>(JavaParserConstructorMetadata.java:65) at org.springframework.roo.classpath.javaparser.details.JavaParserConstructorMetadata.addConstructor(JavaParserConstructorMetadata.java:249) at org.springframework.roo.classpath.javaparser.JavaParserMutableClassOrInterfaceTypeDetails.getOutput(JavaParserMutableClassOrInterfaceTypeDetails.java:516) at org.springframework.roo.classpath.javaparser.JavaParserMutableClassOrInterfaceTypeDetails.createType(JavaParserMutableClassOrInterfaceTypeDetails.java:532) at org.springframework.roo.classpath.javaparser.JavaParserMetadataProvider.createPhysicalType(JavaParserMetadataProvider.java:87) at org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:121) ... {noformat} This exception is launched when *JavaParserConstructorMetadata.addConstructor* method is checking if exists a constructor with the same parameter types in line 242: {code:title=JavaParserConstructorMetadata.java|borderStyle=solid} // Locate where to add this constructor; also verify if this method already exists for (BodyDeclaration bd : members) { if (bd instanceof ConstructorDeclaration) { // Next constructor should appear after this current constructor ConstructorDeclaration cd = (ConstructorDeclaration) bd; if (cd.getParameters().size() == d.getParameters().size()) { // Possible match, we need to consider parameter types as well now JavaParserConstructorMetadata jpmm = new JavaParserConstructorMetadata(constructor.getDeclaredByMetadataId(), cd, compilationUnitServices, typeParameters); boolean matchesFully = true; for (AnnotatedJavaType existingParameter : jpmm.getParameterTypes()) { if (!existingParameter.getJavaType().equals(constructor.getParameterTypes().get(index))) { matchesFully = false; break; } } if (matchesFully) { throw new IllegalStateException("Constructor '" + constructor.getParameterNames() + "' already exists with identical parameters"); } } } } {code} Thanks!

    Spring JIRA | 6 years ago | Ricardo García
    java.lang.NullPointerException

  1. tvrmsmith 1 times, last 3 days ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    No message provided

    at java.util.AbstractCollection.addAll()
  2. Java RT
    AbstractCollection.addAll
    1. java.util.AbstractCollection.addAll(AbstractCollection.java:316)
    1 frame
  3. com.atlassian.plugin
    ServletFilterModuleContainerFilter.doFilter
    1. com.atlassian.plugin.servlet.util.DefaultPathMapper.getAll(DefaultPathMapper.java:139)
    2. com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:129)
    3. com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:52)
    4. com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:40)
    4 frames
  4. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
    8 frames
  5. Grizzly HTTP
    JIoEndpoint$Worker.run
    1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
    3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    3 frames
  6. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:613)
    1 frame