Menu

#16 update to use maven and spring boot

accepted
R Regan
None
5
2018-02-08
2018-01-16
R Regan
No

update to use maven and spring boot

Discussion

  • R Regan

    R Regan - 2018-01-16

    I switched to maven and spring boot with new versions of libraries. There are still some jars that aren't in a maven repo so I added a script install-lib-mvn.sh that uses mvn install:install-file to install echopm.jar, echopointng-2.2.0rc2.jar, Echo2_FileTransfer_WebContainer.jar, and Echo2_FileTransfer_App.jar from lib/echo folder into local maven repo.

    I had to modify some classes due to api changes. some tests were changed to compile, but may not run.

    some things aren't working like Stanford parser and ner.

     
  • R Regan

    R Regan - 2018-01-17

    I had to switch to using Echo2_Extras_WebContainer.jar from the lib folder as there is bug in the maven version. I hit this issue back in 2009 and updated the DND.js file (in src/main/resource/echo). I forked https://github.com/echo3/echo2extras and submitted a pull request with the fix. lets see what happens.

    In AbstractProjectOrDomainEntity I updated the @JoinColumn(name="projectordomain_id") annotation on getProjectOrDomain() to remove "insertable = false, updatable = false" as I was getting an exception trying to save a project that projectordomain_id had no default value.

    After these fixes I was able to create all the different project elements.

     
  • R Regan

    R Regan - 2018-01-28

    I deleted a bunch of the files in conf that were part of the ant build configuration.

    In JpaDictionaryRepository I switched from using URI based resource access to stream/reader based, as the file is now being access from inside the jar vs. on the file system and the URI constructor was throwing an IllegalArgumentException: URI is not hierarchical.

    I @Deprecated DatabaseCreationListener and use createDatabaseIfNotExist=true on the jdbc url. the db properties are no longer in use.

     
  • R Regan

    R Regan - 2018-01-28

    I had to switch to using local lib Echo2 files I forked https://github.com/echo3/echo2. I changed the mime type returned by the javascript service to "application/javascript" as spring boot security uses X-Content-Type-Options: nosniff so that returning the javascript files with type "plain/text" causing the error "Refused to execute script from serviceId=Echo.ClientEngine because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled."

     
  • R Regan

    R Regan - 2018-01-28

    Now I can start the app and pass args on the command line for the database:

    java -jar Requel-1.0.1.jar --spring.datasource.url=jdbc:mysql://localhost:3306/requeldb?createDatabaseIfNotExist=true --spring.datasource.username=root --spring.datasource.password=password

     
  • R Regan

    R Regan - 2018-02-03

    I added a README.md file for the file upload page on sourceforge.

    I added a Dockerfile, I was trying to integrate it with the build in the pom.xml see dockerfile-maven-plugin. The plug-in wasn't able to connect to the boot2docker vm for the build using docker toolbox.

    I was able to manually build the Docker image and push to the repository see the rreganjr/requel repo

     

    Last edit: R Regan 2018-02-03
  • R Regan

    R Regan - 2018-02-03

    I fixed the integration with Stanford parser and NER, now using version 3.8. I had to rebuild the GrammaticalRelationType enum as Stanford switched to using the Universal Dependencies http://universaldependencies.org/ for grammatical annotation. The code doesn't reference that many so it wasn't that hard to convert. I added a utility class GrammaticalRelationTypeBuilder that generated the enum entries based on the Stanford entries in the class UniversalEnglishGrammaticalRelations.

    In my StanfordLexicalizedParser wrapper class I had to change parse() to handle a fake ROOT node referenced by a root dependency, the index() of the dependencies starts with the first word as 1 so I normally subtract 1 to get the list index of the word, but the ROOT has index of 0 so I handle it specially. It doesn't reference a word in the sentence.

    I was able to include the nlp models via a maven dependency. I need to remove the old ones.

     
  • R Regan

    R Regan - 2018-02-03

    I removed a lot of old jar resources.

    I switched the parser to use typedDependenciesEnhancedPlusPlus() for more grammatical relationship info from the parser in the Dependencies output.

     
  • R Regan

    R Regan - 2018-02-08

    To get the file upload UI to appear I had to set the X-Frame-Options to samedomain in the Application inner class WebSecurityConfig by adding .and().headers().frameOptions().sameOrigin() to the HttpSecurity passed into configure(). I could then upload an xslt in the document tab. Project import is failing with a NoSuchClassException()

    I change the xml name space from "http://www.people.fas.harvard.edu/~rregan/requel" to "http://www.rreganjr.com/requel" and I fixed the classes to be under com.rreganjr.requel for the entityType attribute in the projectPermission element in Requel.xml. That didn't fix the import

     
  • R Regan

    R Regan - 2018-02-08

    Stack trace for project import:

    java.lang.ClassNotFoundException: com.sun.xml.bind.v2.model.annotation.AnnotationReader
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_72]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_72]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_72]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_72]
        at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_72]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[na:1.8.0_72]
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_72]
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_72]
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_72]
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_72]
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_72]
        at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_72]
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_72]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_72]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_72]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_72]
        at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_72]
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_72]
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048) ~[na:1.8.0_72]
        at java.lang.Class.getMethod0(Class.java:3018) ~[na:1.8.0_72]
        at java.lang.Class.getMethod(Class.java:1784) ~[na:1.8.0_72]
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:242) ~[na:1.8.0_72]
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234) ~[na:1.8.0_72]
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:441) ~[na:1.8.0_72]
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641) ~[na:1.8.0_72]
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584) ~[na:1.8.0_72]
        at com.rreganjr.requel.project.impl.command.ImportProjectCommandImpl.execute(ImportProjectCommandImpl.java:137) ~[classes/:na]
    
     
  • R Regan

    R Regan - 2018-02-08

    The ClassNotFoundException: com.sun.xml.bind.v2.model.annotation.AnnotationReader was caused by a change in the structure of the jaxb source code structure. I added a dependency for jaxb-core and project import worked! I also removed activation as it isn't needed anymore.

    Thanks to https://stackoverflow.com/questions/36557308/caused-by-java-lang-classnotfoundexception-com-sun-xml-bind-v2-model-annotatio

    After this fix I was able to import the Requel.xml sample file.

    All of the original functionality is now working.

     

Log in to post a comment.