MyEclipse 10 部署项目时报错,抛出java.lang.NullPointerException异常的解决方法

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/dingding_12345/article/details/47373721

在部署项目时,点击deploy,无反应。查看错误,抛出的是空指针指针异常,如下:

java.lang.NullPointerException    

at com.genuitec.eclipse.ast.deploy.core.Deployment.<init>(Unknown So...)

...

经查询,终于解决问题,把方法呈上。

1、进入到工作空间,找到/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.ast.deploy.core.prefs

这个文件,并删除。

2、重新打开MyEclipse,部署。


-----------------------------------------------------------------------------------------------------------------------

补充:如果你不知道自己的工作空间,可这么查看:

1、重新打开MyEclipse,出现如下(里面显示的就是工作区间)

2、 打开MyEclipse,   找到   file--->Switch Workspace-->other

就可以看到当前的工作空间,也可以改变工作空间。



建议:如果要删除工作空间里面的文件时、不要彻底删除(shift+Delete),防止误删后,在垃圾箱都找不到。

我的做法是把该文件注释掉,做好备份,以后如果还需要,可以再使用。

展开阅读全文

部署项目MyEclipse报错 java.lang.NullPointerException

08-13

我在部署一个J2EE项目到tomcat6.X的时候MyEclipse报错,rn消息:在“Add Deployment”期间发生了内部错误。rn异常堆栈追踪:java.lang.NullPointerExceptionrn at com.genuitec.eclipse.ast.deploy.core.packaging.WarPackager.ā(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.packaging.WarPackager.getWarDependencyProjects(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.packaging.DefaultPackagerStrategy.getLibraryProjects(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.packaging.DefaultPackagerStrategy.getProjectDependencies(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.packaging.DefaultPackagerStrategy.explodeDependentProjects(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.packaging.PackageUtils.explodeDependentProjects(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.WebDeployment.Ć(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.WebDeployment.doProjectTypeSpecificPostResyncAll(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.Deployment.resyncAll(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.ModuleDeployment.deployAsExplodedArchive(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.Deployment.deploy(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.jobs.A.ā(Unknown Source)rn at com.genuitec.eclipse.ast.deploy.core.jobs.A.run(Unknown Source)rn at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)rn会话数据:eclipse.buildId=unknownrnjava.version=1.6.0_13rnjava.vendor=Sun Microsystems Inc.rnBootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CNrnCommand-line arguments: -os win32 -ws win32 -arch x86rnrn请大家帮我看看问题出在哪里了,感谢!rn 论坛

JSF抛出java.lang.NullPointerException异常

06-13

最近看了JSF感觉不错,我自己的机子只装了Tomcat5rn在Tomcat5下跑起来没有问题,所以我在项目里也采用了JSFrn现在要移植到websphere5下去,怎么也不成功!rn出现下面错误:rn[05-6-13 13:24:54:969 CST] 5176e99f WebGroup E SRVE0026E: [Servlet 错误]-[Faces Servlet]:java.lang.NullPointerExceptionrn at javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)rn at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)rn at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)rn at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)rn at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)rn at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:175)rn at javax.servlet.GenericServlet.init(GenericServlet.java:258)rn at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:761)rn at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:257)rn at com.ibm.ws.webcontainer.webapp.WebAppServletManager.getServletReference(WebAppServletManager.java:382)rn at com.ibm.ws.webcontainer.webapp.WebApp.getServletReference(WebApp.java:589)rn at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcherInfo.calculateInfo(WebAppRequestDispatcherInfo.java:177)rn at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcherInfo.(WebAppRequestDispatcherInfo.java:59)rn at com.ibm.ws.webcontainer.webapp.WebApp.getRequestDispatcher(WebApp.java:1415)rn at com.ibm.ws.webcontainer.webapp.WebApp.getRequestDispatcher(WebApp.java:1376)rn at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:196)rn at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)rn at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)rn at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)rn at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)rn at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)rn at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)rn at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))rnrn到网上找了好多资料说在web.xml中加侦听器:rn rn com.sun.faces.config.ConfigureListenerrn rn结果还是一样的错误!!rn 论坛

为什么客户端调用抛出java.lang.NullPointerException异常

02-07

我用axis即时发布了一个简单的webservice,代码是:rnpublic class CalcService rn public int add(int p1, int p2) rn return p1 + p2;rn rn public int subtract(int p1, int p2) rn return p1 - p2;rn rnrn输入http://localhost:8080/axis/CalcService.jws?WSDL后能正常看见内容:rn rn- rn- rn rn rn- rn rn rn rn- rn rn rn rn- rn rn rn- rn- rn rn rn rn- rn rn rn rn rn- rn rn- rn rn- rn rn rn- rn rn rn rn- rn rn- rn rn rn- rn rn rn rn rn- rn- rn rn rn rn rn但是我在客户端调用时,执行到invoke时就抛出NullPointerException异常,不能调用,我的客户端程序是:rnimport java.util.Vector;rnimport org.apache.axis.client.Call; rnimport org.apache.axis.client.Service;rnimport org.apache.axis.encoding.XMLType;rnimport org.apache.soap.rpc.Response; rn rnimport javax.xml.rpc.ParameterMode; rnrnpublic class TestClient rn public static void main(String [] args) rn tryrn String endpoint = "http://localhost:8080/axis/CalcService.jws";rn Service service = new Service();rn Call call = (Call)service.createCall();rn call.setTargetEndpointAddress( new java.net.URL(endpoint) );rn int i=1;rn int j=9;rn call.setOperationName( "add" );rn call.addParameter("p1",XMLType.XSD_INT,ParameterMode.IN);rn call.addParameter("p2",XMLType.XSD_INT,ParameterMode.IN);rn call.setReturnType( XMLType.XSD_INT);rn Object object = ( call.invoke( new Object[] i,j ));rn catch(Exception e)rn System.err.println(e.toString());rn rn rn rn小弟跪求高手指点。 论坛

程序抛出 java.lang.NullPointerException 请教!!!

02-10

package newpackage;rnrnimport javax.microedition.midlet.*;rnimport javax.microedition.lcdui.*;rnrn/**rn *rn * @author kl0rn * @versionrn */rnpublic class MyCartoonMidlet extends MIDlet rn public MainCanvas m_MainCanvas;rn public MyCartoonMidlet()rn super();rn rn public void startApp() throws MIDletStateChangeException rn m_MainCanvas=new MainCanvas();rn Display.getDisplay(this).setCurrent(m_MainCanvas);rn while(true)rn m_MainCanvas.repaint();rn rn rn rn public void pauseApp() rn rn rn public void destroyApp(boolean unconditional) throws MIDletStateChangeExceptionrn rnrnrnrnpackage newpackage;rnrnimport java.io.IOException;rnimport javax.microedition.lcdui.Canvas;rnimport javax.microedition.lcdui.Graphics;rnimport javax.microedition.lcdui.Image;rnrn/**rn *rn * @author kl0rn */rnpublic class MainCanvas extends Canvasrn public Image m_Image;rn rn /** Creates a new instance of MainCarvas */rn public MainCanvas() rn try rn m_Image=Image.createImage("/IM.png");rn catch (IOException e) rn rn rn rnrn protected void paint(Graphics graphics) rn graphics.drawImage(m_Image,0,0,Graphics.TOP|Graphics.LEFT);rn rn rnrnrnrn/*运行的时候就rnjava.lang.NullPointerException: rn at newpackage.MainCanvas.paint(MainCanvas.java:34)rn at javax.microedition.lcdui.Canvas.callPaint(Canvas.java:1063)rn at javax.microedition.lcdui.Display.repaint(Display.java:1435)rn at javax.microedition.lcdui.Display$DisplayAccessor.repaint(Display.java:2165)rn at javax.microedition.lcdui.Display$DisplayManagerImpl.repaint(Display.java:2912)rn at com.sun.midp.lcdui.DefaultEventHandler.repaintScreenEvent(DefaultEventHandler.java:398)rn at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(DefaultEventHandler.java:728)rnrn高手帮看下,怎样解决!!!*/rnrn 论坛

MyEclipse:IDE:Maven4MyEclipse异常java.lang.NullPointerException

01-28

[size=16px]我装了 MyEclipse 9.1rn创建 Maven web 工程时报错,如下:[/size]rn rn[img=http://hi.csdn.net/attachment/201201/28/0_13277199698ql9.gif][/img]rnrn[size=16px]!ENTRY org.eclipse.core.jobs 4 2 2012-01-27 20:54:06.750rn!MESSAGE An internal error occurred during: "Creating project "StudyMavenWeb"".rn!STACK 0rnjava.lang.NullPointerException[/size]rn[size=14px] at com.genuitec.eclipse.maven.project.MyEclipseProjectSupport.findWebRoot(MyEclipseProjectSupport.java:204)rn at com.genuitec.eclipse.maven.project.MyEclipseProjectSupport.configureWebProject(MyEclipseProjectSupport.java:71)rn at com.genuitec.eclipse.maven.project.MyEclipseProjectSupport.configure(MyEclipseProjectSupport.java:57)rn at org.maven.ide.eclipse.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:57)rn at org.maven.ide.eclipse.internal.project.GenericLifecycleMapping.configure(GenericLifecycleMapping.java:48)rn at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:332)rn at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.configureNewMavenProject(ProjectConfigurationManager.java:267)rn at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.enableMavenNature(ProjectConfigurationManager.java:343)rn at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.createSimpleProject(ProjectConfigurationManager.java:439)rn at org.maven.ide.eclipse.wizards.MavenProjectWizard$4.runInWorkspace(MavenProjectWizard.java:255)rn at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)rn at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) [/size] 论坛

myEclipse 打不开struts-config.xml 报java.lang.NullPointerException 异常

09-15

myEclipse 打不开struts-config.xml 报java.lang.NullPointerException 异常rnrnrn提示错误信息:Could not open the editor: An unexpected exception was thrown.rnjava.lang.NullPointerExceptionrn at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.processAction(StrutsConfigDiagram.java:574)rn at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.synchronizeDiagram(StrutsConfigDiagram.java:479)rn at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.differedSynchronize(StrutsConfigDiagram.java:120)rn at com.genuitec.eclipse.struts.editor.multipage.StrutsConfigEditor.createPages(StrutsConfigEditor.java:296)rn at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357)rn at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)rn at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)rn at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)rn at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)rn at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)rn at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)rn at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)rn at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)rn at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)rn at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)rn at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608)rn at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)rn at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)rn at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)rn at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)。。。。。。。。。。。rnrnrn高手进来看看啊! rn 论坛

没有更多推荐了,返回首页