WebServiceexception "No Content-type in the header" when trying to consume JBoss hosted webservice with a console application - eclipse

I have a small assignment where I have to consume a webservice hosted with JBoss using a console application.
I have 2 projects in the same workspace, The DynamicWebApplication that I used as a webservice that is hosted using JBoss and a console application to access it. The console application also has the java files generated with wsimport
I am using the Eclipse IDE and whilst searching through the internet I found that I needed to copy the libraries found in JBOSS_HOME/common/lib to JBOSS_HOME/lib/endorsed but I still have the issue. Any ideas on why this is occurring?
PS. These are the libraries that I copied:
jbossws-native-jaxrpc.jar
jbossws-native-jaxws.jar
jbossws-native-jaxws-ext.jar
jbossws-native-saaj.jar

Ok I found the solution the the problem. Apparently I had to add the following code in the vm arguements:
-Djava.endorsed.dirs=/path-to/jboss-5.1.0.GA/lib/endorsed

Related

Entreprise-Application deployed succesfully but it is not running

I am trying to develop my first web-application based on java-EE. This application should be deployed on WildFly application server. For That purpose, I made my inspiration from https://bitbucket.org/lassitercg/example/src.
I made some modifications on my Code.
I am developing this application using IntelliJ-Community. The Application was successfully deployed.
whenever I try to access the application using the following URL localhost:8080/startweb, I get the http status code 404. The code can be found unter this link https://github.com/amitakCsNew/startweb
Since I using Intellij Community edition, I am forced to deploy the application then set the breakpoint in the Controller of the application. The application seems to be succesfully deployed, but I am not jumping to the first breakpoint.
any Idea how I can solve this problem ?
Your webapp layout is wrong. Please refer to the standard Maven directories layout.
You need to move webapp directory to src/main. Then update pom.xml file reference to web.xml, then move META-INF from resources into webapp then fix your syntax errors in index.xhtml (the same h namespace is associated with 2 different URLs), then fix/implement your database, then add faces servlet in web.xml, add faces-config.xml, then your web app should be available at http://localhost:8080/startweb/.
Once you resolve all the problems and the controller code finally executes, you will be able to debug it from the IDE using Remote debug configuration.
If you are new to all of this, I'd suggest starting with something more simple, like a single JSP page and a single Java servlet.
Post the new questions if you have issues describing what you did to solve the problem and what exactly didn't work. The current question is too broad and your sample project has too many issues to cover in the single answer.

SOAP Web Service Client conflcts with xfire

I generated wsdl using wsimport from JDK 1.6. I then wrote a client to invoke the web service I got the following error.
java.lang.IllegalStateException: Could not initialize Service.
at org.codehaus.xfire.jaxws.ServiceDelegate.<init>(ServiceDelegate.java:77)
at org.codehaus.xfire.jaxws.Provider.createServiceDelegate(Provider.java:32)
at javax.xml.ws.Service.<init>(Service.java:56)
Then I removed xfire-all 1.2.6 jar used in my
application and found it working but only if the class was invoked from command line and not from application functionality which is the real need as removing xfire jar is not an option for me..Please help I read numberyyy of posts but did not get any fruitful solution yet.
Thanks in advance

Deploying .ear file (contains rest services)

I have a few questions about deploying my .ear file (was provided to me, the file itself should not be the problem). I set up jBoss application server jboss-6.0.0.Final and was able to run a simple hello world app to ensure the server was functioning properly.
I was told to place the .ear file in /server/default/deploy so I did. When I ran jboss (through /bin/run.bat) I got no errors related to deploying the ear file.
Question
Is this all the software I need (jBoss)? Do I also need something like Apache or tomcat?
The .ear file contains RESTful service calls that should return xml. Will these be deployed (accessible through a jQuery ajax call after the server (jboss/bin/run.bat) is executed?
Currently when I try to make the calls, the resources do not seem to exist.
Thanks in advance for taking the time to help.
JBoss AS ships with an embedded Tomcat as a servlet container so you really don't need that anymore. Apache Web Server is NOT required for your .EAR to be deployed properly.
To answer your questions
No other software is needed to deploy the EAR. You simply copy your EAR file to deploy directory (which you have rightfully done so).
If your EAR contains RESTFul services, they will be deployed and you can access them using any client including jQuery or even a simple browsers. The trick is to know the access URL to the RESTFul services.
If you have difficulty identifying the URL for accessing your RESTFul services please refer [1] for more information.
Hope this helps.
Good luck!
[1] https://docs.jboss.org/author/display/AS7/JAX-RS+Reference+Guide
I can answer the first question. You need apache if you want to serve static content or you need to isolate the traffic (say keep apache in the dmz and then use apache to proxy traffic to the internal jboss servers). tomcat is bundled along with jboss, so you do not need it.

404 error when trying to run PHP application on Glassfish 3.1.1 through Netbeans

While there are some similar posts about this issue, none seem to fit my problem exactly, so I would like to ask if anyone knows what I am doing wrong.
I am trying to run a PHP web application that I created in Netbeans. I am using Glassfish 3.1.1 as the web server. Whenever I run the application through Netbeans (by selecting the project, right clicking to get the context menu, then selecting "Run"), my browser opens to what I believe to be the correct url, but all I get is a 404 error page stating the following:
type: Status report
message:
description:The requested resource () is not available.
Am I missing some crucial configuration step?
I have checked my hosts file and it contains the entry:
127.0.0.1 localhost
Is there something else I need to do?
I have PHP 5.3.8 installed and all php commands run from the command line.
Would it be something in the php.ini file that needs to be configured?
I am stumped. Any help would be greatly appreciated.
ANSWERED
Please accept the comment below from Jonathan Spooner as the correct answer.
Just install Quercus within GlassFish 3.x and you can run PHP and Java.
As I stated in the comments, GlassFish and Apache Tomcat are Java application servers. In order to serve PHP pages you'll need to install a web server such as Apache HTTP web server. You'll also need to configure Apache to serve PHP files.
Something that you might look into is WAMP (Windows/Apache/MySql/PHP). This offers a simple way to get up and running quickly with little to no configuration.

Unable to create Web Service Client from WSDL URL in NetBeans

I'm trying to create a Web Service Client using the option WSDL URL in NetBeans IDE 7.0. Unfortunately, it is not able to create one and is failing with the following error:
Saxon cannot write a DOMResult unless saxon9-dom.jar is on the classpath
After seeing this error message, I even confirmed whether saxon9-dom.jar is added to the Libraries in NetBeans. Yes, it is already available. I don't know why still the error is appearing. Can somebody let me know what is going wrong?
I'm trying to create web service client for this WSDL. I'm choosing JAX-WS Style in Client Style option while creating New Web Service Client in NetBeans.
UPDATE:
After googling, I read about some clues from the following 2 places:
1) http://www.mail-archive.com/fop-dev#xmlgraphics.apache.org/msg09659.html
This is due to the new event-handling framework that has been added
after 0.95. The step in the build process that generates the resource
files for the various messages, seems to require a writable DOM
implementation.
As the message indicates, Saxon offers such an implementation in a
separate JAR, which needs to be added to the classpath when building
FOP Trunk.
2) http://xmlbeans.apache.org/sourceAndBinaries/index.html
Using XPath/XQuery requires an additional download of
saxonb9-0-0-4j.zip and placing on the classpath of the files
saxon9.jar and saxon9-dom.jar that it contains. The zip is available
here. We cannot distribute this zip in a binary distribution due to
licensing issues.
So, I thought of changing saxon9-dom.jar in the classpath. I was using saxon9-dom.jar from saxonb9-1-0-8j.zip before, but when I tried to include saxon9-dom.jar available in saxonb9-0-0-8j.zip, now this error has disappeared and am getting a different error now as shown below. Any ideas/clues?
Web Services are described using WSDL files, so in order to create a Web Consumer for them you'll have to specify the WSDL url.
You can obtain it by adding ?WSDL ar the and of the url.
For example:
CrudService.asmx becomes
CrudService.asmx?WSDL
(It you have tested your web service and it appears ?Tester at the end, just replace it with ?WSDL).