You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by GitBox <gi...@apache.org> on 2020/04/28 20:46:59 UTC

[GitHub] [juneau] garydgregory opened a new pull request #54: Add org.apache.juneau.PropertyStoreBuilder.clearCache().

garydgregory opened a new pull request #54:
URL: https://github.com/apache/juneau/pull/54


   Add `PropertyStore.clearCache()` which I currently implement using reflection and call from our company's test rules to clear this cache when we bring Juneau up and down a ton of times from the same JVM during tests in builds. 
   
   This works around errors like the following for us:
   ```
   error	28-Apr-2020 15:40:37	java.lang.RuntimeException: org.apache.juneau.FormattedRuntimeException: Could not instantiate class org.apache.juneau.serializer.Serializer
   error	28-Apr-2020 15:40:37		at org.apache.juneau.rest.RestContextBuilder.build(RestContextBuilder.java:262)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.rest.RestServlet.init(RestServlet.java:53)
   error	28-Apr-2020 15:40:37		at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602)
   error	28-Apr-2020 15:40:37		at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:473)
   <SNIP/>
   error	28-Apr-2020 15:40:37		at java.base/java.lang.Thread.run(Thread.java:834)
   error	28-Apr-2020 15:40:37	Caused by: org.apache.juneau.FormattedRuntimeException: Could not instantiate class org.apache.juneau.serializer.Serializer
   error	28-Apr-2020 15:40:37		at org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1890)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.PropertyStore$Property.asInstanceArray(PropertyStore.java:876)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.PropertyStore.getInstanceArrayProperty(PropertyStore.java:590)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.PropertyStore.getInstanceArrayProperty(PropertyStore.java:569)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.Context.getInstanceArrayProperty(Context.java:403)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.rest.RestContext.<init>(RestContext.java:3162)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.rest.RestContextBuilder.build(RestContextBuilder.java:258)
   error	28-Apr-2020 15:40:37		... 10 more
   error	28-Apr-2020 15:40:37	Caused by: java.lang.reflect.InvocationTargetException
   error	28-Apr-2020 15:40:37		at jdk.internal.reflect.GeneratedConstructorAccessor96.newInstance(Unknown Source)
   error	28-Apr-2020 15:40:37		at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   error	28-Apr-2020 15:40:37		at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1885)
   error	28-Apr-2020 15:40:37		... 16 more
   error	28-Apr-2020 15:40:37	Caused by: java.lang.RuntimeException: Property store mismatch!  This shouldn't happen.
   error	28-Apr-2020 15:40:37		at org.apache.juneau.PropertyStoreBuilder.build(PropertyStoreBuilder.java:70)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.oapi.OpenApiSerializer.<init>(OpenApiSerializer.java:72)
   error	28-Apr-2020 15:40:37		at org.apache.juneau.oapi.OpenApiSerializer.<init>(OpenApiSerializer.java:85)
   error	28-Apr-2020 15:40:37		... 20 more
   
   ```


----------------------------------------------------------------
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



[GitHub] [juneau] garydgregory commented on pull request #54: Add org.apache.juneau.PropertyStoreBuilder.clearCache().

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #54:
URL: https://github.com/apache/juneau/pull/54#issuecomment-621236512


   Thanks @jamesbognar!


----------------------------------------------------------------
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



[GitHub] [juneau] garydgregory commented on pull request #54: Add org.apache.juneau.PropertyStoreBuilder.clearCache().

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #54:
URL: https://github.com/apache/juneau/pull/54#issuecomment-621204893


   @jamesbognar Thank you. Will you put this in master or do I need to create another PR?


----------------------------------------------------------------
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



[GitHub] [juneau] jamesbognar commented on pull request #54: Add org.apache.juneau.PropertyStoreBuilder.clearCache().

Posted by GitBox <gi...@apache.org>.
jamesbognar commented on pull request #54:
URL: https://github.com/apache/juneau/pull/54#issuecomment-621220892


   I'll pull it into master.


----------------------------------------------------------------
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