This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 259005 - Restful client throws SecurityException (SignatureFileVerifier)
Summary: Restful client throws SecurityException (SignatureFileVerifier)
Status: NEW
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-25 10:34 UTC by ad
Modified: 2016-04-25 10:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ad 2016-04-25 10:34:21 UTC
Create new Web Project, add New Restful Web services from Pattern / simple root resource. Specify a package. 

Remove generic resource methods and replace with 

@GET
    @Path("/lower/{word}")
    @Produces(MediaType.TEXT_HTML)
    public String lower(@PathParam("word") String word)
    {
        return word.toLowerCase();
    }

Deploy / test by visiting URI, it works.

Now create client using: New Restful Client

reuse the same package.

Select From Project / browse to the same GenericResource / Finish.

Add a main method to the NewJerseyClient to call the resource method.

public static void main(String[] args)
   {
      NewJerseyClient c = new NewJerseyClient();
      
      String x = c.lower("TEST");      
   }
 
Run the File...

SecurityException is thrown:

Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
	at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
	at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
	at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
	at java.util.jar.JarVerifier.update(JarVerifier.java:228)
	at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
	at java.util.jar.JarFile.getInputStream(JarFile.java:450)
	at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:776)
	at sun.misc.Resource.cachedInputStream(Resource.java:77)
	at sun.misc.Resource.getByteBuffer(Resource.java:160)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.glassfish.jersey.moxy.json.MoxyJsonFeature.configure(MoxyJsonFeature.java:92)
	at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:714)
	at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:644)
	at org.glassfish.jersey.client.ClientConfig$State.configureMetaProviders(ClientConfig.java:372)
	at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:405)
	at org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:90)
	at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:122)
	at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:119)
	at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340)
	at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:733)
	at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285)
	at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:135)
	at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:105)
	at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:101)
	at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:92)
	at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:420)
	at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:316)
	at rest.NewJerseyClient.lower(NewJerseyClient.java:40)
	at rest.NewJerseyClient.main(NewJerseyClient.java:52)