my application service is not able to start or respond to even warmup requests as the time taken by Jersey to scan the libraries is inordinate.
I have created application and hardcoded all the paths of the Resources for jersey.
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.livily.rest.JerseyApplication</param-value>
</init-param>
Jersey Application has all the classes
public Set<Class<?>> getClasses()
{
Set<Class<?>> s = new HashSet<Class<?>>();
s.add(com.livily.rest.visitor.UserRatingUtil.class);
}
However, jersey is scanning for lot of providers
Mar 8, 2013 3:39:40 PM com.sun.jersey.core.spi.component.ProviderServices getServiceClasses
CONFIG: Provider found: class com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$StringConstructor
It is doing it about 50-100 times and then
Mar 8, 2013 3:39:41 PM com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller createResource
FINEST: A new abstract resource created by IntrospectionModeler: AbstractResource("/current-status", - CurrentStatus: 1 constructors, 0 fields, 0 setter methods, 1 res methods, 0 subres methods, 0 subres locators )
for each one
The time taken in total is about 4-10 secs and appengine does not like this as it expects to wrap up the loading quickly; otherwise it starts giving weird 500 errors (for even static files).
I am stumped; any help will be appreciated.
I use the packages property to name which packages should be scanned as follows...
Set
jersey.config.disableAutoDiscovery
. See Configuration Properties for details.