- This topic has 17 replies, 4 voices, and was last updated 15 years, 9 months ago by Brian Fernandes.
-
AuthorPosts
-
mikelmikeMemberI created a JAX-WS bottom-up Web Service using MyEclipse wizard.
It works just fine.
Then I needed to update it. Using same wizard, I called New Web Service item, then went on to New Web Service dialog. When I entered class name for the Java Bean field, Delegate Class Name field remains disabled. After clicking Finish button, I receive an error:
An internal error occurred during: “Generating JAX-WS Web Services”.
java.lang.NullPointerExceptionHere’s what is in the Log file:
!ENTRY org.eclipse.core.jobs 4 2 2009-01-09 15:17:04.390
!MESSAGE An internal error occurred during: “Generating JAX-WS Web Services”.
!STACK 0
java.lang.NullPointerException
at com.genuitec.eclipse.ws.jaxws.WEBXMLFile.addEndpoints(WEBXMLFile.java:78)
at com.genuitec.eclipse.ws.jaxws.JAXWSJob.manageWEBXML(JAXWSJob.java:409)
at com.genuitec.eclipse.ws.jaxws.JaxWSBUJob.manageWSDescriptors(JaxWSBUJob.java:155)
at com.genuitec.eclipse.ws.jaxws.JaxWSBUJob.run(JaxWSBUJob.java:133)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)Please help,
Mike
Loyal WaterMemberCan you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.
You were trying to update an existing web service.
mikelmikeMember*** Date:
Monday, January 12, 2009 2:42:58 PM EST** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_16*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 6.6.0
Build id: 6.6.0-20081015*** Eclipse details:
MyEclipse Enterprise WorkbenchVersion: 6.6.0
Build id: 6.6.0-20081015Eclipse Platform
Version: 3.3.3.r33x_r20080129-_19UEl7Ezk_gXF1kouft
Build id: M20080221-1800Eclipse RCP
Version: 3.3.3.r33x_r20080129-8y8eE9UEUWI6qujeED0xT7bc
Build id: M20080221-1800Eclipse Java Development Tools
Version: 3.3.2.r33x_r20080129-7o7jE7_EDhYDiyVEnjb1pFd7ZGD7
Build id: M20080221-1800Eclipse Plug-in Development Environment
Version: 3.3.3.r33x_r20080129-7N7M5DQVIA_6oJsEFkEL
Build id: M20080221-1800
Loyal WaterMembermikelmike,
I have asked the dev team to look into this issue. They will get back to you with an update asap.
Brian FernandesModeratorMike,
Using same wizard, I called New Web Service item, then went on to New Web Service dialog. When I entered class name for the Java Bean field, Delegate Class Name field remains disabled.
Which class name did you enter? Did you specify the same class you did in the first pass (after modifying it) or did you specify the delegate class that was generated by the first pass?
From the stack trace, it looks like a port name is not being specified in the wizard.
Are any errors logged when you select the class in the wizard the second time? Can you paste the contents of the modified class here?
mikelmikeMemberBrian – I spedified the same class name that I enered first time. Once I enter the class name, delegate class field is empty and disabled. There are no errors in the log file after I enter the class name.
The content of the modified class is as follows:package partners.ecrs;
import ilog.rules.bres.session.IlrRuleSessionCreationException;
import ilog.rules.bres.session.IlrRuleSessionException;
import ilog.rules.bres.session.IlrRuleSessionProvider;
import ilog.rules.bres.session.IlrRuleSessionProviderFactory;
import ilog.rules.bres.session.IlrSessionDescriptor;
import ilog.rules.bres.session.IlrSessionExecutionSettings;
import ilog.rules.bres.session.IlrSessionParameters;
import ilog.rules.bres.session.IlrSessionRequest;
import ilog.rules.bres.session.IlrSessionResponse;
import ilog.rules.bres.session.IlrStatelessRuleSession;import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;import javax.jws.WebMethod;
import javax.jws.WebService;import service.AHRQRequest;
import service.AHRQResponse;
import service.CCHRequest;
import service.CCHResponse;
import utilityClasses.Quantity;
import ecrsBase.Code;
import ecrsBase.FocusedRange;
import ecrsBase.Observation;
import ecrsBase.Patient;
import ecrsBase.TargetList;
@WebService
public class RulesService {@WebMethod
public CCHResponse getAssertions(CCHRequest request, CCHResponse response){Patient retPatient = null;
try {retPatient = (Patient)execute(request, IlrRuleSessionProviderFactory.SIMPLE_RULESESSION_PROVIDER).
getExecutionResult().getOutputParameters().
getObjectValue(“patient”);
response.setAssertions(retPatient.getAssertions());}catch(Exception ex){
System.out.println(“Error getting local rule session provider”);
try {
retPatient = (Patient)execute
(request, IlrRuleSessionProviderFactory.REMOTE_RULESESSION_PROVIDER).
getExecutionResult().getOutputParameters().
getObjectValue(“patient”);
response.setAssertions(retPatient.getAssertions());} catch (IlrRuleSessionException rex){
rex.printStackTrace();
} catch (RemoteException re){
ArrayList<String> l = new ArrayList<String> ();
l.add(“There was an error processing your request.”);
response.setAssertions(l);
} catch (Exception e){
System.out.println(“Could not get any session provider”);
}
}return response;
}@WebMethod
public AHRQResponse executeRules(AHRQRequest request, AHRQResponse response) {
AHRQResponse Response = new AHRQResponse (“”);
return Response;
}private IlrSessionResponse execute(CCHRequest request, String requestType)
throws IlrRuleSessionException, RemoteException
{
// Get a provider of the specified type for a rule session invocationIlrRuleSessionProvider sessionProvider = RuleSessionProvider.
getInstance().
getRuleSession(requestType);IlrStatelessRuleSession ruleSession = sessionProvider.createStatelessRuleSession();
// Create a session request object
IlrSessionRequest sessionRequest = new IlrSessionRequest(“/CCHRuleApp/CHCSAdvancedRules”);// Set the input parameters for the execution of the rules
IlrSessionExecutionSettings sessionExecutionSettings = sessionRequest
.getExecutionSettings();
IlrSessionParameters inputParameters = sessionExecutionSettings
.getInputParameters();Patient p = new Patient();
// Populate Patient object with the data from CCH Request
// ID
p.setId(request.getPatient().getId());// Observations
p.setObservations(getObservations(request));
TargetList listOfTargets = null;
// create the object
listOfTargets = getTargets(request);
// add it in the mapinputParameters.setParameter(“patient”, p);
inputParameters.setParameter(“listOfTargets”, listOfTargets);
IlrSessionDescriptor sessionDescriptor = sessionRequest
.getSessionDescriptor();
sessionDescriptor.enableTrace();
// Execute the rules and returns the response
return ruleSession.executeRules(sessionRequest);
}private static List<Code> getCodes() {
ArrayList<Code> list = new ArrayList<Code>();list.add(new Code(“LOINC CODE”,”12345F”,”Systolic BP”));
list.add(new Code(“LOINC CODE”,”12345E”,”Diastolic BP”));
list.add(new Code(“LOINC CODE”,”12577P”,”Pulse”));
list.add(new Code(“LOINC CODE”,”12476DW”,”Daily Weight Gain”));
list.add(new Code(“LOINC CODE”,”12476WW”,”Weekly Weight Gain”));
list.add(new Code(“LOINC CODE”,”33556O2″,”SPO2″));return list;
}private static ArrayList<Observation> getObservations(CCHRequest request) {
ArrayList<Observation> list = new ArrayList<Observation>();Observation o = new Observation();
o.setReferenceID(new Code(“LOINC CODE”,”12345F”,”Systolic BP”));
Quantity q = new Quantity();
q.setAmount(request.getPatient().getSystolicBP());
q.setUnits(“mmHg”);
o.setMeasurement(q);
list.add(o);o = new Observation();
o.setReferenceID(new Code(“LOINC CODE”,”12345E”,”Diastolic BP”));
q = new Quantity();
q.setAmount(request.getPatient().getDiastolicBP());
q.setUnits(“mmHg”);
o.setMeasurement(q);
list.add(o);o = new Observation();
o.setReferenceID(new Code(“LOINC CODE”,”12577P”,”Pulse”));
q = new Quantity();
q.setAmount(request.getPatient().getPulse());
q.setUnits(“bpm”);
o.setMeasurement(q);
list.add(o);o = new Observation();
o.setReferenceID(new Code(“LOINC CODE”,”33556O2″,”SPO2″));
q = new Quantity();
q.setAmount(request.getPatient().getSPO2());
q.setUnits(“”);
o.setMeasurement(q);
list.add(o);o = new Observation();
o.setReferenceID(new Code(“LOINC CODE”,”12476DW”,”Daily Weight Gain”));
q = new Quantity();
q.setAmount(request.getPatient().getDailyWeightGain());
q.setUnits(“lbs”);
o.setMeasurement(q);
list.add(o);o = new Observation();
o.setReferenceID(new Code(“LOINC CODE”,”12476WW”,”Weekly Weight Gain”));
q = new Quantity();
q.setAmount(request.getPatient().getWeeklyWeightGain());
q.setUnits(“lbs”);
o.setMeasurement(q);
list.add(o);
return list;
}private static TargetList getTargets(CCHRequest request) {
TargetList list = new TargetList();
FocusedRange target = new FocusedRange();
target.setPatientID(request.getPatient().getId());
target.setReferenceID(new Code(“LOINC CODE”,”12345F”,”Systolic BP”));
Quantity q1 = new Quantity();
q1.setAmount(request.getPatient().getMinTargetSystolicBP());
Quantity q2 = new Quantity();
q2.setAmount(request.getPatient().getMaxTargetSystolicBP());
target.setMin(q1);
target.setMax(q2);
list.addTarget(target);target = new FocusedRange();
target.setPatientID(request.getPatient().getId());
target.setReferenceID(new Code(“LOINC CODE”,”12345F”,”Diastolic BP”));
q1 = new Quantity();
q1.setAmount(request.getPatient().getMinTargetDiastolicBP());
q2 = new Quantity();
q2.setAmount(request.getPatient().getMaxTargetDiastolicBP());
target.setMin(q1);
target.setMax(q2);
list.addTarget(target);target = new FocusedRange();
target.setPatientID(request.getPatient().getId());
target.setReferenceID(new Code(“LOINC CODE”,”12345F”,”Pulse”));
q1 = new Quantity();
q1.setAmount(request.getPatient().getMinTargetPulse());
q2 = new Quantity();
q2.setAmount(request.getPatient().getMaxTargetPulse());
target.setMin(q1);
target.setMax(q2);
list.addTarget(target);target = new FocusedRange();
target.setPatientID(request.getPatient().getId());
target.setReferenceID(new Code(“LOINC CODE”,”12345F”,”SPO2″));
q1 = new Quantity();
q1.setAmount(request.getPatient().getMinTargetSPO2());
q2 = new Quantity();
q2.setAmount(request.getPatient().getMaxTargetSPO2());
target.setMin(q1);
target.setMax(q2);
list.addTarget(target);target = new FocusedRange();
target.setPatientID(request.getPatient().getId());
target.setReferenceID(new Code(“LOINC CODE”,”12345F”,”Daily Weight Gain”));
q1 = new Quantity();
q1.setAmount(request.getPatient().getMinTargetDailyWeightGain());
q2 = new Quantity();
q2.setAmount(request.getPatient().getMaxTargetDailyWeightGain());
target.setMin(q1);
target.setMax(q2);
list.addTarget(target);target = new FocusedRange();
target.setPatientID(request.getPatient().getId());
target.setReferenceID(new Code(“LOINC CODE”,”12345F”,”Weekly Weight Gain”));
q1 = new Quantity();
q1.setAmount(request.getPatient().getMinTargetWeeklyWeightGain());
q2 = new Quantity();
q2.setAmount(request.getPatient().getMaxTargetWeeklyWeightGain());
target.setMin(q1);
target.setMax(q2);
list.addTarget(target);return list;
}
private static Patient getPatient(CCHRequest request) {
Patient p = new Patient();p.setId(request.getPatient().getId());
p.setObservations(getObservations(request));return p;
}private IlrSessionResponse executeRules(CCHRequest request)
throws IlrRuleSessionCreationException, RemoteException, IlrRuleSessionException{Properties jndiProperties = new Properties();
IlrRuleSessionProvider rsProvider = null;
try {jndiProperties.put(“java.naming.factory.initial”, “org.jnp.interfaces.NamingContextFactory”);
jndiProperties.put(“java.naming.provider.url”,”jnp://172.27.25.6″);
jndiProperties.put(“java.naming.factory.url.pkgs”,”org.jnp.interfaces”);
rsProvider = new IlrRuleSessionProviderFactory.Builder
(jndiProperties)
.build();
} catch (Exception ioe) {
rsProvider = new IlrRuleSessionProviderFactory.Builder
(IlrRuleSessionProviderFactory.SIMPLE_RULESESSION_PROVIDER).build();
ioe.printStackTrace();
}// Create a session request object
IlrSessionRequest sessionRequest = new IlrSessionRequest(“/CCHRuleApp/CHCSAdvancedRules”);// Set the input parameters for the execution of the rules
IlrSessionExecutionSettings sessionExecutionSettings = sessionRequest
.getExecutionSettings();
IlrSessionParameters inputParameters = sessionExecutionSettings
.getInputParameters();Patient p = new Patient();
// Populate Patient object with the data from CCH Request
// ID
p.setId(request.getPatient().getId());// Observations
p.setObservations(getObservations(request));
TargetList listOfTargets = null;
// create the object
listOfTargets = getTargets(request);
// add it in the mapinputParameters.setParameter(“patient”, p);
inputParameters.setParameter(“listOfTargets”, listOfTargets);
IlrSessionDescriptor sessionDescriptor = sessionRequest
.getSessionDescriptor();
sessionDescriptor.enableTrace();// Create a stateless rule session
IlrStatelessRuleSession statelessRuleSession = rsProvider
.createStatelessRuleSession();// Execute the rules and returns the response
return statelessRuleSession.executeRules(sessionRequest);}
private IlrSessionResponse executeRulesUsingStatelessSession(CCHRequest request)
throws IlrRuleSessionCreationException, RemoteException,
IlrRuleSessionException {// Get a provider of the specified type for a rule session invocation
IlrRuleSessionProvider ruleSessionProvider =
new IlrRuleSessionProviderFactory.Builder(IlrRuleSessionProviderFactory.SIMPLE_RULESESSION_PROVIDER).build();// Create a session request object
IlrSessionRequest sessionRequest = new IlrSessionRequest(“/CCHRuleApp/CHCSAdvancedRules”);// Set the input parameters for the execution of the rules
IlrSessionExecutionSettings sessionExecutionSettings = sessionRequest
.getExecutionSettings();
IlrSessionParameters inputParameters = sessionExecutionSettings
.getInputParameters();Patient p = new Patient();
// Populate Patient object with the data from CCH Request
// ID
p.setId(request.getPatient().getId());// Observations
p.setObservations(getObservations(request));
TargetList listOfTargets = null;
// create the object
listOfTargets = getTargets(request);
// add it in the mapinputParameters.setParameter(“patient”, p);
inputParameters.setParameter(“listOfTargets”, listOfTargets);
IlrSessionDescriptor sessionDescriptor = sessionRequest
.getSessionDescriptor();
sessionDescriptor.enableTrace();// Create a stateless rule session
IlrStatelessRuleSession statelessRuleSession = ruleSessionProvider
.createStatelessRuleSession();// Execute the rules and returns the response
return statelessRuleSession.executeRules(sessionRequest);
}}
mikelmikeMemberHi,
Any progress with resolving this issue?
mongonvParticipantI am having ghe same issue, except that when I regenerate the web service it does not pick up on changes to the class that is being generated. I do get the generation error as well if I do not delete the generated delegation file and the WSDL files. If I leave them in the project when I try to regenerate, most of the time it will get the error that there were problems in the generation, but no detail as to what.
So far, the only way I have been able to get a new generation is to start a whole new project and copy the primary code from the old project to the new, excluding any generated code. This is very annoying on a large project that is under construction as it requires constantly removing and rebuilding the project from scratch.
Any help from MyEclipse staff would be greatly appreciated.
I am on MyEclipse 7.0 latest release running on Windows XP.
Ed
Brian FernandesModeratorMike,
Since your class was already annotated with @WebService, I believe a Delegate class would never have been generated and that field should have been disabled for the first pass as well, is that right? The only output of this process would be an updated WSDL file.
Since your class heavily depends on other sources, I had to try to create something similar for my tests, but could not replicate this issue. I assume you see exactly the same exception each time?
When you select the input class, I believe the only field enabled will be the “Generate WSDL in project” field. Are the Target namespace, Service name and Service port fields filled?
As Ed suggested, if you delete the WSDL / XSD files from your project and try again, does the generation succeed?
Ed,
We are taking a look at this issue now. Does your input class already contain @WebService and @WebMethod annotations?
Does generation always fail if you don’t delete the files or does it fail only sometimes?
I apologize for the inconvenience caused, the dev team is currently researching this issue.
Brian FernandesModeratorMike,
Is your web.xml file well formed, does it have any syntax errors? if not, can you paste it here for us to analyze?
What is the location of your web.xml file relative to your project? if you bring up your project properties and go to MyEclipse > Web, does the “Web-root folder” field contain a folder that exists in your project?
mongonvParticipantBrian,
My input class does not contain any @Web* statements at all, should it?As for regeneration, it has sometimes worked, but I would say less than 10% of the time and I have never been able to figure out what makes it work or not work. It does regenerate, but it only regenerates the original set of methods in the wsdl and xsd. The new methods are generated in the delegation file, but are not reflected in the WSDL or XSD files. So without the WSDL, they are not visible to the calling apps.
When it does work it seems to mostly be during the initial session of the new project. Once it has been closed and reopened at some later date it rarely seems to work.
There are no errors or warnings in the project, I have made sure to keep those clean before attempting any regeneration. I did notice that after the generation, the delegation file does have a warning that imports of Impl files are not used in the delegation file, it inserts one for each related Impl file. These are listed as imports on the input file and show as (XXX warnings) on the generation dialog.
Let me know if you need any further information.
Thanks,
Ed
mongonvParticipantHey Brian,
Well after a bunch of playing and removing the new methods and readding a few at a time, I found that the issue came down to a TimeStamp and subclass declarations in one of the reverse engineered data structures. What is odd, is that earlier today when I was trying to get it to work (without the class that had the bad datatype issues), it was generating without errors, but not the new methods into the wsdl. I still can’t explain that one, did it a bunch of times today and couldn’t figure it out.But it all worked without having to delete any files in between regens, big relief for sure. It would be REALLY useful to have an error message that gives some hint as to what point in the regen is giving the problem. The error that comes up does not give any indication of what or where the data type is that the generator does not like.
Hope this hint helps with someone else’s issues.
Thanks,
Ed
Brian FernandesModeratorEd,
Thanks for following up. The input class may or may not contain @Web annotations. What is happening in your case (which is different from Mike’s) is that a delegate is being created and generation of the WSDL/XSD from the delegate fails. I agree there can be better error reporting, can you tell me what error message you saw exactly?
So that we can reproduce this internally, you are saying that using a java.sql.Timestamp filed can cause it to fail?
mongonvParticipantHey Brian,
Here is the error message that is displayed when there has been a WSDL generation problem:An internal error occurred during: “Generating JAX-WS Web Services”.
Unable to create JAXBContextThis error comes up from including a class variable that is an instance of another class that is a complex class with sets and other class instances, so not surprising that it bombs, but an indication of where would be great.
On the timestamp, I just tested that item alone by including it as a class variable instead of date and it did not bomb. But when I started this project under 7.0 M1, I had to remove all the timestamps cause nothing would pass that had one in it. Now it does not seem to mind those, so not sure what to say there.
Hope that helps some and thanks much for your help,
Ed
mikelmikeMemberBrian, thank you for your response.
Actually, the delegate class was generated first time, here’s its content:
package partners.ecrs;import ilog.rules.bres.session.IlrRuleSessionCreationException;
import ilog.rules.bres.session.IlrRuleSessionException;
import ilog.rules.bres.session.IlrRuleSessionProvider;
import ilog.rules.bres.session.IlrRuleSessionProviderFactory;
import ilog.rules.bres.session.IlrSessionDescriptor;
import ilog.rules.bres.session.IlrSessionExecutionSettings;
import ilog.rules.bres.session.IlrSessionParameters;
import ilog.rules.bres.session.IlrSessionRequest;
import ilog.rules.bres.session.IlrSessionResponse;
import ilog.rules.bres.session.IlrStatelessRuleSession;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import javax.jws.WebMethod;
import javax.jws.WebService;
import service.AHRQRequest;
import service.AHRQResponse;
import service.CCHRequest;
import service.CCHResponse;
import utilityClasses.Quantity;
import ecrsBase.Code;
import ecrsBase.FocusedRange;
import ecrsBase.Observation;
import ecrsBase.Patient;
import ecrsBase.TargetList;@javax.jws.WebService(targetNamespace = “http://ecrs.partners/”, serviceName = “RulesServiceService”, portName = “RulesServicePort”, wsdlLocation = “WEB-INF/wsdl/RulesServiceService.wsdl”)
public class RulesServiceDelegate {partners.ecrs.RulesService rulesService = new partners.ecrs.RulesService();
public CCHResponse getAssertions(CCHRequest request, CCHResponse response) {
return rulesService.getAssertions(request, response);
}public AHRQResponse executeRules(AHRQRequest request, AHRQResponse response) {
return rulesService.executeRules(request, response);
}
}Next – if I delete the wsdl and xsd files, the issue persists.
My web.xml file is under ECRS\WebRoot\WEB-INF and this is what it has:
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.5″ xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”>
<servlet>
<description>JAX-WS endpoint – ECRS_WSService</description>
<display-name>ECRS_WSService</display-name>
<servlet-name>ECRS_WSService</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet><servlet-mapping>
<servlet-name>ECRS_WSService</servlet-name>
<url-pattern>/RulesServicePort</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>ECRS_WSService</servlet-name>
<url-pattern>/ECRS_WSPort</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<resource-ref>
<res-ref-name>eis/XUConnectionFactory</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
<security-role>
<role-name>bres_admin</role-name>
</security-role><ejb-local-ref>
<ejb-ref-name>ejb/IlrStatelessRuleSessionEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>
ilog.rules.bres.session.ejb.IlrStatelessRuleSessionLocalHome
</local-home>
<local>
ilog.rules.bres.session.ejb.IlrStatelessRuleSessionLocalInt
</local>
<ejb-link>
jrules-bres-session-JBOSS40.jar#IlrStatelessRuleSessionEJB
</ejb-link>
</ejb-local-ref></web-app>
-
AuthorPosts