Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Atk/Swing errors running a report #10

Closed
johnmanko opened this issue Aug 10, 2017 · 2 comments
Closed

Getting Atk/Swing errors running a report #10

johnmanko opened this issue Aug 10, 2017 · 2 comments

Comments

@johnmanko
Copy link

johnmanko commented Aug 10, 2017

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
Copy link
Contributor

@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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants