Class not whitelisted for RMI

Questions and answers on developing, deploying and using plugins and JavaBeans

Class not whitelisted for RMI

Postby kwpsd » Fri Feb 03, 2017 2:49 am

Servoy 8.1.1
JRE 1.8.0_121
Jasper Plugin 6.0.0
Smart Client

We installed Servoy 8.1.1 (server only) on a customer's server and imported a solution. When we attempt to print a Jasper report within the solution, we get the following error:

not_rmi_whitelisted.png
not_rmi_whitelisted.png (10.75 KiB) Viewed 11686 times


We found this item on how to whitelist .jar files using the RMI but do not believe the 'net.sf.jasperreports.engine.JasperPrint;' pertains to the whitelist (it's not a .jar file...at least, we could not find it):

http://forum.servoy.com/viewtopic.php?f=16&t=21087

Does anyone know what is causing the error and how to fix it?

Thanks!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: Class not whitelisted for RMI

Postby sbutler » Fri Feb 03, 2017 2:59 am

I don't use the smart client much any more, so I haven't experienced this, but the whitelisting using the rmi-whitelist.jar from Johan's post looks like its referencing packages, not jars. A jar is just a zip of a folder structure with some extras, so in this example, it looks like you probably want to add "net.sf.jasperreports." to your whitelist (note the period at the end). Then all the classes under those packages/folders in the jar will be whitelisted.

Just a guess, I haven't tried it before :)

PS. If you unzip the jasperreports-X.X.X.jar, you'll see that folder structure and class in there.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Class not whitelisted for RMI

Postby kwpsd » Fri Feb 03, 2017 9:50 pm

Ah, thank you Scott...now I understand what is needed.

I found the RMI white list here:

Code: Select all
C:\Servoy\application_server\lib\rmi-whitelist.jar


Within the .jar is the following path:

Code: Select all
\com\servoy\rmi\whitelist\WhitelistingRMIClassLoaderSpi.class


My understanding is this:

To modify the .class file, I would have to extract and decompile the file, add the "net.sf.jasperreports." path, recompile the code back into a class file, then add it back to the .jar file. Is there an alternate way to add the pathname (like a simple text edit), and, if so, would someone be willing to provide an example? My Java knowledge is rather limited.

Thanks!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: Class not whitelisted for RMI

Postby sbutler » Fri Feb 03, 2017 10:38 pm

No need to decompile. Sorry I confused you. I was just explaining how Jars work, with the classes and folder structure in them.

In Johan's forum post here: viewtopic.php?f=16&t=21087 he describes how to use the rmi-whitelist.jar to add additional classes to the whitelist.

In the JAVA_OPTS, there is a property set, "rmi.whitelist.config". You need to set it to a colon separated list of packages you want to white list. for example,
Code: Select all
rmi.whitelist.config=com.servoy.:com.sebster.:net.sf.jasperreports.

(notice I added net.sf.jasperreports.)

How you set that depends on how you launch servoy. See Johan's post. It would be in the servoy startup script .sh/.bat or in the service wrapper.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Class not whitelisted for RMI

Postby kwpsd » Sat Feb 04, 2017 9:59 pm

Thanks again, Scott!

I saw Johan's post but was confused by it...I still do not know what JAVA_OPTS is. I presume it is a generic term for Java options, wherever they may exist, since I could not find anything by that name. However, I did find what I needed to modify and want to post the information here for others who may come across this situation.

If you are running Servoy server as a Windows service and need to add a package reference to the RMI white list, you need to modify the service wrapper configuration file (wrapper.conf). This file is located in the following path:

C:\Servoy\application_server\service\wrapper.conf

Open wrapper.conf in a text editor and locate the section called Java Additional Parameters.

Code: Select all
# Java Additional Parameters
wrapper.java.additional.1=-Djava.awt.headless=true
wrapper.java.additional.2=-Duser.dir="C:\Servoy\application_server"
wrapper.java.additional.3=-Djava.io.tmpdir="C:\Servoy\application_server\server\work"
wrapper.java.additional.4=-XX:MaxPermSize=128m
wrapper.java.additional.5=-Drmi.whitelist.config=com.servoy.:com.sebster.:net.sf.jasperreports.

Within this section, locate the line starting with 'wrapper.java.additional.x=-Drmi.whitelist.config='. Append each package reference to this line separating them by a colon (:) character. Do not forget to end the package pathname with a period (.). Below is an example:

adding_packages_to_rmi_whitelist.png
adding_packages_to_rmi_whitelist.png (11.58 KiB) Viewed 11624 times


I hope this helps!

@Servoy: I am surprisred the 'net.sf.jasperreports.' pathname was not included in the RMI whitelist by default.
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Thanks

Postby Bernd.N » Thu Feb 23, 2017 1:54 pm

Thanks a lot for this, I had exactly the same problem when installing new Servoy AppServers today with the latest Java Update.
Now it works like a charm again.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: Class not whitelisted for RMI

Postby lwjwillemsen » Thu Feb 23, 2017 2:43 pm

@Servoy: I am surprisred the 'net.sf.jasperreports.' pathname was not included in the RMI whitelist by default.
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Class not whitelisted for RMI

Postby Bernd.N » Thu Feb 23, 2017 3:05 pm

That would be a good idea, Lambert.
Would you like to write a ticket to let this improve for the next version?
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: Class not whitelisted for RMI

Postby lwjwillemsen » Thu Feb 23, 2017 3:54 pm

Hi Bernd,

Sorry, I am kind of busy right now, maybe would you?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Class not whitelisted for RMI

Postby Bernd.N » Thu Feb 23, 2017 4:12 pm

Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 8 guests