Getting error in running apache tomcat server - java

When I try to run a servlet program in NetBeans, I get the following error in build-impl.xml at line 1045, which is not allowing Tomcat server to start.
And, apache server log is giving message as IP is not recognized as an internal or external command,operable program or batch file.
I do not know where I did it wrong, or where I configured the environment variables, provided in servlet mapping.
Any help is welcome.

I think, there is some issue in tomcat which comes with netbeans or permission issue in Windows.
Follow below steps to resolve :
1) Remove your current tomcat. (Tools --> servers --> select tomcat --> remove)
2) Download latest tomcat from here
3) Extract it (Not in system drive)
4) Go to Tools --> servers --> click on add server
5) From Server list choose Apache Tomcat or TomEE element.
6) Choose server location by clicking the Browse button.
7) Click on Finish.
8) Start tomcat.
Hope this will resolve your issue.

Related

The Tomcat installation directory is not valid. It is missing expected file or folder tcruntime-ctl.sh

Even after searching too much i couldn't find any suitable answer for my problem.
I am using Spring Tool Suite and trying to create a new server but getting error as The specified server is not valid. The .tc-runtime-instance file is missing.
So, I tried updating pivotal using Windows> Preferences and tried editing pivotal with new release but got the error as attached:
I tried changing tomcat version from 9 to 7 too but still no success. Please help.
It looks like you are trying to use the server adapter for the "Pivotal tc Server" to configure your server in the IDE. This server adapter is for the Pivotal tc Server only and doesn't work with a plain Tomcat installation on your disc. For that, you should select the "Apache Tomcat" server adapter when creating a server instance in your IDE.

SAP Hybris on Mac OS Catalina

I just update my Mac OS to Catalina version and my Hybris server stopped turning on. So on command ./hybrisserver.sh start I get this
MacBook-Pro-Sasha:platform sashayukhimchuk$ ./hybrisserver.sh start
Starting hybrisPlatform on Tomcat...
/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/wrapper.sh:
line 1388: 4614 Killed: 9
"/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/./wrapper-macosx-universal-64"
"/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/conf/wrapper.conf"
wrapper.syslog.ident="hybrisPlatform"
wrapper.pidfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.pid"
wrapper.daemonize=TRUE wrapper.name="hybrisPlatform"
wrapper.displayname="hybrisPlatform on Tomcat"
wrapper.statusfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.status"
wrapper.java.statusfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.java.status" wrapper.script.version=3.5.29 --
Waiting for hybrisPlatform on Tomcat..................
WARNING: hybrisPlatform on Tomcat may have failed to start.
I had to allow the wrapper-macosx-universal-64 and some other libs in Systemsettings > Security > General while starting the Hybris Server.
Remove the app (and all the necesary side apps) from Mac OS quarantine:
xattr -d com.apple.quarantine wrapper-macosx-universal-64
You can find the blocked wrapper under /bin/platform/tomcat/bin
If you get an error saying that the wrapper-macosx-universal-64 or libwrapper-macosx-universal-64.jnilib cannot be opened because the developer cannot be verified, proceed as follows:
Go to system preferences security and privacy
Click the General tab.
In the list, select the executable that you tried to run, and unblock it.
Run the command again.
to fix it, u need new tomcat in bin/platform. I just create new hybris project with .zip and copy tomcat folder to my hybris project and after some confirming about security in Mac OS setting, it works
It's probably could happen as a result that wrapper-macosx-universal-64 was deleted by macOS during a security check.
You can copy the file from the original path in hybris zip archive -
hybris-dir/bin/platform/tomcat/wrapper-macosx-universal-64
to your installation and follow the actions related to macos developers security check to allow starting the tomcat

Eclipse - Could not publish server configuration for Tomcat8.0 server at localhost

I have created some example web service methods and trying to publish in my localhost with Tomcat v8.0. I use Eclipse Java EE IDE for Web Developers with Mars version 4.5.0.
I configured the server Tomcat v8.0. I got the configured server in Eclipe's Servers list. I Start the server. But Eclipse prompts saying
Publishing to tomcat v8.0 Server at localhost..." has encountered a problem.
And the error details shows that Multiple context have a path for /HelloWorldServlet and /com.vogeila.jersy.first. These are the servlet projects I created in my workspace.
You can refer this screen shot:
I followed this answer.
"Server Tomcat v7.0 Server at localhost failed to start" without stack trace while it works in terminal
But It didn't work for my case.
Share your ideas.
The prompted message helped me. The Server.xml file under Servers has multiple entries of <Context> tag. I deleted everything by leaving only one entry. It worked for me. 
Delete Existing tomcat server...
Then add new server.. its work for me

Why is my Tomcat server throwing intermittent 404's when compiling JSP's?

I need help figuring out why a couple of my web applications are intermittently throwing 404 errors when trying to bring up a JSP. One of them has the JSP accessed directly and the other has a servlet that is forwarding to a JSP. The pages work most of the time, but occasionally will throw a 404. If the user refreshes their browser 1-3 times, the page starts working again without any changes required.
Here is a sample of the error as seen in the web browser (Chrome):
type: Status report
message: /app_root/my_page.jsp
description: The requested resource is not available
The problem seems to be related to recompiling the JSP pages. The .war file and expanded directory haven't changed. There are always three errors in the logs that correspond to each 404 error:
WARNING: Failed to delete generated class file [D:\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\app_root\org\apache\jsp\my_005fpage_jsp.class]
May 19, 2015 6:32:24 AM org.apache.jasper.compiler.Compiler removeGeneratedFiles
WARNING: Failed to delete generated Java file [D:\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\app_root\org\apache\jsp\my_005fpage_jsp.java]
May 19, 2015 6:32:24 AM org.apache.jasper.compiler.Compiler generateJava
WARNING: Failed to delete generated Java file [D:\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\app_root\org\apache\jsp\my_005fpage_jsp.java]
I'm running Java 1.7 on Tomcat 7.0.53. Tomcat is running on a Windows 2008 R2 server.
Here is what I've tried so far, based on the information I've found from google. However, the 404's continue.
Disabled Windows indexing on the entire Tomcat directory
Turned off development mode in my production environment
Increased modificationTestInterval in my QA environment from the default (4 seconds) to 3600 (1 hour) [Note: it is currently set to 0 to try to help me reproduce the issue]
Changed the owner on the Tomcat work directory to be the same id as the id that the service is running as.
I am in the process of getting anti-virus turned off on the work directory to see if that helps.
While this issue is occurring on my prod and QA servers, it doesn't occur for me on my local Tomcat instance. In fact, I have yet to see the problem from my workstation even when running the QA and Prod applications. The issue has only been seen by other people.
The Tomcat container caches .java and .class files generated by the JSP parser, which are used by the web application. Sometimes these get corrupted or cannot be found. This may occur after a patch or upgrade that contains modifications to JSPs.
Solution is to just simply delete the work directory and restart the tomcat
I had the same problem after deploying a .war on our live server. These are the steps that I followed to solve the problem:
1) Shut down the tomcat server
2) Go to <your tomcat directory> -> work -> Catalina -> localhost -> <your project> -> org -> apache -> jsp ->
3) Manually delete both .class and .java
4) Delete the .war file and the deployed folder from the website that is having the issue on the webapps folder.
5) Export a new .war, and put it into the webapps folder.
6) Start up the tomcat service again.
Once the server is finished deploying, it will auto re-generate the deleted files in the "work" directory and the website should be available again without the intermittent 404 error.
I hope it works for you too.
Check the authority of this file or folder. Generally this problem is caused by lack of access to folders.

unable to open web service tester page with jdk8 and netbeans 8

I wrote a simple web service program but I can not test it on glassfish 4.0 web server .
When I Test Web service I see this message :
Make sure the service has been deployed successfully, and the server is running.
I can see it in list of deployed web services on glassfish web server .
and I add this file to \jdk1.8.0\jre\lib to fix the problem.
jaxp.properties
javax.xml.accessExternalSchema = All
But it doesn't work
Also I see this error in url of tester page :
lineNumber: 52; columnNumber: 88; schema_reference: Failed to read schema document 'xjc.xsd', because 'bundle' access is not allowed due to restriction set by the accessExternalSchema property.
Thanks in advance
This worked for me:
From NetBeans IDE 8, deploy your web application in order to start GlassFish (right-click on your web project and choose Deploy)
Open the GlassFish console on your browser (http://localhost:4848/common/index.jsf if you are working locally with default configuration)
Create a new JVM option with value: -Djavax.xml.accessExternalSchema=all (I recomend you to read https://javaee.github.io/glassfish/doc/4.0/administration-guide.pdf at page 119). Don't forget to save it.
Restart GlassFish (by clicking on the message near upper left corner)
That must be enough... so, try to test your web service again.
I don't know where GlassFish is saving that change...
Sorry for my english :)
This is answer :
https://netbeans.org/kb/docs/websvc/jax-ws.html#extschema
You should configure IDE and Glassfish server directly .
With special thanks to Pablo

Categories