Giter VIP home page Giter VIP logo

grails-geoip's People

Contributors

donbeave avatar plocke avatar stsefanenko avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

grails-geoip's Issues

Adding to a plugin doesn't work

I'm developing a plugin that provides custom mapping functions - used by a few of our client apps. I've tried adding this plugin to my plugin (data file gets successfully copied into its web-app/data/maxmind/ dir) yet it can't find the GeoLiteCity.dat file when the app runs (via grails run-app and plugin running "in-place"). I've got a defaultConfig.groovy file in my plugin that gets merged into my client app config and when I set:

grails.plugin.geoip.data.resource = '/data/maxmind/GeoLiteCity.dat'

I get a message:

java.io.FileNotFoundException: /Users/xxxxx/github/my-app/web-app/data/maxmind/GeoLiteCity.dat (No such file or directory)

Due to the fact the dat file is in my plugin's web-app and not my client app's web-app (where it is looking).

If I run run-war I get a different error:

java.io.FileNotFoundException: /Users/xxxxx/github/my-app/target/work/tomcat/webapps/my-app/data/maxmind/GeoLiteCity.dat

Note my-app appears twice in the path.

If I set an absolute path for grails.plugin.geoip.data.pathon my machine it works but I need this to work relative to my plugin, in any of my client apps.

How can I configure the plugin so it looks for the dat file in my plugin web-app directory and not in the client app's version?

This plugin tries to take over methods that it shouldn't

This block of code sometimes grabs things like the message(...) method built into grails, causing it to crash when used in controllers. Suggest not throwing MissingMethodException if the method doesn't start with 'isIn' (remove the else block completely)

klass.metaClass.methodMissing = { String methodName, args ->
      if (methodName.startsWith('isIn')) {
       .... your code ...
      } else {
        throw new MissingMethodException(methodName, delegate, args)
      }
}

Setting the data file by resource does not work in Grails 2.4 integration tests

I am working on upgrading an application from 2.3.11 to 2.4.4

I have integration tests that use GeoIP.

When running integration tests, application.parentContext is null, so loading the resource fails. When running the application itself, it is not null.

I am configuring the data file location using grails.plugin.geoip.data.resource=classpath:/geoip/GeoLiteCity.dat, although the default configuration and data file location also fail.

By the time the code in the integration spec is executed, the parent context is in place.

I haven't figured out exactly what changed with Grails 2.4, or how to work around it yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.