Defining relative path for an application in IBM WebSphere - xsd

I have a couple of XSD's in my application. Something like the below,
XSD
common
common.xsd
request
request.xsd
response
response.xsd
I have to use the common.xsd in the request and response xsd's. So I have used import statement. The config is as below,
<xsd:import namespace="www.some.namespace.com" schemaLocation="../common/common.xsd"/>
The problem here is, this works absolutely fine in Tomcat. But when I deploy the same application in WebSphere, it is throwing error as file not found. In the logs, I could see WebSpher is looking for the xsd in the IBM installation folder. The path it is looking is, "C:/IBM installation folder/common/common.xsd".
Can anyone help ?
Thanks in advance.

Just remove the schemaLocation attribute of the import element. Just keep the namespace attribute alone and be sure that you are importing the correct namespace.

Related

node-soap working differently with different wsdl files. I am getting this error "TypeError: Cannot read property 'postProcess' of undefined"

I am using node-soap to create a soap client. I have tried with different WSDL files and worked fine but one WSDL file seems complex. I tested this WSDL with SOAPUI and worked fine. But if I try to create a soap client, it is throwing the following error. Any help really appreciated!!!
TypeError: Cannot read property 'postProcess' of undefined
I am sharing the link to the WSDL file.
WSDL link
Full-stack trace of error
*TypeError: Cannot read property 'postProcess' of undefined
at OperationElement.postProcess (D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\elements.ts:874:15)
at PortTypeElement.postProcess (D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\elements.ts:914:13)
at BindingElement.postProcess (D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\elements.ts:968:16)
at ServiceElement.postProcess (D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\elements.ts:1042:19)
at D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\index.ts:112:30
at WSDL._processNextInclude (D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\index.ts:1186:14)
at WSDL.processIncludes (D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\index.ts:173:10)
at D:\MY_PROJECTS\NODE-SOAP\node-soap-ts\node_modules\soap\src\wsdl\index.ts:101:12
at processTicksAndRejections (internal/process/task_queues.js:75:11)*
I had the same issue with one of the WSDL files. I would like to add something here. Try to add the extension Wizdler which is available in chrome. Once you try to open the code in chrome and run the extension, you can easily find out the data model and the methods used in the WSDL file. So, with your WSDL file, this is what I got as the result in Wizdler.
This might be helpful to resolve your issue.

Why is micronaut invoking the wrong controller method?

I have a micronaut API like this:
#Get("/")
List<Club> listClubs()
#Get("/{id}")
Club show(Long id)
In my unit test, when I invoke the show method, the listClubs() method is actually getting invoked, instead.
Why is this happening?
Details:
Thinking that my URL mappings must be wrong, I started debugging into Netty to try to understand how the framework constructs URLs.
In HttpClientIntroductionAdvice, the context shows the API method like this:
Club show(Long param0)
The interceptor is setting param0 in the parameter map, which doesn't match the actual parameter name of my method. When the URI template is expanded, this causes the ID to get dropped (thus the URI becomes / instead of /1).
I am trying to follow this example:
https://github.com/alvarosanchez/micronaut-workshop/tree/master/ex02/solution/clubs
There is one important different in my project, which is that the endpoint is set at "/club" instead of at "/":
#Controller("/club")
#Client("/club")
I am using a diff tool to compare my project to the sample, but I am struggling to find any other difference (besides package name changes).
Why is this happening? What should I be looking for?
Thanks
Update:
Tested the target endpoint with the browser - looks fine.
Gradle clean does not resolve the issue.
I switched from debugging the Application class with IntelliJ to using "gradlew run" and in the process, I made a change to build.gradle (adding JVM properties pass-through from the gradle CLI). I also played with enabling/disabling the annotation processor in the IDE.
(note: In the previous project, I enabled annotation processing as soon as I imported into the IDE. On this project, I didn't enable it until I started having issues.)
I think the build.gradle alteration caused the problem to go away. Since the issue shows up unreliably, it's hard to tell for certain if this is the change that caused it to be fixed.

JavaLite ActiveWeb rootPackage

I'm developing a web application with ActiveWeb. I wanted to change the package from app.controller to be.coudron.graphplanner.controller
I created a file activewebproperties and placed it in src/main/resources
the contents of the file are:
freeMarkerConfig=be.coudron.graphplanner.config.FreeMarkerConfig
bootstrap=be.coudron.graphplanner.config.AppBootstrap
dbconfig=be.coudron.graphplanner.config.DbConfig
route_config=be.coudron.graphplanner.config.RouteConfig
controllerConfig=be.coudron.graphplanner.config.AppControllerConfig
rootPackage=be.coudron.graphplanner
When I start the app with mvn jetty:run
I get the error:
org.javalite.activeweb.ControllerException: controller must be
in the 'app.controllers' package
What am i doing wrong?
There are no typos in the code nor the package names.
the exception message is self-explanatory: "controller must be in the 'app.controllers' package"
The file activeweb.properties is part of the framework and not editable. With time, you will appreciate simplicity and consistency of the framework. It requires that controllers are placed into app.controllers package. Please, refer to http://javalite.io/structure_of_activeweb_project#location-of-controllers

h:outputStylesheet and h:graphicImage not working?

I am using h:outputStylesheet and h:graphicImage in my .xhtml files. It works completely fine on my localhost.
Now I tried to upload my .war it on Hosting space provider which uses NGASI AppServer Manager.
Here, h:outputStylesheet and h:graphicImage tags have stopped functioning. What I noticed is that everything with pattern /ctx/faces/javax.faces.resource/....?ln=.... is giving 404: (Not found) error.
For ex:
http://www.edarena.com/EdArena/faces/javax.faces.resource/theme_edarena.css?ln=css
http://www.edarena.com/EdArena/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development
http://www.edarena.com/EdArena/faces/javax.faces.resource/THEME_EDARENA/logo.png?ln=images
All the .xhtml files in app root are getting accessed properly, which means the mapping /faces/* to Faces Servlet is correct in web.xml.
My first impression was that the image or resource path is somehow not getting determined.
But I just tried renaming my file resources/images/THEME_EDARENA/logo.png to logo1.png.
After this when I refresh my pages using this image, I get message 'Unable to find resource THEME_EDARENA/logo.png' in my tag. If I make it logo.png, the error messages goes away, which means the file is found but something goes wrong while rendering it.
Thanks for any help.
Please suggest something.
BR
Anand

Problems consuming web service from groovy script

I'm having some problems trying to consume a web service from a groovy script. I'm using WSClient lib.
If I execute the example posted at groovy's website:
#Grab(group='org.codehaus.groovy.modules', module='groovyws', version='0.5.2')
import groovyx.net.ws.WSClient
proxy = new WSClient("http://www.w3schools.com/webservices/tempconvert.asmx?WSDL", this.class.classLoader)
proxy.initialize()
result = proxy.CelsiusToFahrenheit(0)
println "You are probably freezing at ${result} degrees Farhenheit"
Works fine, but once I try to consume another service it crashes with this error:
INFO: Created classes: javac: no
source files Usage: javac
use -help for a list
of possible options 07-jul-2010
9:55:57
org.apache.cxf.endpoint.dynamic.DynamicClientFactory
createC lient GRAVE: Could not compile
java files for http://xxx:8080/x/services/xxx?wsdl.
Caught:
groovyx.net.ws.exceptions.InvokeException:
java.lang.NullPointerExceptio n
at groovy-ws.run(groovy-ws.groovy:13)
The code it's exactly the same (apart from wsdl url which correponds to one internal server). The main difference I found between them is that the second wsdl is RPC style while the first one isn't. I've read that there's some problems to consume RPC like webservices from groovy with WSClient lib. ¿Does anyone know how to consume RPC like webservices with WSClient? ¿Could anyone enlighten me please?
Thank you very much
There seems to be a bug in GroovyWS, documented here on their JIRA.
It's currently Unresolved and was added in 2010.
I'm personally getting the same error with anything other than the trivial example service, with Groovy 1.8.0, GroovyWS 0.5.2
Hopefully somebody can find the issue and fix it - WSClient could definitely be a great alternative to traditional CXF/JAXB
Don't use WSClient is the best answer I can give you. For anything but simple services I've found WSClient does not work well. Instead use what ever java based web service client your most comfortable with and call it from Groovy.

Resources