You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/01/09 14:28:12 UTC

[GitHub] [camel-quarkus] aldettinger opened a new issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

aldettinger opened a new issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610
 
 
   How to reproduce:
   Set <reportErrorsAtRuntime>**false**</reportErrorsAtRuntime> in integration-tests/jsonpath/pom.xml
   Run mvn clean verify -P native
   An issue where the @Deleted defineClass method would be accessed is reported.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

Posted by GitBox <gi...@apache.org>.
aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610#issuecomment-575165742
 
 
   The build is fine regarding this ticket, closing.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] lburgazzoli commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610#issuecomment-573203761
 
 
   looking a little bit into this issue you probably need to substitute:
   - `net.minidev.json.JSONValue`
   - `net.minidev.json.JSONWriter`
   
   Something like:
   
   ```java
   @TargetClass(JSONValue.class)
   class JSONValueSubstitution {
       
       @Substitute
   	public static void writeJSONString(Object value, Appendable out, JSONStyle compression) throws IOException {
   		if (value == null) {
   			out.append("null");
   			return;
   		}
   		Class<?> clz = value.getClass();
   		@SuppressWarnings("rawtypes")
   		JsonWriterI w = defaultWriter.getWrite(clz);
   		if (w == null) {
   			if (clz.isArray())
   				w = JsonWriter.arrayWriter;
   			else {
   				w = defaultWriter.getWriterByInterface(value.getClass());
   				if (w == null)
   					throw new UnsupportedOperationException("...")
   			}
   			defaultWriter.registerWriter(w, clz);
   		}
   		w.writeJSONString(value, out, compression);
   	}
   }
   ```
   
   ```java
   @TargetClass(JSONWriter.class)
   class JSONWriterSubstitution {
       @Delete
       static public JsonWriterI<Object> beansWriterASM;
   }
   ```
   
   Not sure it it is enough but the issue is that the library tries to generate classes in case it does not find a suitable writer. 
   
   An potential future evolution would be to generate such classes at build time.
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

Posted by GitBox <gi...@apache.org>.
aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610#issuecomment-574769798
 
 
   @lburgazzoli, you were few brackets from having it fully done :) Thanks for analysis and proposal by the way :+1: 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

Posted by GitBox <gi...@apache.org>.
aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610#issuecomment-572615989
 
 
   Thanks @lburgazzoli for discussing the case.
   I will try adding the jsonb extension, or then find what to substitute in order to cut the possibly false unreachable code path detection.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

Posted by GitBox <gi...@apache.org>.
aldettinger commented on issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610#issuecomment-575032266
 
 
   I've pushed a fix, let's ensure next build is fine with that.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] aldettinger closed issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode

Posted by GitBox <gi...@apache.org>.
aldettinger closed issue #610: Fix the defineClass exception in camel-quarkus-jsonpath while running in native mode
URL: https://github.com/apache/camel-quarkus/issues/610
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services