annotationsatharvard / catcha

Catch-A - Catching Annotation: An annotation backend and API.
http://catcha.readthedocs.io
20 stars 9 forks source link

Loading Grails 2.2.5 | Error There was an error loading the BuildConfig: Cannot invoke method getAt() #82

Closed sijpkes closed 8 years ago

sijpkes commented 8 years ago

This error occurse when I try the last step of the install in the instructions.

I'm running openjdk version "1.8.0_101" on a Redhat 6.8 machine.

Full output:

OpenJDK 64-Bit Server VM warning: ignoring option PermSize=32m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
| Loading Grails 2.2.5
| Error There was an error loading the BuildConfig: Cannot invoke method getAt() on null object (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException: Cannot invoke method getAt() on null object
    at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1259)
    at grails.util.BuildSettings$configureDependencyManager.callCurrent(Unknown Source)
    at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1170)
    at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1068)
    at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1050)
    at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source)
    at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1028)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259)
| Error There was an error loading the BuildConfig: Cannot invoke method getAt() on null object
jmiranda commented 8 years ago

I would recommend downgrading to JDK 7 to see if that resolves the issue. Grails didn't add JDK 8 support until v2.4.

I'll update the docs to reflect that requirement.

On Wednesday, September 28, 2016, Paul Sijpkes notifications@github.com wrote:

This error occurse when I try the last step of the install in the instructions.

I'm running openjdk version "1.8.0_101" on a Redhat 6.8 machine.

Full output: OpenJDK 64-Bit Server VM warning: ignoring option PermSize=32m; support was removed in 8.0 OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 | Loading Grails 2.2.5 | Error There was an error loading the BuildConfig: Cannot invoke method getAt() on null object (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) java.lang.NullPointerException: Cannot invoke method getAt() on null object at grails.util.BuildSettings.configureDependencyManager( BuildSettings.groovy:1259) at grails.util.BuildSettings$configureDependencyManager.callCurrent(Unknown Source) at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1170) at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1068) at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1050) at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source) at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1028) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke( ReflectiveInterceptor.java:1259) | Error There was an error loading the BuildConfig: Cannot invoke method getAt() on null object

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/annotationsatharvard/catcha/issues/82, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG-tzwf_J2C4UUcJTkkmGj1e_fSy9fiks5qugBDgaJpZM4KIcKZ .

sijpkes commented 8 years ago

Ok, great thanks @jmiranda. I tried that without success. So I've now provisioned a Vagrant box with Docker instead but have encountered other issues. docker-compose up -d seems to start successfully with:

Starting vagrant_db_1
Starting vagrant_app_1

But then Tomcat is not running on port 8080 (I've forwarded port 8080 from the vagrant box). I'm new to Docker.

jmiranda commented 8 years ago

Unfortunately, I'm new to docker as well (@xcompass wrote the Dockerfile). I'll follow the docker instructions to see if I can get it working and then report back.

Just out of curiosity are you just trying to set up a version for testing? Or are you looking to set up a development environment?

On Wed, Sep 28, 2016 at 7:16 PM, Paul Sijpkes notifications@github.com wrote:

Ok, great thanks @jmiranda https://github.com/jmiranda. I tried that without success. So I've now provisioned a Vagrant box with Docker instead but have encountered other issues. docker-compose up -d seems to start successfully with:

Starting vagrant_db_1 Starting vagrant_app_1

But then Tomcat is not running on port 8080 (I've forwarded port 8080 from the vagrant box). I'm new to Docker.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/annotationsatharvard/catcha/issues/82#issuecomment-250338080, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG-t3JaMeHTA_uNc12qxYKy0-qawzfrks5quwNlgaJpZM4KIcKZ .

sijpkes commented 8 years ago

I'm just setting up a version for testing. The annotation option looked interesting and I'm simply hoping to set it up on my desktop in Vagrant, sharing it to temporary URL using vagrant share and testing it out on my course.

I'm from the University of Newcastle and we are implementing MOOCs for the first time.

jmiranda commented 8 years ago

I had some difficulties with older versions of docker and docker-compose, but I was able to get it working using more recent versions of both on Ubuntu 16.04. I'm not using Vagrant though.

$ docker -v
Docker version 1.12.1, build 23cf638

$ docker-compose -version
docker-compose version 1.8.1, build 878cff1

That doesn't mean much for you, but just wanted to celebrate my great achievement. :)

It's pretty easy for me to set up servers myself so if you want I can set up a demo server for you tomorrow for testing. I've been meaning to set one up for awhile anyway, so it's no problem.

jmiranda commented 8 years ago

So, I think you may just need to wait longer than you expected. I just got this working on a digital ocean droplet, but it took about 5 minutes for Tomcat to initialize. That can occur if you're in an environment with very little memory (for example, I chose a 1GB droplet).

Also, I've learned a few things about docker that might be helpful. After running docker-compose command, you'll see the following output (sounds like it's slightly different when using vagrant).

$ docker-compose up -d
...
Removing intermediate container aaeebe4b4ea1
Step 7 : VOLUME ['/usr/local/tomcat/webapps/ROOT/uploads']
 ---> Running in 3ed226ffcfa5
 ---> 505f1f681c87
Removing intermediate container 3ed226ffcfa5
Successfully built 505f1f681c87
WARNING: Image for service app was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating catcha_db_1
Creating catcha_app_1

To view all logs for the two containers

$ docker-compose logs

To attach to the docker container running Tomcat, run the following command:

$ docker exec -it catcha_app_1 bash

To tail the tomcat logs on the catcha_app_1 container run the following command:

root@293a20335a4d:/usr/local/tomcat# tail -f logs/catalina.2016-09-29.log 
Sep 29, 2016 3:41:55 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/manager
Sep 29, 2016 3:41:55 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat/webapps/manager has finished in 181 ms
Sep 29, 2016 3:41:55 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Sep 29, 2016 3:41:55 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Sep 29, 2016 3:41:55 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 339426 ms

To attach to the docker container running MySQL run the following command:

$ docker exec -it catcha_db_1 bash
jmiranda commented 8 years ago

Ok, I just created a new test server using Docker on digital ocean (http://annotationhub.org:8080). Afterwards, I realized the docker stuff doesn't seed the database with any demo data. So tomorrow, I'll manually add some data and send you API credentials.

sijpkes commented 8 years ago

Thanks @jmiranda. I just checked the logs with your instructions and it seems you are right, there are out of memory errors peppered through them. I'll keep you posted!

sijpkes commented 8 years ago

I got it working. You were right, I swear it took over 10 mins to boot Tomcat.

Screenshot

So what's the default login? :neckbeard:

sijpkes commented 8 years ago

Ok, so I've got it working at the back-end now it's trying to load a bunch of images on EdX Edge from Stanford U.'s library and something called loris: http://54.187.32.48/loris/suzhou_orig.jp2 Any insights on how to get this working? FIrstly, most of this links aren't encrypted so it looks a bit out of date...

This is the EdX XML:

<annotatable>
    <instructions>
        <p>
            Add the instructions to the assignment here.
        </p>
    </instructions>
    <p>
        Lorem ipsum dolor sit amet, at amet animal petentium nec. Id augue nemore postulant mea. Ex eam dicant noluisse expetenda, alia admodum abhorreant qui et. An ceteros expetenda mea, tale natum ipsum quo no, ut pro paulo alienum noluisse.
    </p>
    <json>
        navigatorSizeRatio: 0.25,
        wrapHorizontal:     false,
        showNavigator: true,
        navigatorPosition: "BOTTOM_LEFT",
        showNavigationControl: true,
        tileSources:    [{"profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", "scale_factors": [1, 2, 4, 8, 16, 32, 64], "tile_height": 1024, "height": 3466, "width": 113793, "tile_width": 1024, "qualities": ["native", "bitonal", "grey", "color"], "formats": ["jpg", "png", "gif"], "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", "@id": "http://54.187.32.48/loris/suzhou_orig.jp2"}],
    </json>
</annotatable>
xcompass commented 8 years ago

@sijpkes I wasn't able to get the old image working. I think they removed the image. I have to run my own loris server. You can use my docker-compose file to run it: https://github.com/xcompass/catcha-docker

Once it's running, you just need to put your image into ./.data/images and loris will be able to serve it. Then you can get the json code from loris and replace it in edx.

Hope it helps.

xcompass commented 8 years ago

PS: If you are on mac or windows, you can try Docker for Mac or Docker for Windows. If you are on linux, you can just use docker directly.

jmiranda commented 8 years ago

@sijpkes 1) The default login credentials are admin : password. However, the demo data is not getting loaded for some reason -- will look into that today.

2) I am not familiar with the Loris server component or the edX XML stuff, so I'll leave that for @xcompass. Thank you @xcompass for jumping in here.

sijpkes commented 8 years ago

Thanks @xcompass. Your repo works perfectly out of the box! I was over complicating the whole thing by trying to run docker inside vagrant, which is wrong in so many ways! Now I'll just try and share it with ngrok and see how it goes in Edge.

xcompass commented 8 years ago

@sijpkes great!

sijpkes commented 8 years ago

@xcompass where is the .data/images folder? Is it in the docker container?

xcompass commented 8 years ago

On your host, where the docker-compose.yaml is.

On Thu, Sep 29, 2016, 6:20 PM Paul Sijpkes notifications@github.com wrote:

@xcompass https://github.com/xcompass where is the .data/images folder? Is it in the docker container?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/annotationsatharvard/catcha/issues/82#issuecomment-250635522, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcajMtt2dR_sO_mpBRwXjMxjbhXPkJFks5qvGPOgaJpZM4KIcKZ .

sijpkes commented 8 years ago

I've got it running, but am now trying to get my head around Loris and the auth token is not be working in Edge, loris is returning a 403.

I'm assuming I paste the token generated by the system section in catch-a? I'm also unclear about what the @context property is in this section of the xml?

{"profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", 
"scale_factors": [1, 2, 4, 8, 16, 32, 64], "tile_height": 1024, "height": 3466, "width": 113793, "tile_width": 1024, "qualities": ["native", "bitonal", "grey", "color"], 
"formats": ["jpg", "png", "gif"], "@context": "< contex.json ??? >", 
"@id": "https://679023b4.ngrok.io/loris/sample.jpf"}
xcompass commented 8 years ago

@sijpkes You need to get the json string from loris server. Run the following command from your docker host

curl http://localhost:5004/sample.jpf/info.json

You should get a json string and replace it with the whole section. Make sure the @id is pointing to the correct server. Now the image should load in edx.

I haven't got annotation working yet. I think there is a bug in edx when signing the jwt signature. And also missing the setup for API key generated from catcha app.

@jmiranda are you guys actually running this with edx? Or anyone else you know? Based on the bug I found, it wouldn't work at all. I wonder if we should use an older version with edx. Thanks.

jmiranda commented 8 years ago

@xcompass Yes HarvardX is using Catch v0.5.12 in production for a few edX courses. Can you create a new issue for the bug you discovered?

On Friday, September 30, 2016, Pan Luo notifications@github.com wrote:

@sijpkes https://github.com/sijpkes You need to get the json string from loris server. Run the following command from your docker host

curl http://localhost:5004/sample.jpf/info.json

You should get a json string and replace it with the whole section. Make sure the @id https://github.com/id is pointing to the correct server. Now the image should load in edx.

I haven't got annotation working yet. I think there is a bug in edx when signing the jwt signature. And also missing the setup for API key generated from catcha app.

@jmiranda https://github.com/jmiranda are you guys actually running this? Or is there anyone actually running this? Based on the bug I found, it wouldn't work at all.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/annotationsatharvard/catcha/issues/82#issuecomment-250668988, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG-t8N-z0rKGB0RTs8Y90ijBY4lga1iks5qvKs6gaJpZM4KIcKZ .

xcompass commented 8 years ago

@jmiranda since the bug is related to security. I would like to discuss in private. could you send me an email pan dot luo at ubc dot ca? I can send you details.

jmiranda commented 8 years ago

Will do. By the way @xcompass @sijpkes Do you guys see a benefit in creating a Slack to discuss questions related to installation issues, security, etc)?

xcompass commented 8 years ago

I think might be better to improve the docs. I have to go through the source code to figure them out.

jmiranda commented 8 years ago

Yes, exactly. That would be the idea behind using Slack, instead of GitHub Issues for these discussions. To allow users to discuss issues / problems they encounter (sometimes stemming from missing documentation) and then use those opportunities to update the documentation where applicable or create an issue in GitHub if there's a bug.

On Fri, Sep 30, 2016 at 10:40 AM, Pan Luo notifications@github.com wrote:

I think might be better to improve the docs. I have to go through the source code to figure them out.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/annotationsatharvard/catcha/issues/82#issuecomment-250778112, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG-twkghWhKpX48ZfzN1XybGZ2zHMY6ks5qvS13gaJpZM4KIcKZ .

xcompass commented 8 years ago

sure. Since we are already using slack. I don't mind :)

xcompass commented 8 years ago

@sijpkes Finally got it working but I have to fix a few bugs. If you want to use it with edx, you may have to wait until those PRs are merged. https://github.com/edx/edx-platform/pull/13629 https://github.com/annotationsatharvard/catcha/pull/85 https://github.com/annotationsatharvard/catcha/pull/84 https://github.com/annotationsatharvard/catcha/pull/83

jmiranda commented 8 years ago

Thanks @xcompass I will take a look at the PRs this week.

sijpkes commented 8 years ago

Thanks for all your hard work @xcompass and @jmiranda, just returned to work after a Labor day long weekend. I think a slack channel is just the ticket, this Issue has gone way off topic. @jmiranda did you set this up?

@xcompass I won't be trying to use this in production until next year. If you are building the changes into your branch I'll pull from yours as it is working 'out-of-the-box'. I'll be keeping an eye on those issues. Keep up the good work!

sijpkes commented 8 years ago

Looks like I'll have to wait until EdX Edge is updated to include the PRs.

xcompass commented 8 years ago

Yes. We are trying to use this tool this term. So we will try to push it through.

sijpkes commented 8 years ago

Excellent. Thanks for your help.

jmiranda commented 8 years ago

@sijpkes I'm going to set up the Slack this week. Will post back here and add a badge/link to the README.

sijpkes commented 8 years ago

Great. Thanks Justin!

jmiranda commented 8 years ago

The slack has finally been created (http://slack.annotationhub.org) and a badge was added to the README.