CXF: corrupted schemaLocation in xsd:import - soap

I'm deploying a SOAP webservice using Apache CXF on different servers. The WSDL contains this line:
<xsd:import
namespace="http://schemas.xxx.net/xsd/gameserver/types/types_v1_0"
schemaLocation="types_v1_0.xsd">
when a client accesses the WSDL, the schemaLocation is completed to form an absolute path:
<xsd:import
namespace="http://schemas.xxx.net/xsd/gameserver/type/types_v1_0"
schemaLocation="http://moss.xxx.local:8080/gameserver/webservices/base_v1?xsd=types_v1_0.xsd">
My problem: on some of the servers, this produces corrupt URLs:
<xsd:import
namespace="http://schemas.xxx.net/xsd/gameserver/types/types_v1_0"
schemaLocation="http://localhost8888gameserver/webservices/base_v1?xsd=types_v1_0.xsd">
or even
<xsd:import
namespace="http://schemas.xxx.net/xsd/gameserver/types/types_v1_0"
schemaLocation="jen.x.local8080gameserver/webservices/base_v1?xsd=types_v1_0.xsd">
Has anyone encountered this problem? What could cause it? It seems to have appeared suddenly today when deploying a current version of the application, but I cannot find any suspicious changes - specifically that WSDL was not changed at all.

Turns out the URL is derived from the publishedEndpointUrl attribute of the <jaxws:endpoint> element in cxf-context.xml, which was wrong on some servers due to problems in the Maven profiles.

Related

For Apache Geode, How should I do to turn off the Jetty version messages when occur 404 error

We are using apache geode v1.6.0 and we also use Geode rest api.
However, when our customer do vulnerability test, they found a potential security risk and we need to fix that..
The report says, http://:7070 shows the following message
HTTP ERROR 404
Problem accessing /. Reason:
Not Found
**Powered by Jetty:// 9.4.8.v20171121**
As you can see, Jetty version was shown, and this is reported as a risk.
I searched a lot and found we can turn off the message by configure Jetty setting as follows
<Item>
<New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler">
<Set name="showContexts">false</Set>
</New>
</Item>
But, Jetty is embedded in the Geode, how should I do to set the showContexts to false?
Any suggestion will be appreciate, thanks a lot.
The Embedded Jetty Server is started and configured in Geode through the InternalHttpService class, and this internal class doesn't provide any feature to manually configure the actual server properties or settings. The showContexts property within the DefaultHandler class, on the other hand, can't be configured through environment variables (which could be used as a workaround), it can only be configured through xml files (not used within Geode) or programatically.
Long story short: I don't think there's an out of the box way to disable the DefaultHandler as of now in Geode, I'd suggest to open a ticket through the Geode JIRA System and describe with details the actual issue and impact. The actual fix shouldn't be hard to implement on your own, though: just register a custom ErrorHandler or programatically set the showContexts property to false within the DefaultHandler instead, so you could submit a PR fixing the problem to get it merged into the Geode.

What is the use of org.apache.struts.chain.ComposableRequestProcessor in struts and java.nio.charset.IllegalCharsetNameException

We ran into a migration issue where in we are migrating an application from JBoss 4.2.1.GA to JBoss EAP 7.0.0.GA. The exception encountered is as below.
java.lang.RuntimeException: java.nio.charset.IllegalCharsetNameException:
at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:226)
So we have a fix for the same which involves
Adding the below in the struts config.xml file.
this line in config
<controller processorClass="org.apache.struts.chain.ComposableRequestProcessor"
locale="true" nocache="false" contentType="text/html; charset= UTF8">
<set-property property="maxFileSize" value="7M"/>
</controller>
has been changes to
tag from charset= UTF8 to charset= ISO-8859-1"
and an additional property
This has resolved the issue but wants to know what is the proper use of class ComposableRequestProcessor. And why it is helping our solution here.
We don't see a proper document or blog on the net explaining why and when we need to add this configration. What is the advantage of doing so?
Also, we want to know JBoss 4.2.1.GA the page-context encoding was not enforced but in JBoss EAP 7.0.0.GA we need to define it as ISO else it won't work in windows server environment.
We know it has to do with some Undertow implementation over the earlier Apache Tomcat HTTPs implementation framework used by JBoss.
Any help by pointing to right document or information is widely appreciated.

Does JNLP (java web start) require server cooperation?

I am trying to load a JNLP but my server always return a 404. The path is correct and I haven't modified anything from the demo so I am certain that is not the problem. Is it the case that my hosting simply does not support JNLP and I should find a one that does? Or is it me doing something wrong?
Here is the test
http://www.alexandertechniqueatlantic.ca/test/webstart.jnlp
I am using the supplied demo downloaded from
http://download.oracle.com/javase/tutorialJWS/deployment/webstart/ex6/webstart_ComponentArch_DynamicTreeDemo/dynamictree-webstart.jnlp
The only 'co-operation' that JNLP requires from the server (as far as I can recall at this instant) are:
The server must supply all resources requested, the JNLP & any extension JNLP files, Jars, icons etc. The 404 indicates that part is not happening as per plan. Either the JNLP is not where you think it is, or (less likely, given it is the wrong error code) the server has been configured to disallow access to that document or directory.
The server should provide the correct content-type for the JNLP. We can look into that after you have sorted the 404.
Server was blocking JNLP extension from executing.

Unable to run spring template project on STS

I created a template project named sample and started it with spring tc server. The application gets deployed but then when I go to http://localhost:8080/sample/ I get the following error
INFO: Server startup in 12669 ms
WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/sample/] in DispatcherServlet with name 'appServlet'
I followed the same steps as shown in http://www.youtube.com/watch?v=Y0V4oEnCcyA to create a spring web App.
I asked my friend to follow the same steps and test it on his Ubuntu 10.04 machine and it worked fine out of the box. I came up with the conclusion that it must be something with my machine. I'm facing this problem on Mac osx 10.4 and
SpringSource Tool Suite
Version: 2.6.0.RELEASE
My host file contains the following entry
127.0.0.1 localhost
Can anyone guide me as to how to rectify this problem?
Thanks.
That warning means that you didn't set something up right in your project, plain and simple. Without code we can only guess.
Speaking of guessing, check your web.xml and make sure it actually says "sample".
Template project does not work for me either.
I changed the servlet mapping onto
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
Follow up the request mapping in the controller
#RequestMapping(value = "/home.do", method = RequestMethod.GET)
Now you can open http://localhost:8080/sample/home.do
Check the log in your eclipse server console window (bottom screen). If you're like me, there's a bug when resolving the path for the home.jsp file. It comes from the servlet-context.xml file :
<beans:property name="suffix" value="/" />
should be
<beans:property name="suffix" value=".jsp" />
Make sure you clean and restart the server after doing that change, because it seems like this servlet-context.xml file is heavily cached.

deploying multiple struts apps in jboss problem

I m trying to deploy two struts2 projects(ear files) in jboss 4.2.2GA.When i deploy them seperately they work fine, but if i deploy them together i get the following error
Unable to load configuration. - action -file:/C:/jboss.........struts.xml:60:109
however one of the project works fine.For the other one, welcome page is loaded but none of the actions are performed.It shows this error
HTTP Status 404 - There is no Action mapped for namespace / and action name loginAction
I tried changing package name defined in struts.xml, but no luck
what could be th reason?Do i need to change any configuration in jboss or struts.xml
Ok,finally i made it to work. This post helped me.I added jboss-app.xml file in both of my applications with following content
<jboss-app>
<loader-repository>
com.adc.advertiser:loader=application1.ear
</loader-repository>
</jboss-app>
same for application2.ear
Also in jboss-servie.xml present in deploy directory i changed Java2ClassLoadingCompliance and UseJBossWebLoader to false