Building error - invalid CEN header

Greetings all,

I'm back in Canada now and starting to work on this issue http://openvpms.org/forum/medical-records-changing-order-visits .  To make things simple, I thought I would just side-step the NetBeans and/or Eclipse environment setups by following the guide http://openvpms.org/documentation/getting-started-openvpms . I think I finally checked out everything I needed (a few source references seem to be missing from the source list in that guide) but I get the following build errors:  

ian@Ians-MarkVL ~/openvpms $ mvn -Dmaven.test.skip install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   OpenVPMS
[INFO]   OpenVPMS Framework
[INFO]   OpenVPMS Maven Plugins
[INFO]   OpenVPMS Archetype Maven Plugin
[INFO]   OpenVPMS Data Maven Plugin
[INFO]   OpenVPMS Archetypes
[INFO]   OpenVPMS Reporting Framework
[INFO]   OpenVPMS Report Maven Plugin
[INFO]   OpenVPMS SMS
[INFO]   OpenVPMS ESCI adapter
[INFO]   Unnamed - org.openvpms:openvpms-web:pom:1.7.1
[INFO]   Unnamed - org.openvpms:openvpms-macro:jar:1.7.1
[INFO]   Unnamed - org.openvpms:openvpms-web-resource:jar:1.7.1
[INFO]   Unnamed - org.openvpms:openvpms-web-echo:jar:1.7.1
[INFO]   Unnamed - org.openvpms:openvpms-web-component:jar:1.7.1
[INFO]   Unnamed - org.openvpms:openvpms-web-workspaces:jar:1.7.1
[INFO]   OpenVPMS Web App
[INFO]   OpenVPMS ETL
[INFO]   OpenVPMS ETL Load Module
[INFO]   OpenVPMS Loader Plugin
[INFO]   OpenVPMS Release
[WARNING] POM for 'biz.aQute:bndlib:pom:1.50.0:runtime' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenVPMS
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [source:jar-no-fork {execution: attach-sources}]
[INFO] [assembly:single {execution: create-project-bundle}]
[INFO] Reading assembly descriptor: src/assemblies/src-distribution.xml
[INFO] Processing sources for module project: org.openvpms:maven-plugins:pom:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-sms:bundle:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-esci-adapter:bundle:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-framework:bundle:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-archetypes:bundle:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-reports:bundle:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-etl:pom:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-release:pom:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-web:pom:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-report-maven-plugin:maven-plugin:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-data-maven-plugin:maven-plugin:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-archetype-maven-plugin:maven-plugin:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-etl-load:jar:1.7.1
[INFO] Processing sources for module project: org.openvpms:openvpms-etl-plugin:pom:1.7.1
[INFO] Building zip: /home/ian/openvpms/target/openvpms-1.7.1-project.zip
[INFO] [install:install {execution: default-install}]
[INFO] Installing /home/ian/openvpms/pom.xml to /home/ian/.m2/repository/org/openvpms/openvpms/1.7.1/openvpms-1.7.1.pom
[INFO] Installing /home/ian/openvpms/target/openvpms-1.7.1-project.zip to /home/ian/.m2/repository/org/openvpms/openvpms/1.7.1/openvpms-1.7.1-project.zip
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenVPMS Framework
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [castor:generate {execution: default}]
[INFO] Nothing to process - all xsds are up to date
[INFO] Adding resource /home/ian/openvpms-framework/target/generated-sources/castor ...
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 25 resources
[INFO] Copying 23 resources
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 419 source files to /home/ian/openvpms-framework/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: error reading /home/ian/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar; invalid CEN header (bad signature)
[ERROR] error: error reading /home/ian/.m2/repository/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading /home/ian/.m2/repository/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar; invalid CEN header (bad signature)
[ERROR] error: error reading /home/ian/.m2/repository/org/springframework/security/spring-security-core/3.0.3.RELEASE/spring-security-core-3.0.3.RELEASE.jar; invalid CEN header (bad signature)
[ERROR] error: error reading /home/ian/.m2/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar; invalid LOC header (bad signature)
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

error: error reading /home/ian/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar; invalid CEN header (bad signature)
error: error reading /home/ian/.m2/repository/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar; invalid LOC header (bad signature)
error: error reading /home/ian/.m2/repository/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar; invalid CEN header (bad signature)
error: error reading /home/ian/.m2/repository/org/springframework/security/spring-security-core/3.0.3.RELEASE/spring-security-core-3.0.3.RELEASE.jar; invalid CEN header (bad signature)
error: error reading /home/ian/.m2/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar; invalid LOC header (bad signature)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Jul 10 08:24:19 PDT 2014
[INFO] Final Memory: 37M/470M
[INFO] ------------------------------------------------------------------------
ian@Ians-MarkVL ~/openvpms $

ian@Ians-MarkVL ~ $ mvn -version
Apache Maven 2.2.1 (rdebian-10)
Java version: 1.7.0_55
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.11.0-12-generic" arch: "amd64" Family: "unix"
ian@Ians-MarkVL ~ $

It looked at first like it might be an unzip error but a file test

>file spring-core-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar: Zip archive data, at least v1.0 to extract

suggests that v1.0 will extract it, so I can't think it is an openjdk issue.

Just wondering how to address this.

Thanks,

Sam

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Building error - invalid CEN header

It sounds like the jars haven't downloaded correctly. You can check this by running:

jar tvf /home/ian/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar

If it can't read them, then remove them and try again.

Re: Building error - invalid CEN header

java.util.zip.ZipException: invalid CEN header (bad signature)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:215)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at java.util.zip.ZipFile.<init>(ZipFile.java:116)
    at sun.tools.jar.Main.list(Main.java:1004)
    at sun.tools.jar.Main.run(Main.java:245)
    at sun.tools.jar.Main.main(Main.java:1177)

I've wiped everything and downloaded again several times... here's my bash script that I have been using for the downloads.

#!/bin/bash

cd ~
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/openvpms/trunk -DcheckoutDirectory=openvpms
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/framework/trunk -DcheckoutDirectory=openvpms-framework
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/maven/trunk -DcheckoutDirectory=maven-plugins
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/archetypes/trunk -DcheckoutDirectory=openvpms-archetypes
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/reports/trunk -DcheckoutDirectory=openvpms-reports
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/openvpms-sms/trunk -DcheckoutDirectory=openvpms-sms
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/esci-adapter/trunk -DcheckoutDirectory=openvpms-esci-adapter
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/vpms/trunk -DcheckoutDirectory=openvpms-web
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/etl/trunk -DcheckoutDirectory=openvpms-etl
mvn scm:checkout -DconnectionUrl=scm:svn:svn://svn.openvpms.org/openvpms/release/trunk -DcheckoutDirectory=openvpms-release

I added the sms and esci checkouts and took a bit of a stab at the DcheckoutDirectory names.  Not sure if those are correct, but don't see it causing this problem.(?)

Thanks,

Sam

Re: Building error - invalid CEN header

The problem is with the jars residing in your maven repository, not the openvpms checkouts.

You can remove these individually or try http://maven.apache.org/plugins/maven-dependency-plugin/examples/purging...

Re: Building error - invalid CEN header

OK... that was helpful.  I removed the offending jars manually and things progressed but eventually just wound up wiping everything, including the .m2 directory and starting from scratch.  Much better.  Running mvn -Dmaven.test.skip install however, eventually led to this error:

[INFO] [sql:execute {execution: drop-db}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Access denied for user 'root'@'localhost' (using password: YES)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23 minutes 58 seconds
[INFO] Finished at: Fri Jul 11 07:48:29 PDT 2014
[INFO] Final Memory: 180M/427M
[INFO] ------------------------------------------------------------------------

Actually, that is a satifying error as I was wondering how it was going to set up a database without requesting a MySql password.  How do I supply that?  Or do I need to set the root MySql password to 'YES'? Would hate to do that!

Getting there...

Thanks,

Sam

Re: Building error - invalid CEN header

In 1.7.x there are database properties specified in both openvpms/pom.xml and openvpms-release/pom.xml, which you can override on the command line, or via a settings.xml file. Or you can just update in place.

In openvpms/pom.xml:

        <jdbc.url>jdbc:mysql://localhost:3306/openvpms</jdbc.url>
        <jdbc.username>openvpms</jdbc.username>
        <jdbc.password>openvpms</jdbc.password>

In openvpms-release/pom.xml:

        <jdbc.admin.url>jdbc:mysql://localhost:3306/</jdbc.admin.url>
        <jdbc.admin.username>root</jdbc.admin.username>
        <jdbc.admin.password>root</jdbc.admin.password>

Just be aware that the build process drops and recreates whatever database is specified.

 

Re: Building error - invalid CEN header

Excellent... getting close now.

Had a successful build after changinf the root password. Also successfully created the database schema and loaded the data.  But getting hung at the last step - "Building and deploying the webapp"

The instructions suggest cd'ing into openvpms-vpms, but I don't have that directory.  When I try to execute mvn -Dmaven.test.skip tomcat:run out of the openvpms directory, it runs for a while then in this section

[INFO] ------------------------------------------------------------------------
[INFO] Building OpenVPMS Web App
[INFO]    task-segment: [tomcat:run]
[INFO] ------------------------------------------------------------------------

the first signs of trouble are at:

INFO: Initializing Spring root WebApplicationContext
[WARN,PropertiesFactoryBean,main] Could not load properties from class path resource [default-openvpms.properties]: class path resource [default-openvpms.properties] cannot be opened because it does not exist
[WARN,DisposableBeanAdapter,main] Invocation of destroy method failed on bean with name 'sessionFactory': org.hibernate.cache.CacheException: java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.
[ERROR,ContextLoader,main] Context initialization failed
Jul 11, 2014 6:04:57 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.openvpms.web.workspace.patient.summary.DefaultCustomerPatientSummaryFactory] for bean with name 'org.openvpms.web.workspace.patient.summary.DefaultCustomerPatientSummaryFactory#0' defined in ServletContext resource [/WEB-INF/openvpms-web-app.xml]; nested exception is java.lang.ClassNotFoundException: org.openvpms.web.workspace.patient.summary.DefaultCustomerPatientSummaryFactor

and get progressively worse, ending with

Jul 11, 2014 6:04:57 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/openvpms] appears to have started a thread named [scheduler_Worker-10] but has failed to stop it. This is very likely to create a memory leak.

then seems to hang. 

Is there a step I'm missing that would create openvpms-vpms or is there another issue that is causing the fail?

Thanks.

Re: Building error - invalid CEN header

Sorry - that document was out of date. It now should reflect how to build out of svn for the current trunk which is 1.7.1.

Once you have built the dependent jars, and set up the database, you should be able to:

> cd openvpms-web/openvpms-web-app
> mvn -DskipTests tomcat:run

 

Re: Building error - invalid CEN header

OK... that seems to work better for a while.

Second line of the output is:

[WARNING] POM for 'biz.aQute:bndlib:pom:1.50.0:runtime' is invalid.

but continues to download many files, then:

INFO: Initializing log4j from [/home/ian/openvpms-web/openvpms-web-app/src/webapp/WEB-INF/classes/log4j.properties]
log4j:ERROR Could not read configuration file from URL [file:/home/ian/openvpms-web/openvpms-web-app/src/webapp/WEB-INF/classes/log4j.properties].
java.io.FileNotFoundException: /home/ian/openvpms-web/openvpms-web-app/src/webapp/WEB-INF/classes/log4j.properties (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileInputStream.<init>(FileInputStream.java:101)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at java.net.URL.openStream(URL.java:1037)

--- snip ---

    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
log4j:ERROR Ignoring configuration file [file:/home/ian/openvpms-web/openvpms-web-app/src/webapp/WEB-INF/classes/log4j.properties].
Jul 11, 2014 7:43:47 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 11, 2014 7:43:47 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080

(hang)

^C

log4j:WARN No appenders could be found for logger (org.springframework.beans.factory.support.DisposableBeanAdapter).
log4j:WARN Please initialize the log4j system properly.

So log4j seems to be the common thread here.

Sam

Re: Building error - invalid CEN header

You can ignore that stuff. Once it gets to:

INFO: Starting Coyote HTTP/1.1 on http-8080

you should be able to connect to http://localhost:8080/openvpms/login

Re: Building error - invalid CEN header

Ah, you're correct. So it is working. Cha-ching! Guess that wasn't what I was expecting. I thought that it would only create a .war file.  But I think I've found what I need in openvpms-release/target/openvpms-release-1.7.1.zip. Awesome. Now I can get to working on the medical records themselves. 

Thanks Tim!

Sam

Re: Building error - invalid CEN header

The .war is generated by the openvpms-web-app module when you run mvn install.

When developing, its faster to make the changes and start tomcat with tomcat:run than building a war and deploying it.

The main thing to remember is that you need to do a mvn install in the module you are changing in order for it to be picked up by tomcat:run.

 

Syndicate content