You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "dbrmantech (via GitHub)" <gi...@apache.org> on 2024/09/25 16:02:46 UTC

[I] unmarshal hangs camel process if using true/false on int field [camel-karaf]

dbrmantech opened a new issue, #504:
URL: https://github.com/apache/camel-karaf/issues/504

   Recently upgraded to karaf 4.4.6 and camel 4.7.
   
   We found out the hard way that we had some bugs in our XSLT.  It was generating XML like this:
   
   ```
   <ITAsset (snip)>
   	<vulnerability>
   		<exploitAvailable>false</exploitAvailable>
   	</vulnerability>
   </ITAsset>
   ```
   
   exploitAvailable in the vuln bean is an int.  Oops.
   
   We unmarshal to our java objects like this in our XML blueprints:
   
   ```
   	<unmarshal>
   		<jaxb prettyPrint="false" contextPath="foo.model"/>
   	</unmarshal>
   ```
   
   With true or false, It just hangs silently, never returns.  If we pass an int, all is well.
   
   Is this a known issue?  Is there a work around or some config we could set so if we goof again, it gives us some error message instead of a silent hang?
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] unmarshal hangs camel process if using true/false on int field [camel-karaf]

Posted by "dbrmantech (via GitHub)" <gi...@apache.org>.
dbrmantech commented on issue #504:
URL: https://github.com/apache/camel-karaf/issues/504#issuecomment-2407838345

   We deploy our Java classes before our blueprints, and then deploy/redeploy our blueprints.
   
   But we can no longer reproduce this hang in the unmarshall either.  The hang was consistently happening for everyone on the team, but after uninstalling the karaf service and doing fresh installs of the karaf service and our camel blueprints, the unmarshall hangs seem to have disappeared.  
   
   Thanks again, and sorry for wasting time here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] unmarshal hangs camel process if using true/false on int field [camel-karaf]

Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
stataru8 commented on issue #504:
URL: https://github.com/apache/camel-karaf/issues/504#issuecomment-2400681911

   Hello, and thanks for sharing.
   
   I couldn’t reproduce the issue on my end. Am I missing something?
   
   Route in blueprint file:
   ```
   <route id="jaxb-route">
   			
      <from uri="timer://foo?period=10000"/>
   			
         <log message="START route"/>
   		
         <setBody>
             <constant>
                 <![CDATA[
                     <MyData>
                         <randomField>Johnny</randomField>
                         <name/>
                         <nikname>Johnny</nikname>
                         <age>30</age>
                         <asset>
                             <name>Car</name>
                             <inherited>1</inherited>
                             <age>true</age>
                         </asset>
                       </MyData>
                   ]]>
               </constant>
           </setBody>
               
           <camel:log message="Will unmarshal: ${body}"/>
              
           <camel:unmarshal>
                   <camel:jaxb contextPath="org.apache.karaf.camel.test"/>
           </camel:unmarshal>
               
           <camel:log message="Unmarshalled: ${body}"/>	
   			
   	<log message="FINISH route"/>
   </route>
   ```
   
   logs in my console:
   ```
   21:26:31.009 INFO [Camel (camel-1) thread #1 - timer://foo] START route
   21:26:31.010 INFO [Camel (camel-1) thread #1 - timer://foo] Will unmarshal: <MyData>
                         <randomField>Johnny</randomField>
                         <name/>
                         <nikname>Johnny</nikname>
                         <age>30</age>
                         <asset>
                             <name>Car</name>
                             <inherited>1</inherited>
                             <age>true</age>
                         </asset>
                       </MyData>
   21:26:31.012 INFO [Camel (camel-1) thread #1 - timer://foo] Unmarshalled: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
   <MyData>
       <asset>
           <age>0</age>
           <inherited>true</inherited>
           <name>Car</name>
       </asset>
       <age>30</age>
       <name></name>
   </MyData>
   
   21:26:31.014 INFO [Camel (camel-1) thread #1 - timer://foo] FINISH route
   ```
   `MyData class`
   ```
   package org.apache.karaf.camel.test;
   
   import jakarta.xml.bind.annotation.XmlElement;
   import jakarta.xml.bind.annotation.XmlRootElement;
   
   @XmlRootElement(name = "MyData")
   public class MyData {
   
       private String name;
       private int age;
       @XmlElement(name="asset")
       private Asset asset;
       
       // getters and setters  ...  (except getter for asset)   
   }
   ```
   
   `Asset class`
   ```
   package org.apache.karaf.camel.test;
   
   public class Asset {
   
       private String name;
       private boolean inherited;
       private int age;
       
       // getters and setters ...
   }
   ```
   `ObjectFactory class`
   ```
   package org.apache.karaf.camel.test;
   
   import jakarta.xml.bind.annotation.XmlRegistry;
   
   @XmlRegistry
   public class ObjectFactory {
   
       public ObjectFactory() {
       }
   
       public MyData create() {
           return new MyData();
       }
   }
   ```
   I placed two files inside karaf's deploy folder:
   - a jar file that is a bundle exporting the package `org.apache.karaf.camel.test`, containing the three classes I shared.
   - a xml blueprint file with the route I shared.
   
   In my setup, I've noticed the blueprint bundle hangs when deploying and undeploying the JAR file. However, I assume that in your scenario, you have a bundle containing both the blueprint and the target package with the classes. 
   
   Could you share more information ? 🙏 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] unmarshal hangs camel process if using true/false on int field [camel-karaf]

Posted by "dbrmantech (via GitHub)" <gi...@apache.org>.
dbrmantech commented on issue #504:
URL: https://github.com/apache/camel-karaf/issues/504#issuecomment-2405386946

   Thanks for trying to reproduce.  I've also noticed that there must be something else going on in addition to what I mentioned above. The second hang about dates stopped hanging the next day.
   
   We'll try and nail it down more precisely soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] unmarshal hangs camel process if using true/false on int field [camel-karaf]

Posted by "dbrmantech (via GitHub)" <gi...@apache.org>.
dbrmantech closed issue #504: unmarshal hangs camel process if using true/false on int field
URL: https://github.com/apache/camel-karaf/issues/504


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org