Could not publish to the server. Tomcat 7.0 - eclipse

I am getting below error when trying to deploy war file on Tomcat 7.0.28 server. My Eclipse is Eclipse Java EE IDE for Web Developers.Version: Indigo Service Release 2 Build id: 20120216-1857. I would appreicate if anyone can provide a solution/fix? Is it related to version of eclipse or tomcat compatability? Thanks.
java.lang.NullPointerException
at java.io.FileInputStream.<init>(Unknown Source)
at org.eclipse.wst.server.core.util.PublishHelper.copyFile(PublishHelper.java:501)
at org.eclipse.wst.server.core.util.PublishHelper.publishDelta(PublishHelper.java:435)
at org.eclipse.wst.server.core.util.PublishHelper.publishDelta(PublishHelper.java:459)
at org.eclipse.wst.server.core.util.PublishHelper.publishDelta(PublishHelper.java:459)
at org.eclipse.jst.server.tomcat.core.internal.PublishOperation2.publishDir(PublishOperation2.java:141)
at org.eclipse.jst.server.tomcat.core.internal.PublishOperation2.execute(PublishOperation2.java:82)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.performTasks(ServerBehaviourDelegate.java:1290)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:933)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3087)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
eclipse.buildId=M20120208-0800
java.version=1.6.0_32
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

If you using Eclipse or Myeclipse IDE's, Clean all projects like Project --> Clean --> Clean all projects --> Ok. Now its working fine

Following this thread lead me to a solution http://www.eclipse.org/forums/index.php/m/526327/
It seems that the deployment config file for your application has become incorrect.
What happened for me is that if I modified my server options and unchecked "Serve modules without publishing" the server would start. With it check I got the error you mentioned.
For me the problem is that eclipse could not find my web.xml. My solution was that I had to go to my project settings and remove and add the reference to my webapp folder under Deployment Assembly. This brought up a dialog for the location of my deployment description. After Eclipse had that a restart got everything in order.

Seems to be a bug. Here is the workaround;
When adding a new server, do not add any web application to the server. Just add a server with no web module. After server was added, right click on server and "Add and Remove". This should now work.

had the same problem with Eclipse Neon 2 (4.6.2) and Tomcat 8.5. Workaround is working. Add a server, but do not add application to it. Then run application "Run on server" and it will start working. Also need to say that I deleted all Maven repository and restarted Eclipse. After restart Maven downloaded all dependencies. I did not like to delete repository, but it seems it is also important part for troubleshooting.

I faced the same issue. Just delete the server alone. Add the new server and projects into the server. Clean the tomcat work directory. Then start the server it will work fine

Related

EGit import in Eclipse showing a runtime error

I tried to make a really simple "hello world!" import using EGit in Eclipse. I have not found any evidence that the software is not working (no bug found in Google), so it looks I made something wrong which I do not know.
I followed the steps defined here: http://craigmart.in/2012/01/17/import-an-existing-git-repo-to-eclipse/
It crashes when connecting to GitHub.
Essentially this is what I am getting:
I have extracted the following information from the error log:
org.eclipse.core.runtime.CoreException: Connecting Git team provider failed. See log for details.
at org.eclipse.egit.core.op.ConnectProviderOperation.execute(ConnectProviderOperation.java:112)
at org.eclipse.egit.ui.internal.clone.GitImportWizard$8.run(GitImportWizard.java:289)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2262)
at org.eclipse.egit.ui.internal.clone.GitImportWizard.importProjects(GitImportWizard.java:296)
at org.eclipse.egit.ui.internal.clone.GitImportWizard.access$2(GitImportWizard.java:236)
at org.eclipse.egit.ui.internal.clone.GitImportWizard$4.run(GitImportWizard.java:206)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Contains: Error connecting project TEst2, no Git repositories found
eclipse.buildId=4.7.0.I20170612-0950
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_ES
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
Info:
Using pycharm and GitHub directory I have been able to use Git and connect to GitHub... it looks a problem with something I did on Eclipse, not a problem with my computer.
Does anybody know what I might have done wrong?
In the Import Projects from Git dialog the Use New project wizard option seems to be broken (see Eclipse bug 324145).
Workaround:
Probably, the problem occurred after the repository has been cloned (otherwise you have to clone the repository first). To import an existing local Git repository use File > Open Projects from File System... (instead of File > Import... > Git > Projects from Git). If the project is not an Eclipse project but contains .java files, the project will be configured automatically as a Java project. The local Git repository will also be detected and added automatically.
Thanks to #howlger answer
I visualized the solution

Eclispse Install software says "Can not complete the request"

I am using Eclipse Luna Service Release 1 (4.4.1)
When I try to install new software
It gives some error message like Cannot complete the request. This installation has not been configured properly for Software Updates.
And my error log says
eclipse.buildId=4.4.1.M20140925-0400
java.version=1.7.0_75
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IN
Framework arguments: -product org.eclipse.epp.package.standard.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.standard.product
org.eclipse.equinox.p2.ui.sdk
Warning
Mon May 11 14:35:07 IST 2015
Could not locate the running profile instance. The eclipse.p2.data.area and eclipse.p2.profile properties may not be set correctly in this application's config.ini file.
I came across similar problems in
How to enable Software Update in an Eclipse product?
and Getting the message "Cannot start the update ui..." when trying to run the update UI in Eclipse
but it didnot solve my problem
I hit this same error (Eclipse Mars).
Shutting down all Eclipse instances and starting with eclipse.exe -clean fixed it.
Bug 378568 mentions:
Looks like the configuration of your eclipse is damaged.
Check the value of 'eclipse.p2.profile' and 'eclipse.p2.data.area' in config.ini, then check whether the specified profile can be found from path 'eclipse.p2.data.area'.
<eclipse.p2.data.area>\org.eclipse.equinox.p2.engine\profile‌​Registry
Removing those files (in the folder eclipse.p2.data.area) and relaunching Eclipse should help fix the issue.
Although FaithReaper mentions in the comments:
Removing the eclipse.p2.data.area folder prevents Eclipse from launching.
In my case it is C:\Users\<my.user.name>\.p2
The discussion mentions the error:
An internal error occurred during:
"Loading bundle:
/eclipse/configuration/org.eclipse.osgi/1304/0/.cp/bundles/php.ruble".
org.eclipse.osgi.internal.framework.EquinoxConfiguration$1
cannot be cast to java.lang.String
This is mentioned in this answer (and this one) as a patch to be applied (see bug 445122: ClassCastException received when System.getProperties().store() runs on 4.4.1)
Just add the following lines to eclipse.ini:
-Dorg.eclipse.swt.browser.IEVersion=10001
-Dosgi.configuration.area.default=null
-Dosgi.user.area.default=null
-Dosgi.user.area=#user.home
-Dosgi.instance.area.default=null
It worked when I put the full eclipse folder (containing the executable) at the root of the harddrive like :
C:\eclipse
Same for the workspace.

Problems occurred when invoking code from plug-in: "org.eclipse.core.resources"

How do I resolve the above reported error message? Additional details are given below:
Exception Stack Trace
java.lang.NullPointerException
at org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer.initialize(MavenClasspathContainerInitializer.java:48)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2843)
at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1878)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:3128)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2691)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2855)
at org.eclipse.jdt.internal.core.ClasspathChange.generateDelta(ClasspathChange.java:220)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2052)
at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470)
at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2353)
at org.eclipse.wst.jsdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2153)
at org.eclipse.wst.jsdt.internal.core.JavaModelManager.getJsGlobalScopeContainer(JavaModelManager.java:1530)
at org.eclipse.wst.jsdt.core.JavaScriptCore.getJsGlobalScopeContainer(JavaScriptCore.java:1319)
at org.eclipse.wst.jsdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2740)
at org.eclipse.wst.jsdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:2019)
at org.eclipse.wst.jsdt.core.JavaScriptCore.initializeAfterLoad(JavaScriptCore.java:2655)
at org.eclipse.wst.jsdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:32)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Session Data
eclipse.buildId=I20120608-1400
java.version=1.7.0_08-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/ravisankars/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/ravisankars/.eclipse_keyring -showlocation
One thing I did (though I recommend uninstalling and re-installing your plugins first as previously posted by #Rajkumar) is to remove the builder causing the issue. MyProject -> Properties -> Builders ...[Troublesome Builder]... Remove.
It is a short run solution, you are only circumventing the real issue, but for me, it did what I needed it to for the time being.
Quite a few things had happened since I first installed Eclipse, like (a) installing / uninstalling plugins (b) upgrading the IDE without correspondingly upgrading the workspace. Since the history has become complex, troubleshooting also got trick. Fresh installation along with importing the code base again, fixed the issue for me.
Problem like happens if you have to many resources file like java scripts in your eclipse project. The solution is to remove the java script nature from project facets or disable the java script validation.
Well, before you go into all the trouble of uninstalling and installing again; if you haven't done any special action with your plug-ins, you may want to try the following which is fast and simple:
Close the project(s)
Open the project(s)
Restart eclipse
For me after this it is working. This is solving a lot of unaccepted issues that may occurred with older eclipse versions too.

Error "Server failed to start" while running JBoss 7.1 in Eclipse IDE

I have a problem installing and running JBoss AS 7.1.0 via JBoss Tools version 3.3 in Eclipse 3.7 (Indigo). I created a new server runtime environment:
Window->Preferences->Server->Runtime environments
JBoss AS root directory (mine was C:\jboss-as-7.1.0.Final) select the "Create a new local server".
Create a server:
File->New->Other->Server->Server->JBoss Community->JBoss AS 7.x
Select my newly created runtime configuration, click next and finish.
I tried to Run server for testing but Eclipse throw some kind of error. Here the information from "Error log":
Server JBoss 7.1 Runtime Server failed to start.
eclipse.buildId=M20120208-0800
java.version=1.6.0_31
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ru_RU
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
We had exactly the same issue on Windows. We fixed this by using JBoss AS 7.1.1 instead of 7.1.0. Probably you also need to do this workaround. But I assume this is not necessary, because you already use Version 3.3 of the JBoss Tools.
This issue can happen when you try to start Jboss with java version > 1.7
Could you try upgrading your java

Eclipse Helios not able to install m2e

I am very new to the Maven. I am trying to install m2e plugin in my Eclipse (eclipse-jee-helios-SR1-win32) from the Eclipse Marketplace. My Eclipse folder is in c:\ (c:\eclipse). It downloads and installs it properly (at least it looks so!) and then ask to restart Eclipse. I do restart it. But as soon as it restarts, it starts downloading some stuff and I get the following error:
eclipse.buildId=M20100909-0800
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
Error
Fri May 27 11:17:41 EDT 2011
Unable to update index for central|http://repo1.maven.org/maven2
java.io.IOException: An existing connection was forcibly closed by the remote host
at org.maven.ide.eclipse.internal.index.AsyncFetcher$PipedErrorInputStream.checkError(AsyncFetcher.java:181)
at org.maven.ide.eclipse.internal.index.AsyncFetcher$PipedErrorInputStream.read(AsyncFetcher.java:188)
at java.io.PipedInputStream.read(PipedInputStream.java:361)
at java.io.InputStream.read(InputStream.java:85)
at java.util.Properties$LineReader.readLine(Properties.java:418)
at java.util.Properties.load0(Properties.java:337)
at java.util.Properties.load(Properties.java:325)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.downloadIndexProperties(DefaultIndexUpdater.java:498)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.access$100(DefaultIndexUpdater.java:74)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater$IndexAdaptor.setProperties(DefaultIndexUpdater.java:780)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:954)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:138)
at org.maven.ide.eclipse.internal.index.NexusIndexManager.updateRemoteIndex(NexusIndexManager.java:1072)
at org.maven.ide.eclipse.internal.index.NexusIndexManager.updateIndex(NexusIndexManager.java:1025)
at org.maven.ide.eclipse.internal.index.NexusIndexManager$1.run(NexusIndexManager.java:632)
at org.maven.ide.eclipse.internal.index.IndexUpdaterJob.run(IndexUpdaterJob.java:71)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
at sun.nio.ch.IOUtil.read(IOUtil.java:200)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:322)
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)
at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Does anyone has ANY idea what is this? I repeated the process thrice, repeated on fresh installation of Eclipse, same problem. My colleague is using same version of Eclipse and has done the same process. He was able to install m2e in < 1 minute! This is so frustrating!
EDIT 1:
I have configured Proxy Settings in Eclipse Network Connections and those settings are working fine for my colleagues. So I guess it is not a proxy issue.
Although the Public Maven address itself isn't browsable anymore recently, this is more likely due to a Network Connections settings in your Eclipse.
See this answer to set your proxy if you have one, and more generally, check the "Network Connections" settings of your Eclipse's colleague to ake sure you have the same.
For information/archive, regarding the browse status of http://repo1.maven.org/maven2:
The raw browsing ability was originally removed to prevent automatic web crawler/scraper activity from de-stabilizing the Central servers.
Some of that ability has been returned.
It is currently possible to browse at levels deeper than the root, /org, /com, and /net.
So, if you try to navigate to http://repo1.maven.org/maven2/org, for example, you will see a static page with a link to the appropriate Browse view on http://search/maven.org.
However, if you go even one level deeper, to http://repo1.maven.org/maven2/org/apache, the standard directory browse functionality will be in place.
Found simple solution. Just did an update for Eclipse and it worked!