I think you might have to add them to the Felix framework system or bootdelegation packes in order to be accessible (in sling.properties), see the comments for property org.osgi.framework.bootdelegation.

The JRE classes are added to the org.osgi.framework.system.packages property depending on JRE version, and the included classes are only those specified in the jre-<version>.properties files, which don't include any com.sun.* or sun.* package by default

Regards,
Rory

Joshua Oransky wrote:
I'm trying to resize an image using basic Java2D, but I keep getting this error:

Can't find method sun.java2d.SunGraphics2D.drawImage(org.apache.jackrabbit.core.NodeImpl,number,number,number,number,null).

This doesn't make any sense, as these classes are part of the basic JavaSE install... My code is simple:

<% load("/apps/whipopen/global/functions.esp");

    var imageIO  = Packages.javax.imageio;
    var awt         = Packages.java.awt.image;
var image; if(jcrSession.itemExists(imagePath))
        image = jcrSession.getItem(imagePath);
var bImage = imageIO.ImageIO.read(image.getProperty("jcr:data").getStream()); var rImage = resize(image, 100, 200); imageIO.ImageIO.write(rImage, "png", out); function resize(image, width, height) { var resizedImage = new awt.BufferedImage(width, height, awt.BufferedImage.TYPE_INT_ARGB);
    var g = resizedImage.getGraphics();
    g.drawImage(image, 0, 0, width, height, null);
    g.dispose();
    return resizedImage;
}
%>

--




Rory Douglas | Senior Principal Consultant
Fax: +1-201-604-6428 | Mobile: +1-917-498-5344
Oracle North America Consulting
ORACLE United States | | San Diego, CA
"Please consider your environmental responsibility before printing this e-mail"

Reply via email to