hi,
I am developing a web services in netbeans 5.5.1 and using sun application server as my container .
i was able to run the application once....i mean i was able to see my servlet page which is my client but was gettin some exceptions...am not worried abt the exception at the moment...
i went back to the servlet code made some chnges ....and from then on i am gettin a deployment error in build-impl.xml file
here is my error as follows....
In-place deployment at D:\abhijeet_y\C alculatorWSAppl ication\build\w eb
Start registering the project's server resources
Finished registering server resources
moduleID=Calcul atorWSApplicati on
deployment started : 0%
D:\abhijeet_y\C alculatorWSAppl ication\nbproje ct\build-impl.xml:474: Deployment error:
The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 3 minutes 19 seconds)
12 4547 ak1dnar 1,584
Recognized Expert Top Contributor
Just double check whether you are using built in tomcat or sun application server. and your JDK version is?
hi thanx for replyin ......i am using sun java application serv er.......
and my jdk version is 1.5.....
u kno what it sometimes happpen that i have to restart mt server....so it gets deployed sometimes....bu t the odds of that happpening are very less...
am sure there is a soln....
just to give u more details..
am getiin a error on line no 474 in build-impl.xml file....which has clienturlpart and forceredeploy variables...... .
clienturl is already set with a servlet which is the raltive url in
properties file...
but there is no entry for forceredeploy
one more doubt ....
this is my code for servlet....that is my web service client....
/*
* addservlet.java
*
* Created on September 28, 2007, 10:35 AM
*/
package org.me.calculat or;
import java.io.*;
import java.net.*;
import java.rmi.Remote ;
import java.rmi.Remote Exception;
import javax.servlet.* ;
import javax.servlet.h ttp.*;
/**
*
* @author Administrator
* @version
*/
public class addservlet extends HttpServlet {
/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest( HttpServletRequ est request, HttpServletResp onse response)
throws ServletExceptio n, IOException {
response.setCon tentType("text/html;charset=UT F-8");
PrintWriter out = response.getWri ter();
out.println("<h tml>");
out.println("<h ead>");
out.println("<t itle>Servlet addservlet</title>");
out.println("</head>");
out.println("<b ody>");
out.println("<p >Enter the two numbers:</p>");
out.println("<f orm method=\"post\" >");
out.println("<i nput type=\"text\" name=\"no1\" size=\"25\">");
out.println("<i nput type=\"text\" name=\"no2\" size=\"25\">");
out.println("<b r>");
out.println("<p >");
out.println("<i nput type=\"submit\" value=\"Submit\ ">");
out.println("</form>");
String s1 = request.getPara meter("no1");
String s2 = request.getPara meter("no2");
// out.println(req uest.getParamet er("no1"));
// out.println(req uest.getParamet er("no2"));
out.println(s1) ;
out.println(s2) ;
int n1=0;
int n2=0;
if (s1 != null && s2 != null)
{
n1= Integer.parseIn t(s1);
n2=Integer.pars eInt(s2);
// int n1,n2;
// n1= 2 ; n2 = 3;
if ( n1 >=0 && n2 >= 0 ) {
try { // This code block invokes the add operation on web service
out.println(get CalculatorWSSEI Port().add(n1,n 2) );
} catch(java.rmi. RemoteException ex) {
// TODO handle remote exception
out.println("<p >Caught an exception <p>" + ex);
} catch(Exception ex) {
// TODO handle custom exceptions here
out.println("<p >Caught an exception <p>" + ex);
}
}
}
// out.println("<h 1>Servlet addservlet at " + request.getCont extPath () + "</h1>");
out.println("</body>");
out.println("</html>");
out.close();
}
// <editor-fold defaultstate="c ollapsed" desc="HttpServl et methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServl etRequest request, HttpServletResp onse response)
throws ServletExceptio n, IOException {
processRequest( request, response);
}
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServ letRequest request, HttpServletResp onse response)
throws ServletExceptio n, IOException {
processRequest( request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo( ) {
return "Short description";
}
// </editor-fold>
private org.me.calculat or.CalculatorWS getCalculatorWS () {
org.me.calculat or.CalculatorWS calculatorWS = null;
try {
javax.naming.In itialContext ic = new javax.naming.In itialContext();
calculatorWS = (org.me.calcula tor.CalculatorW S) ic.lookup("java :comp/env/service/CalculatorWS");
} catch(javax.nam ing.NamingExcep tion ex) {
// TODO handle JNDI naming exception
}
return calculatorWS;
}
private org.me.calculat or.CalculatorWS SEI getCalculatorWS SEIPort() {
org.me.calculat or.CalculatorWS SEI calculatorWSSEI Port = null;
try {
calculatorWSSEI Port = getCalculatorWS ().getCalculato rWSSEIPort();
} catch(javax.xml .rpc.ServiceExc eption ex) {
// TODO handle service exception
}
return calculatorWSSEI Port;
}
}
whenever the deployment is succesfull..... .i am able to see my servlet...
but when i enter two numbers in the text box.....i get an exception...
as follows.....
Caught an exception
java.rmi.Remote Exception: HTTP transport error: java.net.Malfor medURLException : no protocol: REPLACE_WITH_AC TUAL_URL; nested exception is: HTTP transport error: java.net.Malfor medURLException : no protocol: REPLACE_WITH_AC TUAL_URL
my web service which i creatde simply has two more files.....
.CalculatorWSSE I
.CalculatorWSIm pl
i have included an add function that is it....
your help would be kindly apppreciated... .
ak1dnar 1,584
Recognized Expert Top Contributor
I think you are trying this sample application from the netbeans.org, right?
As I could understand the problem is with your web service, not with the web service client servlet. could you please show us the coding for web service.
yes ur right am doing the sample code....
AND HERE ARE TEH TWO FILES FOR MY WEB SERVICE
-------------------------------------------------------------------------------------------------
1)CalculatorWSI mpl .java
package org.me.calculat or;
import java.rmi.Remote Exception;
public class CalculatorWSImp l implements CalculatorWSSEI {
// Enter web service operations here. (Popup menu: Web Service->Add Operation)
/**
* Web service operation
*/
public int add(int i, int j) throws RemoteException {
// TODO implement operation
int k = i + j ;
return k;
}
}
----------------------------------------------------------------------------------------------------------
2)CalculatorWSS EI.java
package org.me.calculat or;
import java.rmi.Remote ;
import java.rmi.Remote Exception;
public interface CalculatorWSSEI extends Remote {
/**
* Web service operation
*/
public int add(int i, int j) throws RemoteException ;
/**
* Web service operation
*/
}
kindly pls help me ajax am stuck on this problem for a very long time
my web service files are written above
ak1dnar 1,584
Recognized Expert Top Contributor
There is no web service Opration in your Web service. See this "example" here there is a one Named "add" -
package org.me.calc;
-
-
import javax.jws.WebMethod;
-
import javax.jws.WebParam;
-
import javax.jws.WebService;
-
-
@WebService()
-
public class CalcServer {
-
-
-
@WebMethod(operationName = "add")
-
public int add(@WebParam(name = "num1")
-
int num1, @WebParam(name = "num2")
-
int num2) {
-
int resultNum;
-
resultNum=num1+num2;
-
return resultNum;
-
}
-
-
}
NOTE: Please use the CODE Tags
thanx ya u know actually am a starter....
but the problem is still not solved...now the netbeans that am using ...
i copied ur add code...and impoted the pacakes...
but it gives an error sayin.... pacakge javax.jws.WebMe thod;
import javax.jws.WebPa ram;
import javax.jws.WebSe rvice;
does not exixts......
do i have to intall anything else for these packages...
ak1dnar 1,584
Recognized Expert Top Contributor
thanx ya u know actually am a starter....
but the problem is still not solved...now the netbeans that am using ...
i copied ur add code...and impoted the pacakes...
but it gives an error sayin.... pacakge javax.jws.WebMe thod;
import javax.jws.WebPa ram;
import javax.jws.WebSe rvice;
does not exixts......
do i have to intall anything else for these packages...
As the your error describes the JAX-WS is not available in your project library. I'm using netbeans 6 and J2SDK 6 here in my end. So I'm not sure about the configuration settings that much. because I didn't add any of this here.
since you have used 5.5.1, you may have to add the JAX-WS to the application.I'm not sure about this, but you can try. if the jax-ws jar is not there on the "library" (expand project tree view) right click on the library, and you can find "Add jar" or something similar to this. Or from the "update manager" tool you can find the jax-ws. Find out the Jax-ws file url from your tutorial.
Thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: King W.Wang |
last post by:
Hi all,
I've installed NetBeans IDE 3.5 on Windows XP. But if I try to start it,
a message box shows "cannot load jvm.dll". This library does exist in
a subdirectory. My questions are:
1) Is NetBeans IDE 3.5 a stand-alone software, i.e. can it run without
other software, or should a java SDK be installed?
2) If NetBeans can run without java SDK, maybe one must set the path for
|
by: Federico |
last post by:
Hi all,
I don't know if this topic is perhaps a little bit off-topic, anyway I
have a strange problem in transforming an XML file in an HTML file
using XSLT form a Java program written with NetBeans.
I utilize the javax.xml.transform class and in the computer where I
wrote the program all function perfectly, calling the input XML file,
the XSLT stylesheets and setting where to write the output HTML.
|
by: arasub |
last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_12\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\j2sdk_nb\j2sdk1.4.2\bin;C:\Program...
|
by: buzzko |
last post by:
Hi!
I hope someone can help me. I want to connect to a Microsoft SQL Server 2005 Express Edition database programming in C++. I am using Netbeans (with g++ compiler) platform over Windows because I develop Java applications too.
I have tried to use some libraries (f.e. www.sqlapi.com) but I have a lot of problems because when I try to build the project it goes wrong, although I think I have imported all neccesary libraries.
I don´t know...
|
by: buk110 |
last post by:
Hi everyone,
I'm new to using JAVA and I'm trying to interact with a web service I wrote in C#
I downloaded Netbeans & followed the instructions to point to the wsdl file
I navigated to my WSDL file http://localhost/myService/myService.asmx?WSDL
And Looking at the output of 'Web Services Manager' I see the following
| |
by: sokeefe |
last post by:
I use NetBeans IDE to develop a Java application. In the past, I could use the Design Editor to edit my form for the GUI. Spontaneously, NetBeans is unable to open the form file, producing this pop-up message labled as "Information": "The form file format is not recognized. The form cannot be opened."
This error was allegedly fixed in previous versions of NetBeans. I have the latest version of NetBeans and I am getting this error now,...
|
by: myusernotyours |
last post by:
Hi All,
Am working on a Java application in which I have to use the JNI to Interface with some native code for both windows and unix. Am using netbeans IDE with the C/C++ pack installed. Am also using Cygwin as my compiler (gcc), this is ostensibly because I hope this compiler will also compile the unix native libraries since I don't have a Linux installation. (I am working on a personal project from the office and can't get linux installed)....
|
by: sokeefe |
last post by:
I am trying to edit the GUI of a project in Netbeans. In particular, I am trying to add new JButtons. I get a NullPointerException when I try to add an Event to any given JButton (even ones that already exist) in my application using the Design Editor.
I go about this by right-clicking on the JButton in the design editor, navigating to Events -> Action -> actionPerformed. The auto-generated code appears for a brief moment before it...
|
by: uhdam |
last post by:
HI...
In netbeans, whenever i launch the app it loads up and then i get an empty pane where the gui would be.
Initially i used Netbeans 6.5.
Later i used Netbeans 5.0 and had the prob.
so now i shifted to Netbeans 5.5. with jdk 1.6.7 and still the problem persists.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |