0

I just opened the .log file in my .metadata folder of Eclipse. I see that my glassfish server has thrown a null pointer exception. I don't know why this happened. Can someone help me to figure it out and fix it ?

!ENTRY oracle.eclipse.tools.glassfish 
!MESSAGE GlassFish: Error getting URL for WebResource [module=Module[AffableBean,org.eclipse.jst.jee.server:AffableBean], path=]
!STACK 0
java.lang.NullPointerException
    at java.net.Parts.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at oracle.eclipse.tools.glassfish.GlassfishGenericServer.getModuleRootURL(GlassfishGenericServer.java:127)
    at oracle.eclipse.tools.glassfish.GlassfishLaunchableAdapterDelegate.getLaunchable(GlassfishLaunchableAdapterDelegate.java:55)
    at org.eclipse.wst.server.core.internal.LaunchableAdapter.getLaunchable(LaunchableAdapter.java:76)
    at org.eclipse.wst.server.ui.internal.ServerUIPlugin.getLaunchableAdapter(ServerUIPlugin.java:1095)
    at org.eclipse.wst.server.ui.internal.wizard.fragment.OptionalClientWizardFragment.updateClients(OptionalClientWizardFragment.java:65)
    at org.eclipse.wst.server.ui.internal.wizard.fragment.OptionalClientWizardFragment.getChildFragments(OptionalClientWizardFragment.java:113)
    at org.eclipse.wst.server.ui.internal.wizard.TaskWizard.addSubWizardFragments(TaskWizard.java:329)
    at org.eclipse.wst.server.ui.internal.wizard.TaskWizard.addSubWizardFragments(TaskWizard.java:333)
    at org.eclipse.wst.server.ui.internal.wizard.TaskWizard.getAllWizardFragments(TaskWizard.java:317)
MORE...............
james
  • 1,667
  • 5
  • 26
  • 38
  • Can you list the steps to reproduce it ? – NRJ Jul 15 '14 at 20:20
  • @Raj - I don't know how to reproduce it. I was running my sample dynamic web app. I just resolved one error by looking at the .log file. I only modified my own java package name to fix that error. The problem was that package name had a java. in it. Then, I got the new error in my post. – james Jul 15 '14 at 20:26

1 Answers1

0

I had the same problem and solved this by

adding a WEB-INF/glassfish-web.xml file, e.g.:

<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
    <context-root>/hello2</context-root>
</glassfish-web-app>