TIBCOSoftware / js-docker

Container deployment of TIBCO JasperReports® Server
144 stars 146 forks source link

Getting Atk/Swing errors running a report #10

Closed johnmanko closed 7 years ago

johnmanko commented 7 years ago

I created a Docker Image using CE 6.4.0 (which you can find at jmankoago/jasperserver:6.4.0).

Everything spins up in Docker just fine, and I'm able to add Reports. When running a Report, however, I get an error: java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper: docker_service_logs_jasperserver_jasperserver.txt

2017-08-10 17:59:44,693 ERROR JRFillSubreport,pool-4-thread-1:866 - Fill 1: exception
java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper

Subsequent attempts to run that same report give a different error: java.lang.NoClassDefFoundError: Could not initialize class javax.swing.RepaintManager:

Could not initialize class javax.swing.RepaintManager.txt

2017-08-10 18:08:05,997 ERROR JRFillSubreport,pool-4-thread-2:866 - Fill 1: exception
java.lang.NoClassDefFoundError: Could not initialize class javax.swing.RepaintManager

Here is the docker-compose.yml file:

version: '3'

services:
  jasperserver:
    image: jmankoago/jasperserver:6.4.0
    ports:
      - "8080:8080"
      - "8443:8443"
    depends_on:
      - jasperdatabase
    env_file: .env
    environment:
      - DB_HOST=jasperdatabase
    volumes:
      - jasper_webapp:/usr/local/tomcat/webapps/jasperserver-pro
      - jasper_license:/usr/local/share/jasperreports-pro/license 
      - jasper_customization:/usr/local/share/jasperreports-pro/customization
    networks:
      - reportsnet

  jasperdatabase:
    image: postgres:9.5
    env_file: .env
    volumes:
      - pgdata:/var/lib/postgresql/data
    networks:
      - reportsnet

networks:
  reportsnet:

volumes:
  pgdata:
  jasper_webapp:
  jasper_license:
  jasper_customization:

The (modified) Dockerfile used to build the image:

FROM tomcat:8-jre8

COPY resources/jasperreports-server*zip /tmp/jasperserver.zip

RUN apt-get update && apt-get install -y postgresql-client unzip xmlstarlet && \
    rm -rf /var/lib/apt/lists/* && \
    unzip /tmp/jasperserver.zip -d /usr/src/ && \
    mv /usr/src/jasperreports-server-* /usr/src/jasperreports-server && \
    mkdir -p /usr/local/share/jasperreports/license && \
    rm -rf /tmp/*

COPY resources/phantomjs*bz2 /tmp/phantomjs.tar.bz2

RUN tar -xjf /tmp/phantomjs.tar.bz2 -C /tmp && \
    rm -f /tmp/phantomjs.tar.bz2 && \
    mv /tmp/phantomjs*linux-x86_64 /usr/local/share/phantomjs && \
    ln -sf /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin && \
    rm -rf /tmp/*

ENV CATALINA_OPTS="${JAVA_OPTIONS:--Xmx2g -XX:+UseParNewGC \
    -XX:+UseConcMarkSweepGC} \
    -Djs.license.directory=${JRS_LICENSE:-/usr/local/share/jasperreports/license}"

COPY resources/tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml

EXPOSE ${HTTP_PORT:-8080} ${HTTPS_PORT:-8443}

COPY scripts/entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

CMD ["run"]

The (modified) scripts/entrypoint.sh script:

entrypoint.txt

tomcat-users.xml (which didn't seem to work, but this is unrelated - just here for completeness):

<tomcat-users>
    <role rolename="manager-gui"/>
    <user username="admin" password="admin" roles="manager-gui"/>
</tomcat-users>
nataliiakel commented 7 years ago

@johnmanko the error doesn't seem to have anything to do with docker setup. Have you tried building locally and running report? Also, pls try setting JAVA_OPTS - java -Djava.awt.headless=true and restart server. The server requires to have graphical environment for fonts and other graphic related routines that are part of the Java AWT. Lets see if starting JVM with an option for headless support helps.

nataliiakel commented 7 years ago

I will mark issue resolved. Please, reopen if issue persists