Hi...
I'm having some difficults trying to resize an image.
I get the image using the WOFileUpload.
So I create the following function to resize the image (i found this function in some tutorial..)
On my development machine when this function is called (when I call JAI.create) on the dock it opens a generic icon .. well.. it's my application.
dic 31 18:19:30 iPN[2001] (ERXNSLogLog4jBridge.java:43) WARN NSLog - <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
com.webobjects.foundation.NSForwardException [java.lang.InternalError] Can't connect to window server - not enough permissions.:java.lang.InternalError: Can't connect to window server - not enough permissions.
dic 31 18:19:30 iPN[2001] (ERXNSLogLog4jBridge.java:43) WARN NSLog - java.lang.Error "java.lang.InternalError" occured.
dic 31 18:19:30 iPN[2001] (ERXApplication.java:1505) ERROR er.extensions.appserver.ERXApplication - java.lang.Error "java.lang.InternalError" occured.
java.lang.InternalError: Can't connect to window server - not enough permissions.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)
at java.awt.Toolkit.<clinit>(Toolkit.java:1530)
at java.awt.Dimension.<clinit>(Dimension.java:68)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at javax.media.jai.JAI.class$(JAI.java:190)
at javax.media.jai.JAI.<clinit>(JAI.java:318)
at com.ipn.utils.ImageUtils.resizeImageWithSize(ImageUtils.java:35)
at com.ipn.utils.ImageUtils.resizeToImage(ImageUtils.java:28)
at com.ipn.model.Prodotto.setImages(Prodotto.java:21)
at com.ipn.components.ShowProductDetails.savePendingChanges(ShowProductDetails.java:103)
at com.ipn.components.ShowProductDetails.applyChanges(ShowProductDetails.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324)
at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
at com.webobjects.appserver._private.WOSubmitButton.invokeAction(WOSubmitButton.java:70)
at er.extensions.foundation.ERXPatcher$DynamicElementsPatches$SubmitButton.invokeAction(ERXPatcher.java:212)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components._private.ERXWOForm.invokeAction(ERXWOForm.java:180)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at er.extensions.components.conditionals.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:111)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:102)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357)
at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745)
at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:49)
at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1539)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:206)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:298)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332)
at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:369)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:442)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1654)
at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1619)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:613)
dic 31 18:19:30 iPN[2001] (ERXApplication.java:1368) ERROR er.extensions.appserver.ERXApplication - Exception caught: java.lang.InternalError: Can't connect to window server - not enough permissions.
Extra info: {
"Session" = "<com.ipn.app.Session sessionID=WZm3PDeJAJskZ2hqND6QKg timeOut(sec)=3600.0 terminating=false _wasTimedOut=false contextArray=((\"0\"), (\"2\"), (\"3\"), (\"4\")) contextPageInfos={0 = <com.webobjects.appserver._private.WOTransactionRecord responsePage=<com.ipn.components.AdminMain name: com.ipn.components.AdminMain subcomponents: null > requestSignature=null.null>; 2 = <com.webobjects.appserver._private.WOTransactionRecord responsePage=<com.ipn.components.ManageDB name: com.ipn.components.ManageDB subcomponents: null > requestSignature=0.0.5.5.3>; 3 = <com.webobjects.appserver._private.WOTransactionRecord responsePage=<com.ipn.components.EditProduct name: com.ipn.components.EditProduct subcomponents: null > requestSignature=2.0.7.15>; 4 = <com.webobjects.appserver._private.WOTransactionRecord responsePage=<com.ipn.components.ShowProductDetails name: com.ipn.components.ShowProductDetails subcomponents: null > requestSignature=3.0.7.5>; } languages=(\"Italian_IT\", \"Italian\", \"Nonlocalized\", \"English\") componentState={} currentContextID=5 distributionEnabled=false cookieRendezVousEnabled=false URLRendezVousEnabled=tru localizer=<er.extensions.localization.ERXLocalizer English> messageEncoding=<er.extensions.appserver.ERXMessageEncoding encoding: ISO8859_1> browser=<er.extensions.appserver.ERXBasicBrowser browserName: Safari, version: 525.27.1, mozillaVersion: 5.0, platform: MacOS>>";
"CurrentComponent" = "com.ipn.components.ShowProductDetails";
"PreviousPageList" = (
"com.ipn.components.ManageDB",
"com.ipn.components.EditProduct",
"com.ipn.components.ShowProductDetails"
);
"Headers" = {
"remote_host" = "127.0.0.1";
"user-agent" = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; it-it) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1";
"document_root" = "/Library/WebServer/Documents";
"server_name" = "pnimac-g5.local";
"accept" = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
"remote_addr" = "127.0.0.1";
"content-type" = "multipart/form-data; boundary=----WebKitFormBoundaryv9KG03lPAF7kfrPX";
"server_admin" = "[no address given]";
"original_context_id" = "4";
"remote_port" = "49926";
"connection" = "close";
"server_software" = "Apache/1.3.33";
"host" = "localhost";
"x-webobjects-request-id" = "495b8379000000fb0000000d";
"x-webobjects-request-method" = "POST";
"accept-encoding" = "gzip, deflate";
"accept-language" = "it-it";
"x-webobjects-adaptor-version" = "Apache";
"content-length" = "170291";
"script_filename" = "/cgi-bin/WebObjects/iPN.woa/1/wo/WZm3PDeJAJskZ2hqND6QKg/4.0.7.3.1";
"server_port" = "80";
};
"CurrentPage" = "com.ipn.components.ShowProductDetails";
"Bundles" = {
"JavaXML" = "5.4.2";
"ERExtensions" = "5.0.0.8691";
"JavaWebObjects" = "5.4.2";
"ERJars" = "5.0.0.8691";
"PostgresqlPlugIn" = "5.0.0.8691";
"JavaJDBCAdaptor" = "5.4.2";
"WOOgnl" = "5.0.0.8691";
"JavaEOAccess" = "5.4.2";
"JavaEOControl" = "5.4.2";
"JavaFoundation" = "5.4.2";
"iPN" = "";
"JavaWOExtensions" = "5.0.0.8691";
"ERPrototypes" = "5.0.0.8691";
};
"URL" = "/cgi-bin/WebObjects/iPN.woa/1/wo/WZm3PDeJAJskZ2hqND6QKg/4.0.7.3.1";
}
com.webobjects.foundation.NSForwardException [java.lang.InternalError] Can't connect to window server - not enough permissions.:java.lang.InternalError: Can't connect to window server - not enough permissions.
at com.webobjects.foundation.NSForwardException._runtimeExceptionForThrowable(NSForwardException.java:39)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1140)
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324)
at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
at com.webobjects.appserver._private.WOSubmitButton.invokeAction(WOSubmitButton.java:70)
at er.extensions.foundation.ERXPatcher$DynamicElementsPatches$SubmitButton.invokeAction(ERXPatcher.java:212)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components._private.ERXWOForm.invokeAction(ERXWOForm.java:180)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at er.extensions.components.conditionals.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:111)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:102)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357)
at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745)
at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:49)
at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1539)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:206)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:298)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332)
at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:369)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:442)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1654)
at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1619)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.InternalError: Can't connect to window server - not enough permissions.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)
at java.awt.Toolkit.<clinit>(Toolkit.java:1530)
at java.awt.Dimension.<clinit>(Dimension.java:68)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at javax.media.jai.JAI.class$(JAI.java:190)
at javax.media.jai.JAI.<clinit>(JAI.java:318)
at com.ipn.utils.ImageUtils.resizeImageWithSize(ImageUtils.java:35)
at com.ipn.utils.ImageUtils.resizeToImage(ImageUtils.java:28)
at com.ipn.model.Prodotto.setImages(Prodotto.java:21)
at com.ipn.components.ShowProductDetails.savePendingChanges(ShowProductDetails.java:103)
at com.ipn.components.ShowProductDetails.applyChanges(ShowProductDetails.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
... 42 more
So.. I think I've to "eliminate" the appearing of the icon on my development machine...
But... I can't find any way to do so...
Thanks for any help.