JBOSS | Jasper report error - jboss

My application generates some reports to it's clients. But there's an error when generating the reports here's the exception:-
java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer.<init>(Lorg/eclipse/jdt/internal/compiler/env/IBinaryType;)V
net.sf.jasperreports.engine.design.JRJdtCompiler$1.findType(JRJdtCompiler.java:235)
net.sf.jasperreports.engine.design.JRJdtCompiler$1.findType(JRJdtCompiler.java:204)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:126)
org.eclipse.jdt.internal.compiler.lookup.Scope.findType(Scope.java:1355)
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2472)
org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2194)
org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:39)
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1107)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:767)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:947)
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:266)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:195)
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
net.sf.jasperreports.engine.design.JRJdtCompiler.compileClass(JRJdtCompiler.java:392)
net.sf.jasperreports.engine.design.JRJdtCompiler.compileReport(JRJdtCompiler.java:109)
net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:106)
net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)
net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:110)
Recently I moved this application to JBOSS 4.0.5.GA. This application was running fine and there's no errors in generating reports in Tomcat 5
Thanks.

I believe there is a conflicting JAR file:
jdt-compiler-3.1.1.jar
I created a script to set the CLASSPATH before Tomcat runs:
#!/bin/bash
IREPORT_HOME=$HOME/bin/ireport
CLASSPATH=$IREPORT_HOME/platform9/modules/org-netbeans-core.jar:
for j in \
$IREPORT_HOME/ireport/modules/ext/*.jar \
$IREPORT_HOME/ide10/modules/ext/*.jar; do
BASENAME=$(basename $j)
# Append file names to the CLASSPATH, except those with Tomcat conflicts.
if [ "$BASENAME" != "jdt-compiler-3.1.1.jar" ]; then
CLASSPATH=$j:$CLASSPATH
fi
done
export CLASSPATH=$CLASSPATH.
Save it as setenv.sh and place it in $CATALINA_HOME/bin. You will have to change the IREPORT_HOME variable accordingly.

Related

Installing php extension for SQL Anywhere on server with CentOS, Plesk, php-fpm

we got a new WebServer with CentOS, Plesk and php-fpm.
Now we don't get the php extension running.
What we did:
installed latest SQL Anywhere 17 (ebf29577)
copied php-7.3.0_sqlanywhere_r.so to /opt/plesk/php/7.3/lib64/php/modules/
loading php-7.3.0_sqlanywhere_r.so via /opt/plesk/php/7.3/etc/php.d/sqlanywhere.ini
this leads to an error:
WARNING: [pool plesk-php73-fpm.plesk-service.localdomain] child 11616 said into stderr: "NOTICE: PHP message: PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0"
(This leads to php 7.3 fpm is not loading at all)
next try was to switch from FPM to CGI: same error
module is loadable itself within shell if LD_LIBRARY_PATH was enhanced with path /opt/sqlanywhere17/lib64/
some tries getting the cause by strace did not help
Has anybody an idea or maybe even successfully installed php extension.
Thanks
Florian
after a lot of tests we found a solution:
in Plesk Domain php settings we had to add:
[php-fpm-pool-settings]
env[LD_LIBRARY_PATH]="/opt/sqlanywhere_v2/lib64:$LD_LIBRARY_PATH"
Now all libs are found and it works
For me solution was, creating custom handler:
plesk bin php_handler --add -displayname "PHP SQLAnywhere 7.4" -path /opt/php-custom-handlers/7.4/php-sqlanywhere.fcgi -clipath /opt/plesk/php/7.4/bin/php -phpini /opt/plesk/php/7.4/etc/php.ini -type fastcgi
php-sqlanywhere.fcgi contents:
#!/bin/bash
LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64
export LD_LIBRARY_PATH
exec /opt/plesk/php/7.4/bin/php-cgi "$#"
And finally using this handler on domain php settings and adding on additional directives:
extension=sqlanywhere.so

Spring Webmvc NoClassDefFoundError for class 'ModelAndViewDefiningException'

I have looked into this similar post here: NoClassDefFoundError ModelAndViewDefiningException on spring+was8.5.5.13, but it had no solutions.
I have unpacked my war file, and unpacked a library within it to verify it does contain the class mentioned in the NoClassDefFoundError:
spring-webmvc-4.3.6.RELEASE.jar contains org/springframework/web/servlet/ModelAndViewDefiningException.class.
These are all my spring-related dependencies:
lib/metrics-spring-3.1.0 2 2.jar
lib/metrics-spring-3.1.0 2 3.jar
lib/metrics-spring-3.1.0 2.jar
lib/metrics-spring-3.1.0 3.jar
lib/metrics-spring-3.1.0.jar
lib/micrometer-spring-legacy-1.1.0.jar
lib/spring-aop-4.3.6.RELEASE.jar
lib/spring-aspects-4.3.6.RELEASE.jar
lib/spring-beans-4.3.6.RELEASE.jar
lib/spring-boot-2.1.1.RELEASE.jar
lib/spring-boot-actuator-2.1.1.RELEASE.jar
lib/spring-boot-actuator-autoconfigure-2.1.1.RELEASE.jar
lib/spring-boot-autoconfigure-2.1.1.RELEASE.jar
lib/spring-boot-starter-2.1.1.RELEASE.jar
lib/spring-boot-starter-actuator-2.1.1.RELEASE.jar
lib/spring-boot-starter-logging-2.1.1.RELEASE.jar
lib/spring-cloud-aws-autoconfigure-2.0.1.RELEASE.jar
lib/spring-cloud-aws-context-2.0.1.RELEASE.jar
lib/spring-cloud-aws-core-2.0.1.RELEASE.jar
lib/spring-cloud-starter-aws-2.0.1.RELEASE.jar
lib/spring-context-4.3.6.RELEASE.jar
lib/spring-context-support-4.1.6.RELEASE.jar
lib/spring-core-4.3.6.RELEASE.jar
lib/spring-data-commons-1.12.7.RELEASE.jar
lib/spring-data-jpa-1.10.7.RELEASE.jar
lib/spring-expression-4.3.6.RELEASE.jar
lib/spring-jdbc-4.3.6.RELEASE.jar
lib/spring-orm-4.3.6.RELEASE.jar
lib/spring-security-core-4.0.2.RELEASE.jar
lib/spring-test-4.3.6.RELEASE.jar
lib/spring-tx-4.3.6.RELEASE.jar
lib/spring-web-4.3.6.RELEASE.jar
lib/spring-webmvc-4.3.6.RELEASE.jar
The last one only containing the specified class "ModelAndViewDefiningException" in the NoClassDefFoundError.
I have scanned through the unpacked jar file using my bash script to verify that the ModelAndViewDefiningException does indeed exist.
#!/bin/bash
for filename in lib/*spring*.jar; do
x=`jar -tvf "$filename" | grep 'ModelAndViewDefiningException'`
if test ! -z "$x"
then
echo $filename " class found is: " $x
fi
done
It does indeed exist, through my script above:
lib/spring-webmvc-4.3.6.RELEASE.jar class found is: 854 Wed Jan 25 13:16:28 AEDT 2017 org/springframework/web/servlet/ModelAndViewDefiningException.class
ip-192-168-0-13:WEB-INF
This occurs because of maxed out file handles. This application runs on an Amazon instance production server, doing loads of volume. Running applications like Nginx, and some of our own applications.
That's why the JVM was unable to load in the class, because there weren't any file handles, hence the NoClassDefFoundError exception was being thrown.

PHP Warning: Module 'imagick' already loaded in Unknown on line 0, need some assistance

So I checked my spam folder today and had 122 messages send through the server stating:
PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Non stop it keeps sending me this.
Googled it and still have no clue on how to fix it as I need a step by step answer.
Found a similar question on stack but it's too complicated for me to understand.
I'm on the latest Plesk Onyx and OS=Ubuntu 16.04.6 LTS‬.
As I'm running php 7.3 I hoped when I uninstalled php 7.0 in plesk it would go away but unfortunately it didn't.
It's send from here
Cron <root#server> [ -x /usr/lib/php/sessionclean ] && /usr/lib/php/sessionclean
And after php --ini (read about it on a forum) this was the result:
PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/00-ioncube-loader-7.0.ini,
/etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-curl.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-imagick.ini,
/etc/php/7.0/cli/conf.d/20-imap.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sqlite3.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini,
/etc/php/7.0/cli/conf.d/20-zip.ini,
/etc/php/7.0/cli/conf.d/zend_extensions_psa.ini
I already know it's probably easily fixed when you know linux but I'm learning on the go and posses very little knowledge yet.
Could anyone assist me with the right commands?
Cheers
Locate where is your php.ini file by:
php -i | grep Configuration
Configuration File (php.ini) Path => /usr/local/etc/php/7.4
Loaded Configuration File => /usr/local/etc/php/7.4/php.ini
Open the php.ini file and remove the line:
extension=imagick.so
or change the line to a comment:
; extension=imagick.so

Adding a user to a WildFly server, results in error

I am trying to add a user to WildFly server but get an error:
./add-user.sh: 1: eval: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin/java: not found
I suppose I need to change the JAVA_HOME location in a .conf file but have done so in the .conf files of the wildfly/bin directory. How can I solve this issue?
The add-user.sh script doesn't source any configuration file, so you have to provide the Java binary through your environment.
You can do this in multiple ways :
through a JAVA variable pointing to the java executable :
export JAVA=/path/to/jdk_install/bin/java
./add-user.sh [...]
through a JAVA_HOME variable pointing to the Java installation directory :
export JAVA_HOME=/path/to/jdk_install/
./add-user.sh [...]
by including the Java's installation bin directory to your PATH :
export PATH="/path/to/jdk_install/bin:$PATH"
./add-user.sh [...]
Note that these may vary depending on the WildFly or JBoss EAP version ; I gathered these from reading the script of a wildfly-8.1.0.Final installation.
If you're not sure this applies to your own version and if you have even the most basic understanding of shell scripts you should check your own : they're only a few dozens lines long and are well commented.
Your java path is wrong.
You can observe that in below line there is extra '/bin/java'. You should remove that.
./add-user.sh: 1: eval: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin/java: not found
To do so, in your adduser.sh/.bat file replace
# Setup the JVM
if [ "x$JAVA" = "x" ]; then
if [ "x$JAVA_HOME" != "x" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA="java"
fi
fi
To
# Setup the JVM
if [ "x$JAVA" = "x" ]; then
if [ "x$JAVA_HOME" != "x" ]; then
JAVA="$JAVA_HOME"
else
JAVA="java"
fi
fi
This does the magic for me.

Run Perl CGI script in Tomcat 7.0.70

I am trying to host my cgi page in the Tomcat 7.0.70 webserver in linux box.
I have done the below steps and also I am unable to view my cgi page in the browser.
I have created a CGI script named as "test.pl".
#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach (sort keys %ENV)
{
print "<b>$_</b>: $ENV{$_}<br>\n";
}
I have created a dir "myprog" in ~/myweb/apache-tomcat-7.0.70/webapps/ path.
Then I have created a dir "WEB-INF" in ~/myweb/apache-tomcat-7.0.70/webapps/myprog/
Then I have created a "cgi" directory inside the "myprog/WEB-INF/" and placed the test.pl file.
Then I have removed the comments from web.xml for the below lines , which is located in ~/myweb/apache-tomcat-7.0.70/conf/
cgi
org.apache.catalina.servlets.CGIServlet
debug
0
cgiPathPrefix
WEB-INF/cgi
5
And, servlet-mapping area as well.
After that I have downloaded the servlets-cgi-4.1.36.jar and servlets-ssi-5.0.16.jar files into ~/myweb/apache-tomcat-7.0.70/lib/
Then, I tried to run the file from my windows machine from the web browser: http://devserver.com/myprog/ and it returns the message as
HTTP Status 404 - /myprog/
type Status report
message /myprog/
description The requested resource is not available.
Apache Tomcat/7.0.70
Please someone assist/suggest to get this resolved.
The server log excerpt that you posted indicates that your web application needs to be privileged to use CGIServlet. In /webapps/myprog/META-INF, add a file context.xml with
<Context privileged="true">
</Context>