OAuth-Apis / apis

OAuth Authorization as a Service
Apache License 2.0
593 stars 301 forks source link

Build error running the authZ server #85

Closed htj closed 8 years ago

htj commented 8 years ago

htj@pyrite:~/src/apis/apis-authorization-server-war$ mvn jetty:run [snip] [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to resolve artifact.

Missing:

1) nl.surfnet.apis:apis-authorization-server:jar:1.3.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command: mvn install:install-file -DgroupId=nl.surfnet.apis -DartifactId=apis-authorization-server -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=nl.surfnet.apis -DartifactId=apis-authorization-server -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency: 1) nl.surfnet.apis:apis-authorization-server-war:war:1.3.6-SNAPSHOT 2) nl.surfnet.apis:apis-authorization-server:jar:1.3.6-SNAPSHOT

2) nl.surfnet.apis:apis-surfconext-authn:jar:1.3.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command: mvn install:install-file -DgroupId=nl.surfnet.apis -DartifactId=apis-surfconext-authn -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=nl.surfnet.apis -DartifactId=apis-surfconext-authn -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency: 1) nl.surfnet.apis:apis-authorization-server-war:war:1.3.6-SNAPSHOT 2) nl.surfnet.apis:apis-surfconext-authn:jar:1.3.6-SNAPSHOT


2 required artifacts are missing.

for artifact: nl.surfnet.apis:apis-authorization-server-war:war:1.3.6-SNAPSHOT

from the specified remote repositories: openconext-snapshots (https://build.surfconext.nl/repository/public/snapshots), central (https://repo1.maven.org/maven2), openconext-releases (https://build.surfconext.nl/repository/public/releases)

[INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 41 seconds [INFO] Finished at: Tue Nov 10 10:53:29 CET 2015 [INFO] Final Memory: 22M/142M [INFO] ------------------------------------------------------------------------

This might be something that is super-simple to fix for people that actually know something about maven.

gvanderploeg commented 8 years ago

Have you done a 'mvn clean install' on the parent module (one directory higher) first, before running 'mvn jetty:run' on the war module? Because you need that in order to have those (snapshot) dependencies in your local repo.

On 10 November 2015 at 10:57, Henrik Thostrup Jensen < notifications@github.com> wrote:

htj@pyrite:~/src/apis/apis-authorization-server-war$ mvn jetty:run [snip]

[INFO]

[ERROR] BUILD ERROR

[INFO]

[INFO] Failed to resolve artifact. Missing:

1) nl.surfnet.apis:apis-authorization-server:jar:1.3.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command: mvn install:install-file -DgroupId=nl.surfnet.apis -DartifactId=apis-authorization-server -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=nl.surfnet.apis -DartifactId=apis-authorization-server -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency: 1) nl.surfnet.apis:apis-authorization-server-war:war:1.3.6-SNAPSHOT 2) nl.surfnet.apis:apis-authorization-server:jar:1.3.6-SNAPSHOT

2) nl.surfnet.apis:apis-surfconext-authn:jar:1.3.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command: mvn install:install-file -DgroupId=nl.surfnet.apis -DartifactId=apis-surfconext-authn -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=nl.surfnet.apis -DartifactId=apis-surfconext-authn -Dversion=1.3.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency: 1) nl.surfnet.apis:apis-authorization-server-war:war:1.3.6-SNAPSHOT

2) nl.surfnet.apis:apis-surfconext-authn:jar:1.3.6-SNAPSHOT

2 required artifacts are missing.

for artifact: nl.surfnet.apis:apis-authorization-server-war:war:1.3.6-SNAPSHOT

from the specified remote repositories: openconext-snapshots ( https://build.surfconext.nl/repository/public/snapshots), central (https://repo1.maven.org/maven2), openconext-releases ( https://build.surfconext.nl/repository/public/releases)

[INFO]

[INFO] For more information, run Maven with the -e switch

[INFO]

[INFO] Total time: 41 seconds [INFO] Finished at: Tue Nov 10 10:53:29 CET 2015 [INFO] Final Memory: 22M/142M

[INFO]

This might be something that is super-simple to fix for people that actually know something about maven.

— Reply to this email directly or view it on GitHub https://github.com/OAuth-Apis/apis/issues/85.

htj commented 8 years ago

I get a test error when doing that:


T E S T S

Running org.surfnet.oaaas.auth.AuthorizationServerFilterTest Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.061 sec <<< FAILURE! Running org.surfnet.oaaas.auth.principal.AuthenticatedPrincipalTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.159 sec Running org.surfnet.oaaas.auth.principal.BasicAuthCredentialsTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec Running org.surfnet.oaaas.model.TokenResponseCacheTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.537 sec

Results :

Tests in error: org.surfnet.oaaas.auth.AuthorizationServerFilterTest: org/eclipse/jetty/http/HttpBuffers org.surfnet.oaaas.auth.AuthorizationServerFilterTest: Could not initialize class nl.surfnet.coin.mock.AbstractMockHttpServerTest

Tests run: 7, Failures: 0, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] There are test failures.

Please refer to /home/htj/src/apis/apis-resource-server-library/target/surefire-reports for the individual test results. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 seconds [INFO] Finished at: Tue Nov 10 14:18:04 CET 2015 [INFO] Final Memory: 36M/601M [INFO] ------------------------------------------------------------------------

test output


Test set: org.surfnet.oaaas.auth.AuthorizationServerFilterTest

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.061 sec <<< FAILURE! org.surfnet.oaaas.auth.AuthorizationServerFilterTest Time elapsed: 0 sec <<< ERROR! java.lang.NoClassDefFoundError: org/eclipse/jetty/http/HttpBuffers 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:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) 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:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at nl.surfnet.coin.mock.MockHtppServer.initServer(MockHtppServer.java:47) at nl.surfnet.coin.mock.MockHtppServer.(MockHtppServer.java:38) at nl.surfnet.coin.mock.AbstractMockHttpServerTest.(AbstractMockHttpServerTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68) Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.http.HttpBuffers at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 49 more org.surfnet.oaaas.auth.AuthorizationServerFilterTest Time elapsed: 0.001 sec <<< ERROR! java.lang.NoClassDefFoundError: Could not initialize class nl.surfnet.coin.mock.AbstractMockHttpServerTest at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

Dependency error?

gvanderploeg commented 8 years ago

Yes, something like that. I'll investigate...

gvanderploeg commented 8 years ago

I do not see any obvious error... Can you provide some info about your environment? Do you have things in place like maven proxies, heavily modified settings.xml (for maven)? What Java version do you use? (I just did a complete clean clone / mvn clean install on both Java 7 and 8 with no errors)

htj commented 8 years ago

Ubuntu 15.04 with OpenJDK8: htj@pyrite:~/src/apis$ java -version openjdk version "1.8.0_45-internal" OpenJDK Runtime Environment (build 1.8.0_45-internal-b14) OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)

I deleted the .m2 and did a clean clone. New error, this one is understandable though:

[snip] Downloading: http://oss.sonatype.org/content/groups/jetty/org/eclipse/jetty/jetty-parent/19/jetty-parent-19.pom 178b downloaded (jetty-parent-19.pom) [WARNING] *\ CHECKSUM FAILED - Checksum failed on download: local = '81ffbd1712afe8cdf138b570c0fc9934742c33c1'; remote = '

301' - RETRYING Downloading: http://oss.sonatype.org/content/groups/jetty/org/eclipse/jetty/jetty-parent/19/jetty-parent-19.pom 178b downloaded (jetty-parent-19.pom) [WARNING] **\* CHECKSUM FAILED - Checksum failed on download: local = '81ffbd1712afe8cdf138b570c0fc9934742c33c1'; remote = '<html> <head><title>301' - IGNORING [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to resolve artifact. Unable to get dependency information: Unable to read the metadata file for artifact 'org.eclipse.jetty:jetty-server:jar': Cannot find parent: org.eclipse.jetty:jetty-parent for project: null:jetty-project:pom:8.0.4.v20111024 for project null:jetty-project:pom:8.0.4.v20111024 org.eclipse.jetty:jetty-server:jar:8.0.4.v20111024 from the specified remote repositories: openconext-snapshots (https://build.surfconext.nl/repository/public/snapshots), central (https://repo1.maven.org/maven2), openconext-releases (https://build.surfconext.nl/repository/public/releases) Path to dependency: 1) nl.surfnet.apis:apis-resource-server-library:jar:1.3.6-SNAPSHOT 2) org.surfnet.coin:coin-test:jar:2.8.1 [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 1 second [INFO] Finished at: Tue Nov 10 15:41:11 CET 2015 [INFO] Final Memory: 42M/707M [INFO] ------------------------------------------------------------------------ So the client doesn't seem to understand 301 :-/. Gotta love java build systems. </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gvanderploeg"><img src="https://avatars.githubusercontent.com/u/1161974?v=4" />gvanderploeg</a> commented <strong> 8 years ago</strong> </div> <div class="markdown-body"> <p>are you still having this issue? Otherwise we can close it...</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/htj"><img src="https://avatars.githubusercontent.com/u/6505?v=4" />htj</a> commented <strong> 8 years ago</strong> </div> <div class="markdown-body"> <p>I couldn't resolve it. I gave up trying the software out though.</p> <p>If I can't build, it probably cannot configure it either.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gvanderploeg"><img src="https://avatars.githubusercontent.com/u/1161974?v=4" />gvanderploeg</a> commented <strong> 8 years ago</strong> </div> <div class="markdown-body"> <p>Too bad to hear this. I understood it was a general maven issue that you struggled with, not something Apis-specific, but I might be wrong.</p> <p>On 2 December 2015 at 09:18, Henrik Thostrup Jensen < notifications@github.com> wrote:</p> <blockquote> <p>I couldn't resolve it. I gave up trying the software out though.</p> <p>If I can't build, it probably cannot configure it either.</p> <p>— Reply to this email directly or view it on GitHub <a href="https://github.com/OAuth-Apis/apis/issues/85#issuecomment-161216199">https://github.com/OAuth-Apis/apis/issues/85#issuecomment-161216199</a>.</p> </blockquote> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/htj"><img src="https://avatars.githubusercontent.com/u/6505?v=4" />htj</a> commented <strong> 8 years ago</strong> </div> <div class="markdown-body"> <p>You can't just blame Maven. The build system is part of the software. Double so with everything Java.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>