473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

netbeans and web services error

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\CalculatorWSApplication\build\web
Start registering the project's server resources
Finished registering server resources
moduleID=CalculatorWSApplication
deployment started : 0%
D:\abhijeet_y\CalculatorWSApplication\nbproject\bu ild-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)
Sep 28 '07 #1
12 4498
ak1dnar
1,584 Expert 1GB
Just double check whether you are using built in tomcat or sun application server. and your JDK version is?
Sep 28 '07 #2
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....but 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
Sep 29 '07 #3
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.calculator;

import java.io.*;
import java.net.*;
import java.rmi.Remote;
import java.rmi.RemoteException;
import javax.servlet.*;
import javax.servlet.http.*;

/**
*
* @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(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();

out.println("<html>");
out.println("<head>");
out.println("<title>Servlet addservlet</title>");
out.println("</head>");
out.println("<body>");

out.println("<p>Enter the two numbers:</p>");
out.println("<form method=\"post\">");
out.println("<input type=\"text\" name=\"no1\" size=\"25\">");
out.println("<input type=\"text\" name=\"no2\" size=\"25\">");
out.println("<br>");
out.println("<p>");
out.println("<input type=\"submit\" value=\"Submit\">");
out.println("</form>");


String s1 = request.getParameter("no1");
String s2 = request.getParameter("no2");

// out.println(request.getParameter("no1"));
// out.println(request.getParameter("no2"));
out.println(s1);
out.println(s2);
int n1=0;
int n2=0;
if (s1 != null && s2 != null)
{
n1= Integer.parseInt(s1);
n2=Integer.parseInt(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(getCalculatorWSSEIPort().add(n1,n2) );
} 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("<h1>Servlet addservlet at " + request.getContextPath () + "</h1>");
out.println("</body>");
out.println("</html>");

out.close();
}

// <editor-fold defaultstate="collapsed" desc="HttpServlet 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(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}
// </editor-fold>

private org.me.calculator.CalculatorWS getCalculatorWS() {
org.me.calculator.CalculatorWS calculatorWS = null;
try {
javax.naming.InitialContext ic = new javax.naming.InitialContext();
calculatorWS = (org.me.calculator.CalculatorWS) ic.lookup("java:comp/env/service/CalculatorWS");
} catch(javax.naming.NamingException ex) {
// TODO handle JNDI naming exception
}
return calculatorWS;
}

private org.me.calculator.CalculatorWSSEI getCalculatorWSSEIPort() {
org.me.calculator.CalculatorWSSEI calculatorWSSEIPort = null;
try {
calculatorWSSEIPort = getCalculatorWS().getCalculatorWSSEIPort();
} catch(javax.xml.rpc.ServiceException ex) {
// TODO handle service exception
}
return calculatorWSSEIPort;
}
}


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.RemoteException: HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL; nested exception is: HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL

my web service which i creatde simply has two more files.....

.CalculatorWSSEI
.CalculatorWSImpl
i have included an add function that is it....


your help would be kindly apppreciated....
Sep 29 '07 #4
ak1dnar
1,584 Expert 1GB
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.
Sep 29 '07 #5
yes ur right am doing the sample code....

AND HERE ARE TEH TWO FILES FOR MY WEB SERVICE
-------------------------------------------------------------------------------------------------
1)CalculatorWSImpl .java
package org.me.calculator;

import java.rmi.RemoteException;

public class CalculatorWSImpl 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)CalculatorWSSEI.java

package org.me.calculator;

import java.rmi.Remote;
import java.rmi.RemoteException;


public interface CalculatorWSSEI extends Remote {
/**
* Web service operation
*/
public int add(int i, int j) throws RemoteException;

/**
* Web service operation
*/


}
Oct 3 '07 #6
kindly pls help me ajax am stuck on this problem for a very long time

my web service files are written above
Oct 5 '07 #7
ak1dnar
1,584 Expert 1GB
There is no web service Opration in your Web service. See this "example" here there is a one Named "add"
Expand|Select|Wrap|Line Numbers
  1. package org.me.calc;
  2.  
  3. import javax.jws.WebMethod;
  4. import javax.jws.WebParam;
  5. import javax.jws.WebService;
  6.  
  7. @WebService()
  8. public class CalcServer {
  9.  
  10.  
  11.     @WebMethod(operationName = "add")
  12.     public int add(@WebParam(name = "num1")
  13.     int num1, @WebParam(name = "num2")
  14.     int num2) {
  15.         int resultNum;
  16.         resultNum=num1+num2;
  17.      return resultNum;
  18.     }
  19.  
  20. }
NOTE: Please use the CODE Tags
Oct 5 '07 #8
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.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

does not exixts......


do i have to intall anything else for these packages...
Oct 8 '07 #9
ak1dnar
1,584 Expert 1GB
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.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

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!
Oct 8 '07 #10
Thanx a ton .....it works ...u saved a lot of time and certainly made my day.. i just had to install java webservice development pack....and add the xxx.jar in the project as u said....

actually am a starter at this as i said before...

i just need 3 more answers to my questions below

1)for every function do we have to mention @WebMethod
as it is in ur add method ...but was not in mine....i mean wat is the significance. of that is it a keyword or something.....i mean i was doin a sample eg...so didi not find that @webmethod thing......

2)can u provide me link where i can study the basics of web services..
actually am confused as to where to start of from

3)and wat are the pre-requirement for studying web services...

i am well verse with core java,servlets,jsp,
Oct 9 '07 #11
ak1dnar
1,584 Expert 1GB
Glad you got it working.

1)for every function do we have to mention @WebMethod
as it is in ur add method ...but was not in mine....i mean wat is the significance. of that is it a keyword or something.....i mean i was doin a sample eg...so didi not find that @webmethod thing......
For each and every "operation" there you have to set @WebMethod annotation. and "add" is the operation(method) name for my sample. you can use any name for this.
2)can u provide me link where i can study the basics of web services..
actually am confused as to where to start of from
Since your IDE is netbeans refer to netbeans docs.
3)and wat are the pre-requirement for studying web services...
ummm....may be one of our expert will be able to answer for this. read the documentation, that's enough if you know how to absorb 'em.
Oct 10 '07 #12
thanx a ton once again for all that help...

Regards abhi
Oct 11 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
0
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...
3
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...
1
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...
0
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...
0
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...
2
myusernotyours
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...
1
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...
1
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. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.