The Apache Tomcat Maven Plugin has a great feature: it can create a runnable jar file with an embedded Tomcat server.
I tried this on a simple ‘Hello world!’ webapp to see if this works. It didn’t. When you run the jar: java -jar target\hello.jar, it would fail saying that the hello.war could not be found.
Of course I tried many different configurations and Maven POM file changes. Web searches did not point to an issue. Finally at the end I found something. There is a bug in the plug-in version 2.2. Errrrr.
Anyway, here is a suggestion to get around it. Made the changes, it works.
In a new project, attempts to programmatically access our Subversion server using SvnKit fails with an E170001 error. But, only on one Windows 7 workstation.
After a lot of searching on web for answers finally found something that helped. I had to add system property: svnkit.http.methods=Basic,Digest,Negotiate,NTLM
So, using SvnCli, which I used to debug this, you add the property using the “-D” switch to the command line.
java -Dsvnkit.http.methods=Basic,Digest,Negotiate,NTLM -cp "SvnCli\*" org.tmatesoft.svn.cli.SVN --username *** --password *** list
I also had to add this property to the Tomcat app server.
While this does fix the problem in this instance, since only one workstation is effected, it is probably hiding an underlying configuration setup issue.
I wonder what percentage of the nation’s GDP is spent on configuration and its issues.
Mar 18, 2015 11:40:31 AM org.tmatesoft.svn.core.internal.util.DefaultSVNDebugLogger log
SEVERE: CLI: svn: E170001: Negotiate authentication failed: 'No valid credentials provided'
org.tmatesoft.svn.core.SVNException: svn: E170001: Negotiate authentication failed: 'No valid credentials provided'
svn: E170001: Negotiate authentication failed: 'No valid credentials provided'
- Java 1.7
- SvnKit 1.8.8
- Tomcat 7
many ways to do this and of course corresponding security concerns. My quick approach was to just use file directory symbolic links.
I set up a Tomcat app server on a ‘virtual’ hard drive. The virtual drive is assigned a local hard drive letter. But when a Groovlet attempts to access a local file, the file path used is on the default local drive, C:. How to allow access to the non-local file?
There are probably many ways to do this and of course corresponding security concerns. One of these is to use Universal Naming Convention (UNC) paths. My quick approach is to just use file directory symbolic links. These are supported in most windows versions. On Windows 7 the MKLINK command is available.
You want to access the folder w:\a\b\c on the virtual drive. On the “real” drive you create a link:
mklink /D c w:\a\b\c
Now when the app server accesses the “c” folder via a UNC, \\mymachine\a\b\c, it will find it.
Get errors running SSL on Tomcat. Found one solution.
I was trying to setup an external HTTP server so that I can test SSL connections from my Java app. I’ve done this with Tomcat server before. It was easy, just follow the instructions on Tomcat’s document site. All done.
- Windows XP Professional
- Tomcat 6.0.29
- Java 1.6
Not this time. A host of problems:
1. javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2. SEVERE: Error initializing endpoint
java.lang.Exception: No Certificate file specified or invalid file format
at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method)
3. SEVERE: Error starting endpoint
java.lang.Exception: Socket bind failed:  Only one usage of each socket address (protocol/network address/port) is normally permitted.
The last issue above is very weird. I ran netstat and no other apps are using the ports that Tomcat is trying to use.
I won’t bore you with the details, suffice to say, I just removed the native library, tcnative-1.dll, from the Tomcat folder and everything works.
Well, not everything, I’m still getting,
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
But, that is more tractable.