[appengine-java] Re: SecurityException thrown by java.lang.reflect.AccessibleObject.setAccessible(boolean flag)
Emanuele, The behavior you are seeing is actually not a bug in App Engine but rather an unexpected behavior in Java itself. If you try the experiment in Java code running outside of App Engine you will see the same behavior. The source code for java.lang.reflect.AccessibleObject explains the situation: // Indicates whether language-level access checks are overridden// by this object. Initializes to false. This field is used by// Field, Method, and Constructor.boolean override; public boolean isAccessible() { return override; } The name isAccessible is misleading. The method actually returns whether accessibility has been overridden to true. -Mitch -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/A7oWAKAhjxIJ. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: SecurityException thrown by java.lang.reflect.AccessibleObject.setAccessible(boolean flag)
Emanuele, Yes if you could provide me with sample code the produces the problem you are describing that would be very helpful. thanks, Mitch -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/jiT1rwYsniEJ. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Sending Authorization header in a SOAP call
On Jan 19, 3:11 pm, Skip skip.tavakkol...@gmail.com wrote: Hi, I've followed this (http://code.google.com/appengine/articles/soap.html) and created a SOAP client for a webservice (ASP.NET). The client is used by a G/A/E Backend. I've verified that backed+client works correctly against a development server that (1) uses HTTP and (2) requires no authorization. It fails authorization when connecting to a production server that requires Basic auth over an HTTPS connection. Here's the code: URL url = new URL(https://.../FOOService.asmx?WSDL;); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestProperty(Authorization, Basic +CREDENTIALS); // CREDENTIALS is base64 of User:Pass FOOService fs = new FOOService(url, new QName(http://.../;, FOOService)); FOOServiceSoap ws = fs.getFOOServiceSoap(); // etc... I've set logging to FINEST, but can't see the request headers being sent. Also the WWW-Authenticate response coming back indicates Authorization header is not being sent. The 401 response may also indicate that the password was incorrect. If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. Why don't you try sending an HTTPS request directly, without using SOAP, just to see if you still get a 401 response. For how to do that see http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html It finally fails like this: Jan 19, 2012 10:57:28 PM com.google.appengine.repackaged.org.apache.http.impl.client.DefaultRequestD irector updateAuthState FINE: Credentials not found What's the trick? (I'm somewhat new to AppEngine and have a lot of contempt for SOAP) Thanks, -Skip -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: why the development of java tools fall far behind that of python's?
Tapir, thanks for your feedback. I agree that there have been several cases where features have come out in Python long before Java. (There have been a few in the other direction too, but not as many.) This is something we are trying to improve upon in the future. I'm happy to tell you that one of the items in your list, 1. remove obsolete indexes, is supported in Java and has been since release 1.4.2 earlier this year. This feature is called vacuum indexes. - Mitch On May 25, 9:00 am, Tapir tapir@gmail.com wrote: such as: 1. remove obsolete indexes 2. copy Mater-Slave data to High Replication I think if these tools are already done in python, it would be easy to port them in java within one week, especially for your googlers. But why have you done these yet? You know, these tools are so essential. Many java developers feel hopeless now. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
Hi Brandon, Sorry I wasn't clear in my previous response. The API is working as designed. In your code sample you call writeChannel.write(bb) and then getBlobKey(file) without calling writeChannel.closeFinally(). Until you call closeFinally() the file has not been *finalized*. This means the file is write-only. You cannot read the file and the file *has no BlobKey*. That is why getBlobKey() returns null. You must first call closeFinally() before calling getBlobKey(). - Mitch On Apr 26, 7:10 pm, branflake2267 branflake2...@gmail.com wrote: I kinda figured, since it shows experimental. I've got a work around, for sucking out of the object. I like using it, very nice work so far! Thanks for looking. Brandon -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
Hi Brandon, Sorry, I wasn't clear before. What I meant was that the API is working as designed. In your code sample you call writeChannel.write(bb) but you never called writeChannel.closeFinally(). This means that the file is not *finalized*. Until the file is finalized it is write-only, it cannot be read, and there is *no* BlobKey associated to the file. That is why getBlobKey() returns null. It is only after the file is finalized that the file becomes readable and a BlobKey is generated for it. - Mitch On Apr 26, 7:10 pm, branflake2267 branflake2...@gmail.com wrote: I kinda figured, since it shows experimental. I've got a work around, for sucking out of the object. I like using it, very nice work so far! Thanks for looking. Brandon -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
On Apr 26, 7:42 am, branflake2267 branflake2...@gmail.com wrote: My code snippet that procured the above trace: public long uploadBlob_ByFile(long fileThingId, String fileName, String contentType, byte[] filebytes) { if (filebytes == null || filebytes.length == 0) { log.warning(uploadBlob_ByFile(): Warn: filebytes is null or length=0); return -1; } log.info(uploadBlob_ByFile(): filebytes.length= + filebytes.length); // Get a file service FileService fileService = FileServiceFactory.getFileService(); // Create a new Blob file with mime-type AppEngineFile file = null; try { file = fileService.createNewBlobFile(contentType, fileName); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 1: could not fileService.createNewBlobFile: + e.toString()); e.printStackTrace(); return 0; } if (file == null) { log.severe(uploadBlob_ByFile(): Error: file is null. exiting file upload.); return 0; } // Open a channel to write to it boolean lock = true; FileWriteChannel writeChannel = null; try { writeChannel = fileService.openWriteChannel(file, lock); } catch (FileNotFoundException e) { e.printStackTrace(); log.severe(uploadBlob_ByFile(): Error 2: + e.toString()); return 0; } catch (FinalizationException e) { e.printStackTrace(); } catch (LockException e) { log.severe(uploadBlob_ByFile(): Error 3: + e.toString()); e.printStackTrace(); return 0; } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 4: + e.toString()); e.printStackTrace(); return 0; } ByteBuffer bb = ByteBuffer.wrap(filebytes); // This time we write to the channel using standard Java try { writeChannel.write(bb); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 5: + e.toString()); e.printStackTrace(); return 0; } BlobKey blobKey = FileServiceFactory.getFileService().getBlobKey(file); At this point the file has not been finalized so null will be returned. See http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/files/FileService.html#getBlobKey(com.google.appengine.api.files.AppEngineFile) if (blobKey == null) { log.severe(uploadBlob_ByFile(): Error 5.1, Testing if blobKey is null before closing channel: ); } else { log.info(uploadBlob_ByFile(): INFO 5.1, blobkey WORKED ! ); } try { writeChannel.close(); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 5.5: + e.toString()); e.printStackTrace(); } // Now finalize try { writeChannel.closeFinally(); } catch (IllegalStateException e) { log.severe(uploadBlob_ByFile(): Error 6: + e.toString()); e.printStackTrace(); return 0; } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 7: + e.toString()); e.printStackTrace(); return 0; } blobKey = FileServiceFactory.getFileService().getBlobKey(file); FileSystem fileSytem = file.getFileSystem(); String path = file.getFullPath(); String namePart = file.getNamePart(); String fs = null; if (fileSytem != null) { fs = fileSytem.toString(); } log.info(uploadBlob_ByFile(): Info: fileSystem: + fs + path= + path + namePart= + namePart + file.toString()= + file.toString()); if (blobKey == null) { log.severe(uploadBlob_ByFile(): Error 8: blobkey is null); return 0; } //... } Brandon Donnelsonhttp://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: 1.4.3 Javadocs? Looking for the FileServiceFactory docs:
I apologize, we neglected to include the JavaDoc for the new File API in the 1.4.3 release. It will be in 1.4.4 but I will look into posting it somewhere temporarily. In the mean time, here is the JavaDoc for the method you asked about: /** * Creates a new empty file in the BlobStore of the specified mime- type and * returns an {@code AppEngineFile} representing the file. The returned * instance will have a {@link AppEngineFile#getFileSystem() file system} of * {@link com.google.appengine.api.files.AppEngineFile.FileSystem#BLOBSTORE * BLOBSTORE}. * * @param mimeType the mime-type of the file to be created. This parameter may *be used to inform the BlobStore of the mime-type for the file. The *mime-type will be returned by the BlobStore in an HTTP response if *the file is requested directly from the BlobStore using the *blob-key. * @param blobInfoUploadedFileName BlobStore will store this name in the *BlobInfo's fileName field. This string will emnot/em be *the {@link AppEngineFile#getNamePart() name} of the returned *{@code AppEngineFile}. It will be returned by the BlobStore in an HTTP *response if the file is requested directly from the BlobStore using *the blob-key. * @return A {@code AppEngineFile} representing the newly created file. * @throws IOException If there is any problem communicating with the backend * system */ AppEngineFile createNewBlobFile(String mimeType, String blobInfoUploadedFileName) throws IOException; On Apr 2, 8:54 am, branflake2267 branflake2...@gmail.com wrote: I'm looking for the new javadocs for FileServiceFactory and didn't see them yet. I wanted to find out what the method parameters were for fileService.createNewBlobFile(param,param)? Is there a parameter for filename? AppEngineFile file = null; try { file = fileService.createNewBlobFile(contentType); } catch (IOException e) { e.printStackTrace(); } Brandon Donnelsonhttp://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.