Spring Boot with Tomcat embedded under windows server 2008 R2 doesn't work - spring

Folks, I have a spring-boot app running locally with gradle build tool, with custom: server:
servlet-path: /own/api
port: 8989 without any problem. However it doesn't work in WindowServer 2008-R2, I just get in log:
DispatcherServlet with name dispatcherServlet processing GET request for [/own/api]
Looking up handler method for path [/own/api]
Maybe WindowsServer would require something extra configuration, but not sure, i guess to deploy a spring boot application with tomcat embedded wouldn't have any trouble:
java -jar myfile.jar
Under AdvancedREST client tool I just get:
http://SERVER-API:8989/own/api
{
"timestamp": "2016-07-05T21:13:25.884+0000"
"status": 404
"error": "Not Found"
"message": "/own/api"
"path": "/own/api"
}
As aforementioned, locally it works fine but not in windows server 2008R2. I was wondering if there was a manager in tomcat embedded, just to figure out what basePath would be, because I tried with:
http://SERVER-IP:8989/myfile/own/api //but didn't work either.
Any help I'd really appreciate.

Folks, I found the solution which is adding a slash character to the end of the URL.
http://server:port/own/api/ instead of http://server:port/own/api
I've faced with this issue in the past in other scenarios with Tomcat.

Related

Spring Boot - Liquibase - WebSphere - Cannot create filesystem for url file xxx/jsf-nls.jar

Configuration
My Spring Boot/Liquibase specifications & configuration is as per this question.
Issue
Everything goes well in my local environment with embedded Tomcat. When i migrate the war file to IBM WebSphere 8.5.5.15, i see this warning:
[7/29/20 11:04:17:302] 000002ff database I liquibase.database Could not set remarks reporting on OracleDatabase: com.zaxxer.hikari.pool.HikariProxyConnection.setRemarksReporting(boolean)
[7/29/20 11:04:18:066] 000002ff lockservice I liquibase.lockservice Successfully acquired change log lock
[7/29/20 11:04:18:090] 000002ff integration W liquibase.integration Cannot create filesystem for url file:/opt/IBM/WebSphere/AppServer/lib/jsf-nls.jar: /opt/IBM/WebSphere/AppServer/lib/jsf-nls.jar
java.nio.file.FileSystemNotFoundException: /opt/IBM/WebSphere/AppServer/lib/jsf-nls.jar
at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:120)
at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:139)
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:390)
at liquibase.resource.ClassLoaderResourceAccessor.loadRootPaths(ClassLoaderResourceAccessor.java:63)
:
I have checked and the jar file is not there at the location that it is looking for it.
Question
It's only a warning, everything else is working as expected, should i be concerned about this warning?

Getting “Method Not Allowed” error when POST /actuator/bus-refresh for Spring Cloud Config server when service deployed in Google Cloud

I'm using Spring Cloud Config Server to get the configuration from Git and I've deployed my service in google cloud.
When I run the service in my local and invoke POST http://localhost:8887/actuator/bus-refresh, it runs successfully.
But when I invoke the same for the service deployed in Google Cloud, it gives - Request method POST not supported,
{
"timestamp": "2020-05-31T13:42:56.641+0000",
"status": 405,
"error": "Method Not Allowed",
"message": "Request method 'POST' not supported",
"path": "/actuator/bus-refresh"
}
Steps I followed:
Installed Rabbit MQ in google cloud, exposes it as service.
Updated the Spring Cloud Config - with rabbit mq server details
Build and pushed docker image to GC
Deployed and exposes Config server in GC
When hitting POST for http://<exyternalip>:8887/actuator/bus-refresh getting Request method 'POST' not supported.
When hitting GET for http://<exyternalip>:8887/actuator/bus-refresh - response gives me the application.properties in git
From local by pointing to GC rabbit mq with POST, it gives success.
Below is the configuration in my Config server
spring.application.name=my-config-server
server.port=8887
spring.cloud.config.server.git.skip-ssl-validation = true
management.endpoints.web.exposure.include=bus-refresh
spring.cloud.bus.enabled=true
spring.cloud.config.server.git.uri=****
spring.cloud.config.server.git.username=****
spring.cloud.config.server.git.password=****
spring.rabbitmq.host=34.68.237.224 #GC rabbit MQ
spring.rabbitmq.port=5672
spring.rabbitmq.username=rabbit
spring.rabbitmq.password=rabbit
what am I doing wrong?
I used the following dependency :
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
instead of this :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>

Spring-Boot template resolution fails when WAR is deployed

My Spring-Boot app works fine when running it via the Eclipse IDE (with S.T.S. 3.8.4 installed), with the embedded tomcat server.
I packaged it as a WAR and deployed it to a local Tomcat server.
When accessing the app, a blank page is returned. I discovered the exception in the Tomcat logs (on Windows, C:\<path-to-tomcat>\logs) An exception is thrown when trying to resolve the Thymeleaf templates:
2017-04-04 12:33:36.602 ERROR 5724 --- [io-12080-exec-7] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-12080-exec-7] Exception processing template "home": Error resolving template "common/layout", template might not exist or might not be accessible by any of the configured Template Resolvers (template: "home" - line 5, col 7)
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "common/layout", template might not exist or might not be accessible by any of the configured Template Resolvers (template: "home" - line 5, col 7)
at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:865) ~[thymeleaf-3.0.2.RELEASE.jar:3.0.2.RELEASE]
The problem was the casing of the folder names.
I had my layout fragment in templates/Common/layout.html (notice the capital C in Common) and in my views was referencing common/layout, which worked within the IDE, but did not work when deploying a WAR on a Tomcat server. Maybe because the IDE ignores casing, and Tomcat is case sensitive?
It worked after changing the reference in my view to the correct casing of the folder, Common/layout

weblogic 10.3.6 issue

I have upgraded the WebLogic server from 10.3.5 to 10.3.6 for my application and upgraded the jars to the latest which are available with WebLogic 10.3.6.
I have created wlfullclient.jar and and the deployment was going fine.
When I try running the test cases for my application they were failing with the following error:
com.sun.xml.ws.util.ServiceConfigurationError:
weblogic.wsee.jaxws.tubeline.TubelineDeploymentListener:
Provider:`weblogic.wsee.wstx.wsat.tube.WSATTubelineDeploymentListener` is specified in jar:
> file:/root/Oracle/Middleware/wlserver_10.3/server/lib/wseeclient.jar!/META-INF/services/weblogic.wsee.jaxws.tubeline.TubelineDeploymentListener
but not found at
- com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:241)
- com.sun.xml.ws.util.ServiceFinder.access$100(ServiceFinder.java:141)
- com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:376)
weblogic.wsee.jaxws.spi.WLSServiceDelegate$WLSTubelineDeploymentListenerRepository.<init>(WLSServiceDelegate.java:355)
- weblogic.wsee.jaxws.spi.WLSServiceDelegate.<init>(WLSServiceDelegate.java:89)
- weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:632)
- weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:143)
- weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:117)
- weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:88)
- javax.xml.ws.Service.<init>(Service.java:56)
While using WebLogic 10.3.5 the testcases were passing without issue.
I finally found that there is no folder named wsee in the new wlfullclient which was created for the new release (WebLogic 10.3.6).
Please help me how to fix this issue.
There seems to be problem with the webservices.
This discussion might help wsse JAXWS

How to configure xuggle for Apache Tomcat in Windows

I have been developing a video sharing web application (like youtube) using Netbeans with Tomcat on Windows platform. There I want to generate thumbnail images of video files as soon as the videos get uploaded. So searching the net I found something called Xuggle. I installed Xuggler in my Tomcat's lib folder. I have set the necessary environment variables. When I run just a java application I get the results, but when I do the same with a Java web application I get the following errors:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.Global_NO_PTS_get()J
com.xuggle.xuggler.XugglerJNI.Global_NO_PTS_get(Native Method)
com.xuggle.xuggler.Global.<clinit>(Global.java:240)
xugglerPack.Main.<clinit>(Main.java:43)
xugglerPack.VT.processRequest(VT.java:86)
xugglerPack.VT.doPost(VT.java:137)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:3
93)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26
logs.
===========================================================================================
#pd40 >>> I reinstalled Xuggler ( this time in C:\Program Files , I restarted my PC after installation . I set the following in my environment variables :
XUGGLE_HOME = C:\Program Files (x86)\Xuggle
CLASSPATH = .;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\commons-cli.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\logback-classic.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\logback-core.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\slf4j-api.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\xuggle-xuggler.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\xuggle-xuggler-test.jar;
PATH = C:\Program Files (x86)\Xuggle\bin;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\bin;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib;C:\Program Files (x86)\Xuggle\lib
I have copied the jars of Xuggle/java/jars (6 jar files) in The Tomcat's\lib folder and set the CLASSPATH of them.
Now I still get the problem when i do this in a web application , but standalone java application generates the images nicely. What is going wrong ??? When i upload a video it gets uploaded but the thumbnail images are not generated , I get the following error...
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: Could not initialize class com.xuggle.ferry.FerryJNI
com.xuggle.ferry.RefCounted.acquire(RefCounted.java:179)
com.xuggle.xuggler.IContainer.copyReference(IContainer.java:80)
com.xuggle.mediatool.AMediaCoderMixin.<init>(AMediaCoderMixin.java:68)
com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
xugglerPack.Main.main(Main.java:51)
xugglerPack.VT.processRequest(VT.java:87)
xugglerPack.VT.doPost(VT.java:135)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26
logs.
Make sure you put Xuggler lib in your windows PATH or LD_LIBRARY_PATH.
Similar to Tomcat native. I assume you have tried this.
You might also want to check out this thread

Resources