Hi!
I have a problem when deploy a web application with web service. I have this error:
Deploying application in domain failed; Deployment Error -- Exception occured in the wsgen process javax.xml.ws.WebServiceException: Unable to create JAXBContext
Deployment error:
The module has not been deployed.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(Unknown Source)
at org.apache.tools.ant.module.run.TargetExecutor.run(Unknown Source)
at org.netbeans.core.execution.RunClassThread.run(Unknown Source)
Caused by: The module has not been deployed.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:157)
... 16 more
BUILD FAILED (total time: 6 seconds)
I use:
Ubuntu Hardy 8.04.1
NetBeans 6.0.1
GlassFish v2ur2
this is the code of EJB Project
[b]LoginSessionBean.java[/b]
package azosp.facades;
import azosp.entities.Admin;
import azosp.entities.Medico;
import azosp.entities.Paziente;
import com.db4o.Db4o;
import com.db4o.ObjectContainer;
import com.db4o.ObjectSet;
import javax.ejb.Stateless;
@Stateless
public class LoginSessionBean implements LoginSessionRemote {
ObjectContainer db = null;
ObjectSet<Object> os = null;
public boolean loginAdmin(Admin admin) {
try {
db = Db4o.openClient("localhost", 4488, "root", "azosp");
String user = admin.getUser().trim().toLowerCase();
String pass = admin.getPassword().trim();
Admin a1 = new Admin(user, pass, null, null);
os = db.get(a1);
if (os.hasNext()) {
return true;
} else {
return false;
}
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
db.close();
}
}
public boolean loginMedico(Medico medico) {
try {
db = Db4o.openClient("localhost", 4488, "root", "azosp");
String user = medico.getUsername().trim().toLowerCase();
String pass = medico.getPassword().trim();
Medico m1 = new Medico(null, null, null, user, pass);
os = db.get(m1);
if (os.hasNext()) {
return true;
} else {
return false;
}
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
db.close();
}
}
public boolean loginPaziente(Paziente paziente) {
try {
db = Db4o.openClient("localhost", 4488, "root", "azosp");
String user = paziente.getCodFisc().trim().toLowerCase();
String pass = paziente.getPassword().trim();
Paziente p1 = new Paziente(user, null, null, null, null, null, null, null, null, null, pass);
os = db.get(p1);
if (os.hasNext()) {
return true;
} else {
return false;
}
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
db.close();
}
}
}
this is the web service in WAR app:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package azosop.web.ws;
import azosp.entities.Admin;
import azosp.entities.Medico;
import azosp.entities.Paziente;
import azosp.facades.LoginSessionRemote;
import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
/**
*
* @author fabio
*/
@WebService()
public class LoginWS {
@EJB
private LoginSessionRemote ejbRef;
// Add business logic below. (Right-click in editor and choose
// "Web Service > Add Operation"
@WebMethod(operationName = "loginAdmin")
public boolean loginAdmin(@WebParam(name = "admin") Admin admin) {
return ejbRef.loginAdmin(admin);
}
@WebMethod(operationName = "loginMedico")
public boolean loginMedico(@WebParam(name = "medic") Medico medico) {
return ejbRef.loginMedico(medico);
}
@WebMethod(operationName = "loginPaziente")
public boolean loginPaziente(@WebParam(name = "paziente") Paziente paziente) {
return ejbRef.loginPaziente(paziente);
}
}
thx
[Message sent by forum member 'fabiomig' (fabiomig)]
http://forums.java.net/jive/thread.jspa?messageID=316921