After using mvn appengine:deploy, we receive a BUILD SUCCESSFUL message... but when you navigate to the URL... the following message is received:
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
/ ---> o.e.j.w.WebAppContext#4566e5bd{/,file:///var/lib/jetty/webapps/root/,UNAVAILABLE}{/root.war} [failed]
Powered by Jetty:// 9.4.5.v20170502
I almost feel like the WAR is being deployed to the wrong directory on the AppEngine, causing Jetty to not be able to locate. Any ideas?
It turns out Jetty requires two configuration files (web.xml and applicationContext.xml), web.xml defines the DispatcherServlet and it's configuration location, applicationContext.xml indicates that spring should use component-scanning and annotation-driven configuration.
Related
I'm using JHipster to build a web application (awesome project, keep going guys :).
I'm using a server where apache is already installed deploying a php app (http://www.myurl.com)
I'm trying to deploy my JHipster app under another url (http://www.myurl.com/my_project)
I tried :
rewrite rule to redirect /my_project http://localhost:PORT/my_project using my own tomcat install
using runnable jhipster war
changing some cong in yml file to add context under server > context-path
Nothing is working fine :
access to first page webapp ok but 404 to any other pages
blank page, unable to load resources because context is missing I think
doesn't change anything
Any other idea? Something I forget? Something related to webpack ?
Thanks for any help :)
Use apache(httpd) proxying to redirect calls to your jHipster application to your tomcat
the configuration is meant to be put in apache configuration files you must have proxying mod enabled in apache but if my memories are good proxying user sessions from apache httpd to tomcat can be quite tricky. The following syntax is what you are looking for
ProxyPass "/images" "http://www.example.com/"
ProxyPassReverse "/images" "http://www.example.com/"
https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html
I have three spring boot applications, one is a derby spring boot and the other two have OAuth2 (org.springframework.security.oauth2) one has the OAuth2 client and the other the OAuth2 server. I have converted them to deployable wars and deploy them to a tomcat, they seems to be running fine. Except for the OAuth2, it seems to be failing in the deployable wars. I'm seeing this error:
org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException: Error requesting access token.
at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:145)
at org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsAccessTokenProvider.obtainAccessToken(ClientCredentialsAccessTokenProvider.java:44)
at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainNewAccessTokenInternal(AccessTokenProviderChain.java:148)
at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainAccessToken(AccessTokenProviderChain.java:121)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:105)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:648)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613)
at org.springframework.web.client.RestTemplate.headForHeaders(RestTemplate.java:336)
I have debug both executable and deployable and the only thing I have found is that in the executable wars the OAuth2AccessToken has a value but in the deploy wars in tomcat the OAuth2AccessToken is null.
I'm able to get the token with curl and I have check that the url is correct in the application.
I've also try to deploy the derby spring boot in a separate tomcat and that makes the OAuth2 to start working, not sure why.
I'm not sure why this is happening since the wars are the same. Am I missing some configuration in tomcat?
Or maybe some conflict with the classes deployed in tomcat? Or the tomcat classpath?
I once faced similar issue. I deployed my Spring Boot application on AWS and I was getting the same error. I was deploying the .war file and running the Tomcat separately on AWS. I fixed the error by deploying the .jar file which itself includes the tomcat server. Not sure if the scenario is same.
I'm deploying a .war file built from one of the Spring Boot Getting Started projects, built with Spring Tool Suite. It's a simple RESTful webservice that works on the Tomcat server provided in the Spring Tool Suite running on my PC. The service responds with a string property on a get operation, so it's simple.
I added the Web Fragment Module facet in order to generate a war file. I'm deploying this war to a Weblogic 10.3.5 managed server instance on a test host. The deployment is successful. However, when I use the test URL provided from the Weblogic admin console, I get a 403 forbidden error.
This basic war does not have a web.xml. Should I have one? Should it contain a welcome file reference?
Is there additional configuration that I should do on Weblogic? I am reading the Weblogic documentation.
Summary: I have an SAAJ Client that calls a remote Web Service over HTTPS. Both Client and Server authentication via certificates is required. I can successfully invoke the service when running a JUnit test in my IDE, but fail to connect when running in JBoss.
Keystore/Truststore Configuration Details: In both the IDE and JBoss, I'm setting the keystore and truststore via system properties: javax.net.ssl.keyStore, javax.net.ssl.keyStorePassword, javax.net.ssl.trustStore, javax.net.ssl.trustStorePassword
Logging Configuration: In JBoss, I've enabled SSL Debug logging via the system property: javax.net.debug=SSL. I've also enabled CXF logging via a logging.properties file.
JBoss SSL Logging Output Summary:
SSL logging shows no WARN or ERROR logs
SSL logging shows a session is established at the time of the call to the remote service
JBoss CXF Logging Output Summary:
CXF logging shows that the POST is sent to the service via Conduit null.http-conduit
CXF logging shows this conduit is "configured for plain http", has "No Trust Decider", and has "No Auth Supplier" (I'm not entirely sure what all of this means, but it sounds relevant)
Stack Trace: Here's the actual stack trace I'm getting
Caused by: javax.xml.soap.SOAPException: JBWS024004: SOAP message could not be sent
at org.jboss.wsf.stack.cxf.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:124)
at my.client.soap.MySAAJClient.invoke(MySAAJClient.java:37) [my-client-0.0.1-SNAPSHOT.jar:]
... 17 more
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '403: Forbidden' when communicating with https://remote.service.url.here/
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1542)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1502)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1309)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:627)
at org.jboss.wsf.stack.cxf.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:120)
... 19 more
Other Information
I don't have direct access to the logs of the remote web service, but I'm told that they "don't show anything"
CXF comes into play because it is used by JBoss. I don't have any CXF dependencies included in my project and it's not in play when I run the code in my IDE.
What I've Tried: I've been focused on CXF because again, this all runs fine when executed in my IDE where CXF is not in play and the CXF log that says the conduit has been "configured for plain http" scares me. I've tried including a jboss-cxf.xml, jbossws-cxf.xml, or cxf.xml configuration file in my WAR that includes the keystore and truststore configuration. This has not worked and I can't even tell that CXF is seeing these files.
My Questions (Updated)
Is there any way to get JBoss/CXF to see that this is a secure connection and use the keystore/truststore configured via system properties?
Is there any way for me to direct JBoss (via jboss-deployment-structur.xml maybe?) to use a different SAAJ implementation for my deployment?
Do you have any thoughts on other things I should be looking into?
Update 1
I believe I've confirmed that the JBoss-CXF integration is the issue. I was able to remove JBoss's SOAPConnectionImpl by modifying the file {JBOSS_HOME}/modules/system/layers/base/org/jboss/ws/saaj-impl/main/module.xml. I commented out the module dependency <module name="org.jboss.ws.jaxws-client" services="import"/>.
After making this change, my application was able to connect to the remote service with no issues.
Although this shows that the JBoss-CXF integration is this issue, I can't modify the deployment environment in this way. I need to identify another solution.
I'd go for system properties (or at least knowing the configuration of the system) as they might override whatever you specify in your deployment.
What version of cxf is used on the deployment environment? Do you have any info on the configuration of cxf on your deployment environment? From the documentation (http://cxf.apache.org/docs/ws-security.html), I can see you need to configure WSS4J interceptors for cxf 2.0.x or earlier, so you could check if this is okay on your deployment environment.
I have setup a local server running in eclipse. It is to run my max-ws application which I have been making.
Once the server has started i can proceed to the following directory to view the management console;
> http://localhost:8080/
The name of my war file is hotornotserver.war - so assuming i deploy the war in the management console i should then be able to proceed to the following directory to view the wsdl.
> http://localhost:8080/hotornotserver?wsdl
As it stands when i do this i get the following error;
HTTP Status 404 - /hotornotserver
type Status report
message /hotornotserver
description The requested resource (/hotornotserver) is not available.
JBoss Web/7.0.1.Final
Baically i am interested in finding out how I can call methods on my local web service to perform some analysis on metrics / performance however I keep getting the error above. Some help would be much appreciated.
Thanks