[appengine-java] Re: problem in servlet page on app engine

2012-02-18 Thread Dick Larsson
Go to https://appengine.google.com/ and check the logs for your
application.
You will find more information there

On 16 Feb, 21:25, Hanaa ALTHeiabat  wrote:
> after i deploy my servlet on my app engine account this page appear Instead
> of my page
>
> Error: Server Error  The server encountered an error and could not
> complete your request. If the problem persists, please report your problem
> and mention t
> on other hand , any html or jsp page it work not like servlet file
> BUT when i work on localhost it work but i don't know why this  happened
> 

-- 
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: Java app-engine bug is bad news for upcoming http://opencfsummit.org/

2012-01-15 Thread Dick Larsson
The code in the link works just fine for me, both running SDK 1.6.1
and 1.5.3
http://groups.google.com/group/google-appengine/browse_thread/thread/11749e1254bcd165/46cd9826877b46c9

Could you tell us a bit more about your design, are you using Servlet
Filters?

Best regards
Dick Larsson
www.amantech.se

On 15 Jan, 02:59, Alex Skinner  wrote:
> I'm not sure, maybe its a lucky escape it shows how easy the rug is to
> be pulled from underneath you.
>
> I'll be there see you next month
>
> A
>
> On Jan 14, 11:17 am, Jason Blum  wrote:
>
>
>
>
>
>
>
> > Definitely very disappointing.  And totally agree GAE would have a lot
> > to offer, if they could just fix that bug.
>
> > The good news is a lot of other folks are stepping in to fill that
> > easy one-click cloud deployment space!
>
> > Join us next month athttp://OpenCFSummit.orgtolearn more!
>
> > On Jan 13, 5:19 pm, Alex Skinner  wrote:
>
> > > Hi Guys,
>
> > > At last years OpenCFSummit the Java Google App engine got quite a lot of
> > > press, people were assisted in setting it up and deploying their apps and
> > > there was a lot of excitement.
>
> > > The combination of the Open Bluedragon desktop edition and GAE is 
> > > certainly
> > > one of the easiest ways of deploying a ColdFusion or Web application.
>
> > > Since 1.5 the OpenBluedragon GAE compatibility has been effectively
> > > derailed until this bug is
> > > fixedhttp://code.google.com/p/googleappengine/issues/detail?id=5898.
>
> > > It would be nice if the project could announce at the conference that this
> > > compatibility has been restored.
>
> > > Alex

-- 
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: problem with session

2011-12-29 Thread Dick Larsson
It's easier for us to help you if you provide us with more details
about your problem.
Do you have a mutable object stored as attribute in your HttpSession?
In that case be sure to call setAttribute again if you change the
object.
As long as you have only one server your code will work but in a
clustered environment the HttpSession state replication between
servers do not know that you have changed your object.
So every time you change your object you have stored as attributes in
your HttpSession, you have to "inform" the HttpSession about it by
calling setAttribute.

Hope it helps
Dick Larsson
http://www.amantech.se



On 25 Dec, 00:38, amos bukobza  wrote:
> hii everyone
> today i upload my first app
> (chess game)
> and i have some issue
> i save a session object and its works fine
> but he didnt recognize things
> its feels like the method not worl properly
> but they are in local server
>
> u have any idea?

-- 
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: No bytes available in doPost

2011-10-27 Thread Dick Larsson
In method uploadAvatarImage you call for the inputStream before you
have sent your bytes to the server.
Please try this instead
os.flush();
os.close();
InputStream is = servletConnection.getInputStream();

Next thing, in your servlet.
You should use InputStream instead of Reader since you are dealing
with bytes

InputStream reader = request.getInputStream();
byte[] imageBytes =
org.apache.commons.io.IOUtils.toByteArray(reader);

Hope it helps
Best regards
/Dick Larsson

On 24 Okt, 16:17, Rune Nielsen  wrote:
> Hi,
>
> I'm trying to upload an image to store in the Blobstore, but I'm having
> trouble streaming it to my servlet as a byte array.
>
> Here's the code for the client method streaming the byte array to the
> servlet - it's using the Commons IO:
>
> public void uploadAvatarImage(byte[] imageBytes) {
>         try {
>             URL myURL = new
> URL("http://myapp.appspot.com/SetAvatar?globalId=1";);
>             URLConnection servletConnection = myURL.openConnection();
>
>             servletConnection.setRequestProperty("Content-Type",
> "application/octet-stream");
>
>             servletConnection.setDoOutput(true);
>             servletConnection.setDoInput(true);
>
>             OutputStream os = servletConnection.getOutputStream();
>             InputStream is = servletConnection.getInputStream();
>
>             IOUtils.write(imageBytes, os);
>
>             os.flush();
>             os.close();
>
>             BufferedReader in = new BufferedReader(new
> InputStreamReader(is));
>             String inputLine;
>
>             while ((inputLine = in.readLine()) != null) {
>                 System.out.println(inputLine);
>             }
>
>             in.close();
>         }
>         catch (Exception e) {
>             System.out.println(e);
>         }
>     }
>
> Here's the code for the doPost method of my servlet:
>
>     @Override
>     public void doPost(HttpServletRequest request, HttpServletResponse
> response) throws IOException, ServletException {
>         BufferedReader reader = request.getReader();
>         byte[] imageBytes = IOUtils.toByteArray(reader);
>
>         PrintWriter outputWriter = response.getWriter();
>
>         int len = ;
>         outputWriter.println("Content type is: " + request.getContentType()
> + " - length is: " + request.getContentLength());
>         outputWriter.println("Bytes: " + imageBytes.length);
>
>         outputWriter.close();
>     }
>
> The output from the servlet is:
>
> Content type is: application/octet-stream - length is 0
> Bytes: 0
>
> Everything looks good on the client side and the size of the byte array on
> the client size is about 300kb. But for some reason there's no available
> bytes on the server side. Any ideas why? I've tried just about everything,
> but to no avail.
>
> Thanks in advance for any hints!
>
> Sincerely,
> Rune Nielsen

-- 
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: Problem deploying app after adding true in appengine-web.xml file.

2011-10-27 Thread Dick Larsson
Hm, appengine-java-sdk-1.3.8? I think ThreadSafe was introduced with
App Engine 1.4.3

Can you test with a newer version of the SDK?

Best regards
/Dick Larsson

On 24 Okt, 08:59, Zde Sam  wrote:
> Hi,
>
> I am getting the following error after adding true
> in appengine-web.xml file during deployment.
>
> com.google.apphosting.utils.config.AppEngineConfigException: XML error 
> validating 
> E:\Projects\SpringSource\GoogleApps\WebsiteBuilder\war\WEB-INF\appengine-we­b.xml
>  against 
> E:\Services\Google\AppEngine\appengine-java-sdk-1.3.8\docs\appengine-web.xs­d
>         at 
> com.google.appengine.tools.admin.Application.validateXml(Application.java:3­60)
>         at 
> com.google.appengine.tools.admin.Application.(Application.java:101)
>         at 
> com.google.appengine.tools.admin.Application.readApplication(Application.ja­va:151)
>         at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:115)
>         at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:61)
>         at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:57)
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid 
> content was found starting with element 'threadsafe'. One of 
> '{"http://appengine.google.com/ns/1.0":static-files, 
> "http://appengine.google.com/ns/1.0":resource-files, 
> "http://appengine.google.com/ns/1.0":env-variables, 
> "http://appengine.google.com/ns/1.0":ssl-enabled, 
> "http://appengine.google.com/ns/1.0":user-permissions, 
> "http://appengine.google.com/ns/1.0":public-root, 
> "http://appengine.google.com/ns/1.0":inbound-services, 
> "http://appengine.google.com/ns/1.0":precompilation-enabled, 
> "http://appengine.google.com/ns/1.0":admin-console, 
> "http://appengine.google.com/ns/1.0":static-error-handlers}' is expected.
>         at 
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE­xception(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown 
> Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow­n 
> Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow­n 
> Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorRepor­ter.reportError(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaE­rror(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartEl­ement(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(­Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartE­lement(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Frag­mentContentDriver.next(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown 
> Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unkno­wn
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan­Document(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown 
> Source)
>         at 
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown 
> Source)
>         at 
> com.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.va­lidate(Unknown
>  Source)
>         at 
> com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(U­nknown
>  Source)
>         at javax.xml.validation.Validator.validate(Unknown Source)
>         at 
> com.google.appengine.tools.admin.Application.validateXml(Application.java:3­57)
>         ... 5 more
>
> Deployment goes fine successfully when true is
> removed or commented from the appengine-web.xml file.
> Below is the content of my appengine-web.xml file.
> 
> http://appengine.google.com/ns/1.0";>
> ebildr
> v2
> 
> 
> 
>  value="WEB-INF/logging.properties"/>
> 
> true
> true
> 
>
> Am I missing anything, any help will be greatly appreciated.
> Thanks

-- 
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: Disable 'refresh' in a page

2011-09-26 Thread Dick Larsson
HTTP Status Code 204 is what you should use.
It means that the server has processed the request but user agent's
active document view should remain the same/should not change.

response.setStatus(204);

See w3.org for more info
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html


Best regards
Dick Larsson
http://www.amantech.se

On 25 Sep, 08:00, Shoubhik  wrote:
> I need to DISABLE 'refresh' in a page (all possible ways, Browser
> buttons, right click -> refresh and F5 )
>
> Please provide me some solutions.
>
> Thanks in advance,
> Shoubhik Bose

-- 
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.



Re: [appengine-java] Re: Weird but Why is my code not getting deployed to the app engine?

2011-02-07 Thread Dick Larsson
No logs but you can still access the app?
Browser cache?
;)

On 8 February 2011 00:01, Jaspal Sawhney  wrote:

> The version was the same on the appengine console too.
> I created a new version. Removed the last one and now I'm not getting
> any logs or hits in the dashboard.
>
>
>
> On Feb 7, 5:49 pm, Simon Knott  wrote:
> > You can see how many times you've deployed in the day by going to your
> quota
> > page, in the admin of your app.  Also, if you click on the "Versions"
> link
> > on the left-hand side, you can see when each version was last updated.
>
> --
> 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.
>
>

-- 
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.



Re: [appengine-java] Re: Weird but Why is my code not getting deployed to the app engine?

2011-02-07 Thread Dick Larsson
Have you double-checked your "version"?


On 7 February 2011 23:19, Simon Knott  wrote:

> I believe you can deploy 1000 times a day
>
> --
> 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.
>

-- 
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: Serve image from blob store

2011-02-04 Thread Dick Larsson
I have seen this error message, when there is a call for
response.getWriter earlier on in the code.
Are you sure that you have not asked for the
Writer? ..response.getWriter()..?

blobstoreService.serve(blobKey, resp) will use
response.getOutputStream() and that can be tricky if you have already
asked for the Writer.
I don't think it matters if you have actually used the Writer or not.

Best regards
/Dick Larsson
www.Amantech.se
Stockholm/Sweden



On 20 Dec 2010, 10:04, Ahmed Shoeib 
wrote:
> hi all,
> i want to get image from blobstore using this code
>
> // Serve image from blob store
> BlobKey blobKey = new BlobKey(req.getParameter("apikey"));
> blobstoreService.serve(blobKey, resp);
>
> and facing this problem
>
> HTTP ERROR 500
>
> Problem accessing /api/news/serve. Reason:
>
>     WRITER
>
> Caused by:
>
> java.lang.IllegalStateException: WRITER
>         at org.mortbay.jetty.Response.getOutputStream(Response.java:594)
>         at
> javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:
> 105)
>         at
> com.google.appengine.api.blobstore.dev.ServeBlobFilter.serveBlob(ServeBlobFilter.java:
> 169)
>         at
> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
> 62)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> 43)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
> 122)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> 388)
>         at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> 216)
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> 182)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> 765)
>         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 418)
>         at
> com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
> 70)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>         at com.google.appengine.tools.development.JettyContainerService
> $ApiProxyHandler.handle(JettyContainerService.java:349)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>         at org.mortbay.jetty.Server.handle(Server.java:326)
>         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> 542)
>         at org.mortbay.jetty.HttpConnection
> $RequestHandler.headerComplete(HttpConnection.java:923)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>         at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
> 409)
>         at org.mortbay.thread.QueuedThreadPool
> $PoolThread.run(QueuedThreadPool.java:582)

-- 
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.