i created a ws client using wsconsume tool of jboxx 4.2.2 (it's mandatory that i use jboss 4.2.2 for my project).
When i archived and deployed the jar, and used it in my project, it threw a class not found exception.
After the investigation, it turned out that required jaxb libraries are not included in jboss 4.2.2 by default.
I can simply copy the required libraries in from the client folder to server/default/lib from , but i was wondering if there is a configuration i can change to include the client folder by default?
sidenote: i find it strange that i can generate the client but not be able to deploy it without copying the jaxb libraries or adjusting the config, am i missing something?
After the investigation, it turned out that required jaxb libraries are not included in jboss 4.2.2 by default.
Yes. JBoss 4 is ancient, and pre-dates JAXB 2.
i was wondering if there is a configuration i can change to include the client folder by default?
No, you'll need to include the required libraries either in your application itself, or in server/default/lib.
i find it strange that i can generate the client but not be able to deploy it without copying the jaxb libraries or adjusting the config
Generating code is just an exercise in outputting text. It doesn't in itself require the libraries that it generates code to use.
Related
I have created a little example app to test out the CN1 web service functionalities. Following the web service tutorial from CN1 (https://www.codenameone.com/how-do-i---access-remote-webservices-perform-operations-on-the-server.html), I have my Codename one project as client and a dynamic web project running on my Eclipse tomcat server hosting the servlet.
As I have objects that I pass back and forth between client and server, I want both projects to know about these java files. The way to do that is to put the file in one project, and modify the build path of the other to include the first project. This way, the import can resolve the file name just fine.
Question now is: is it better to put the files in one project or the other? Does either way affect the size of the resulting app file that I want to publish in a store? I want to keep the size as small as possible.
Thanks for any tips.
UPDATE: on the preliminary information provided by Shai, files that are to be shared among different projects (either client or server side), do not put your code in either but INSTEAD create a CN1 library for that. This library can then be added to the CN1 buildpath configuration (not the Java build path!) to all required projects.
Here are the details on how and why: https://www.codenameone.com/blog/new-preliminary-library-support.html
Just need to figure out how to do this on Eclipse, as it does not seem to be supported now.
You can use shared code with a cn1lib whose source you can include into the server project manually. In some cases we just copy the shared source files in the build script from one project to the other as it makes the process simpler.
For a normal JSP web-app that provides web-services, where should the JAX-WS library jar files be placed?
<tomcat-home>/lib
or
<web-app>/WEB-INF/lib
and why?
In general, when are library files considered part of the container infrastructure or part of the web application?
DETAILS
I have implemented various JAX-WS web services following, among others, these guides:
https://jax-ws.java.net/2.2.10/docs
https://jaxenter.com/creating-soap-web-services-using-jax-ws-117689.html
http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/
http://examples.javacodegeeks.com/enterprise-java/jws/jax-ws-web-services-on-tomcat/
http://www.java2blog.com/2013/03/jaxws-webservice-deployement-on-tomcat.html
Whilst the above guides were useful, there are differences in terms of both the required JAX-WS library jar files and where the JAX-WS library jar files should reside.
By trial and error, for JDK 1.8, Tomcat 8.0.30 & JAS-WS 2.2.10, this is the list of JAX-WS library jars that seem to be required:
gmbal-api-only.jar
ha-api.jar
jaxb-core.jar
jaxb-impl.jar
jaxws-api.jar
jaxws-rt.jar
management-api.jar
policy.jar
stax-ex.jar
streambuffer.jar
I am aware that the JDK contains some of the JAX-WS classes but these seem to be meant for standalone Java apps
ie all of the above jar files seem to be needed to avoid a ClassNotFoundException etc.
I have read the Tomcat 8 class-loader how-to
and appreciate that there is a parent-tree, hierarchal class loader and that jar files in:
<web-app>/WEB-INF/lib
are only available to that web app ie are hidden from other web apps
causes the app war file(s) to be bloated as each web app has it’s own copy
and that jar files in:
<tomcat-home>/lib
are available to and shared by all web apps
forces all web apps to use the same version of the library
libraries must be inter web-app shareable ie no statics, thread-safe etc
enables lookup via a JNDI Resource Factory eg JDBC, mail etc
suppresses memory leaks for DriverManager eg JDBC
The web services seem to work when the JAX-WS library jar files are in either location.
Looking at the Metro JAX-WS project,
where the JAX-WS library jars must be downloaded from, for now, I have put these into <tomcat-home>/lib as that is consistent with the ‘install’ option in the ant file.
As a general rule, I try not to pollute the web-container / app-server with unnecessary library jar files where possible as this can lead to conflicts for other web-apps that have to use a specific version of a required library.
Thanks for reading.
Had the same issue trying to deploy a web service to my local tomcat installation. I went the route of adding the jars you listed to get it going, but see the instructions of what's needed from Apache:
https://tomcat.apache.org/tomcat-8.0-doc/extras.html#Web_Services_support_(JSR_109)
...which I think will go a long way to minimizing the amount of jars that end up in your Tomcat's lib folder.
I have findout ChilkatDotNet2.dll library is located in sitecore bin folder and can't be load in case if enabled 32-bit app support in app pool.
I removed this library and it seem like web site is working fine.
Is it necessary for Sitecore to have it?
The library might have been installed on your Sitecore instance with a module (I believe the Email Campaign Manager uses it). If that's the case, the module installation files probably contain both a 32-bit and a 64-bit version and it would be up to you to use the correct one for your system.
That library is not part of the libraries that ship with Sitecore.
So removing it won't have any effect on Sitecore, but may have on custom parts of your application.
I try to embed (use) Jetty into my JavaFX 2.2 applet (which runs in a browser).
My problem is that, to host servlets I need to include the servlet-api-3.0.jar also (for javax.servlet namespaces) besides jetty-server.jar, jetty-servlet.jar and jetty-util.jar.
If I include the servlet-api.jar, my project compiles, but when I run it inside the browser, the deployment fails with the "JavaFX application could not launch due to system configuration (show error details). See java.com/javafx for troubleshooting information." error message.
If I remove the servlet-api.jar (and remove the relevant source) it deploys again.
For the JavaFX project the Java Platform is set to "Default JavaFX Platform", and it would be good to keep it this way to reduce the minimum footprint required.
I'm not a java(fx) expert (I come from .NET world), so I'd appreciate any help!
You have an issue with signing the JARs. I'm not very familiar with signing JARs for JavaFX but here is the documentation:
http://docs.oracle.com/javafx/2/deployment/packaging.htm#BABJGFBH
http://docs.oracle.com/javafx/2/deployment/javafx_ant_task_reference001.htm#CIAFJGAB
servlet-api-3.0.jar is what's known as a provided dependency.
It is not needed to be included in your war file, as the web app container (in this case Jetty) provides it for you. In your build tool, just exclude the servlet-api.jar from being bundled in your war file.
Note: jetty-server-9.0.0.M5.jar is also a provided dependency and has the same rules.
I'm using WebSphere 6.1 with the EBJ3 Feature Pack installed. Does anyone know what jar I need to include in my project from the AppServer folder of my WebSphere installation in order to be able to use the #WebService annoation? I cannot seem to find it. Thanks.
You will require either:
The webservice Feature Pack for Websphere 6.1 http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21264563
A JAXWS implementation, such the Reference Implementation http://jax-ws.java.net/
Pay attention to the order of installation of the Websphere Feature Packs
WAS_HOME/lib/j2ee.jar
Note that in WAS 7.0+, all JARs needed for development are located in WAS_HOME/dev/.
WAS_HOME/plugins/ - com.ibm.jaxws.tools_6.1.0.jar
You may also need to include com.ibm.jaxb.tools, com.ibm.ws.runtime and org.apache.axis2 jars too.