Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in CamelContextGenerator.getJavaMethod(CamelContextGenerator.java:117) #66

Open
apupier opened this issue Oct 4, 2018 · 10 comments
Labels
Milestone

Comments

@apupier
Copy link
Member

apupier commented Oct 4, 2018

java.lang.NullPointerException
	at org.jboss.fuse.wsdl2rest.impl.codegen.CamelContextGenerator.getJavaMethod(CamelContextGenerator.java:117)
	at org.jboss.fuse.wsdl2rest.impl.codegen.CamelContextGenerator.addTypeMapping(CamelContextGenerator.java:94)
	at org.jboss.fuse.wsdl2rest.impl.codegen.CamelContextGenerator.process(CamelContextGenerator.java:76)
	at org.jboss.fuse.wsdl2rest.impl.Wsdl2Rest.process(Wsdl2Rest.java:92)

wsdl file available on case support https://access.redhat.com/support/cases/#/case/02193740

@apupier apupier self-assigned this Oct 4, 2018
@apupier
Copy link
Member Author

apupier commented Oct 4, 2018

the issue occurs when a port type contains an "_"

apupier added a commit to apupier/wsdl2rest that referenced this issue Oct 5, 2018
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
apupier added a commit to apupier/wsdl2rest that referenced this issue Oct 8, 2018
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@bfitzpat
Copy link
Contributor

bfitzpat commented Oct 8, 2018

Fixes merged

@bfitzpat bfitzpat closed this as completed Oct 8, 2018
@apupier apupier reopened this Oct 8, 2018
@apupier
Copy link
Member Author

apupier commented Oct 8, 2018

I provided a PR which is avoiding the NPE and testing the same things than other tests but I have no idea if the generated code is really working or not (and don't know how to check that for now)

@bfitzpat
Copy link
Contributor

bfitzpat commented Oct 8, 2018

Sorry I missed the new PR

@apupier
Copy link
Member Author

apupier commented Oct 16, 2018

@tdiesler what needs to be checked on the generated code? how to test that the generated code is correct the wsdl/camel rest dsl?

@tdiesler
Copy link
Collaborator

I'd say it works in the context of its test coverage. If a functionality is auto tested we claim that it works. If it is not tested we assume that it is not there.

@apupier
Copy link
Member Author

apupier commented Oct 17, 2018

is the test that I've written accurate? I duplicate the other tests, but does it makes sense in the context of name with underscores? How to know if it is the right way to handle it?

@tdiesler
Copy link
Collaborator

tdiesler commented Oct 17, 2018 via email

@apupier
Copy link
Member Author

apupier commented Nov 6, 2018

I still don't know if java code is well generated but camel dsl file is for sure badly generated:

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:cxf="http://camel.apache.org/schema/cxf"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <camelContext id="cxfrs-cc50ce86-29df-438d-a2a1-cdfde19c5d83" xmlns="http://camel.apache.org/schema/spring">

        <dataFormats>
            <xmljson id="xmljson"/>
        </dataFormats>
        
        <restConfiguration component="jetty" host="localhost" port="8081" bindingMode="json">
        </restConfiguration>

        <rest id="id-26650c10-4b95-410d-9539-c7e128152879" path="/jaxrs">

          <$method.httpMethod.toLowerCase() id="id-48e4f63d-d888-4cad-9d95-dddfcecccb94" uri="//{arg0}" 
            type="com.oracle.xmlns.enterprise.tools.schemas.a_second_name_with_underscore_email_req.ASECONDNAMEWITHUNDERSCOREEMAILREQTypeShape"
            outType="com.oracle.xmlns.enterprise.tools.schemas.a_third_name_with_underscore_msg.ATHIRDNAMEWITHUNDERSCOREMSGTypeShape" 
            >
            <to uri="direct:A_SECOND_NAME_WITH_UNDERSCORE_EMAIL_OPR_SRV"/>
          </$method.httpMethod.toLowerCase()>
        </rest>

        <route id="A_SECOND_NAME_WITH_UNDERSCORE_EMAIL_OPR_SRV">
            <from uri="direct:A_SECOND_NAME_WITH_UNDERSCORE_EMAIL_OPR_SRV" />
            <log loggingLevel="INFO" message="A_SECOND_NAME_WITH_UNDERSCORE_EMAIL_OPR_SRV"/>
            <to uri="cxf://http://localhost:8080/somepath?serviceClass=1.com/Enterprise/HCM/services/A_NAME_WITH_UNDERSCORE_SRV.oracle.xmlns.A_NAME_WITH_UNDERSCORE_SRV_PortType&amp;defaultOperationName=A_SECOND_NAME_WITH_UNDERSCORE_EMAIL_OPR_SRV"/>
            <setHeader headerName="Content-Type">
               <constant>application/json</constant>
            </setHeader>
            <setBody>
                <simple>${body[0]}</simple>
            </setBody>
        </route>
        
    </camelContext>

</beans>

apupier added a commit to apupier/wsdl2rest that referenced this issue Nov 6, 2018
names jboss-fuse#66

- improved test to check for it
- support underscores in names

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@apupier apupier removed their assignment Nov 21, 2018
@apupier
Copy link
Member Author

apupier commented Nov 21, 2018

unassigned: time allocated to work on it exploded.

bfitzpat pushed a commit that referenced this issue Dec 17, 2018
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@tdiesler tdiesler added the bug label Jan 30, 2019
@tdiesler tdiesler added this to the 0.9.0 milestone Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants