Glassfish 4.1 glassfish工具Eclipse Luna部署错误

时间:2014-10-22 21:53:05

标签: eclipse-luna glassfish-4.1

我最近升级了,即全新安装了Eclipse Luna和Glassfish 4.1。这两个应用程序都是最新的。 部署Java EE应用程序是通过Eclipse失败的,如果我通过Glassfish-admin-console进行标准部署就可以了。 错误日志是:

GlassFish: Error getting URL for WebResource[module=Module[TachionServer,org.eclipse.jst.jee.server:TachionServer], path=]

栈跟踪:

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.AbstractGlassfishServer.getModuleRootURL(AbstractGlassfishServer.java:883)
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:1209)
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)
at org.eclipse.wst.server.ui.internal.wizard.TaskWizard.performFinish(TaskWizard.java:167)
at org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate.run(RunOnServerActionDelegate.java:335)
at org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate.run(RunOnServerActionDelegate.java:764)
at org.eclipse.wst.server.ui.internal.ServerLaunchShortcut.launch(ServerLaunchShortcut.java:41)

1 个答案:

答案 0 :(得分:0)

与此同时,我找到了解决方案: 在最新版本的GlassFish-Tools for Eclipse中,似乎有必要创建一个WEB-INF / glassfish-web.xml,例如:

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

<!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>