"Unexpected error" when download JavaME application - java-me

When I go on my phone, and type the url to my custom JavaME application, it says "Download". Then I click "Yes". It downloads about 2/3 and then it says Unexpected Error and then quits. How do I fix this?

It could probably be many things, but in the past when I've experienced that particular scenario, it has usually been because of unsupported JAD/MANIFEST attributes.
For example, Nokia has invented a lot of their own attributes you can add for some of their devices. So you'd think that any Nokia-specific JAD/MANIFEST attribute will work on any Nokia phone, or at least be ignored if it's not supported - but that's not the case.
If you try installing a JAR with a MANIFEST that has certain attributes not supported, then it will come up with an install error.
If I were use I'd try removing all special attributes - even if the attribute logically should work - and see if that helps.

Related

How to replicate a content-security-policy issue

We recently made a number of changes to our CSP and have gotten reports from a very small number of users that the browser is not rendering because of one of these changes. We have 5 reports out of 2mil active users, so this is something very specific.
None of our QA are able to replicate this with their test browsers, so we're unable to determine what about the new CSP is causing the problem.
Is there a way to put a browser into some super strict mode so that it will stop all dynamic content with the slightest issue?
Rundown of my analysis:
I know the latest version also introduced some [tab] unicode, but I want to replicate this issue before I remove it so that I know that we've fixed it.
We do not have any of the deprecated X- headers in there.
Tried loading it into some online CSP validators but those come back with some vulnerabilities, but says the CSP is valid as written.
We're considering the report-to directive but have not implemented yet (Does anyone know if this would even help us in this?)
We were able to screenshare with one of the users with this issue and saw their browser console showing that it was stopping because of the CSP, but it had issues with the CSP that were very old. That user was running a current Chrome install
I'd post the csp but the invalid unicode wouldn't post anyway. It would also identify some of our clients.

Google Actions Simulator MalformedResponse Media response is not supported on this device

I have been testing my app on the google actions simulator, mainly using the 'Smart Display' surface.
Until this morning it was working fine but then suddenly I started getting this error:
MalformedResponse expected_inputs[0].input_prompt.rich_initial_prompt.items[1].media_response: Media response is not supported on this device..
I only get this error with the 'Smart Display' and 'Speaker' surfaces but not the 'Phone' surface.
When I look in the 'REQUEST' tab when using 'Phone' surface I see "name": actions.capability.MEDIA_RESPONSE_AUDIO in the JSON under "capabilities", but it's not there when I use 'Smart Display' or 'Speaker'.
Has anyone encountered this problem before ?
I did not change any code that would affect this and besides it does not seem to be related to my code at all..
I would be grateful for any advice on the matter.
-ben
I can confirm this is happening, and this appears to be a bug with the simulator.
It is still working correctly with real devices.
I've reported this to Google and been told it has been filed as a bug in their internal tracker, but there is no word about time to fix.
Update
This should now be fixed.

Java Bean not getting loaded

I have a xpage which uses a java bean to generate some content on the page. The page gives error "Error 500 HTTP Web Server: Command Not Handled Exception". But error just disappears once I open the database using designer. I do not do any modifications to the database, but just open the database using designer client. I have to open the database every day to fix this problem. Can anybody tell me why this is happening and how can I fix it?
"Error 500" is a pretty catch-all error description, and I believe it shows up if you don't tell the app to display the XPages runtime error page (the default with the stack trace) or provide your own. If you do one of those (or look at the server console and error-log-0.xml in the data/domino/workspace/logs folder), you may be able to get a more-specific description of the problem.
But one plausible "crops up every day" type of problem I've run into is the "X is incompatible with X" ClassCastException problem - at some point in the growth of most XPages apps, this starts to crop up (I don't know why other than "using Java") and gets to the point where even changing non-XPage design and potentially data docs triggers it. Fortunately, the fix is easy: assuming you're running 8.5.3 or above, go into the xsp.properties and check the option to "Refresh entire application on design change" (or thereabouts). That should fix it if this is indeed your problem.
Looks like it was my designer client. I was using 8.5.3 without any fix packs. I installed FP6 and signed the design again and the problem is fixed.

Why does google.com look different on blackberry & phonegap vs. blackberry & browser

I'm tyring to get phonegap up and running on blackberry storm (9530 simulator). I had been testing my webapp from withing BB's built in browser, and it was looking ok, but then it totally bit once I tried to look at the some code from within phonegap, even though I was pointing phonegap to the same url (I hadn't yet gotten to the point of running code locally on the device).
I tried a test case on google and got similiar results. see below. I suspect that I'm missing something basic here. I would have expect both images to be nearly identical.
Browser
http://www.eleganttechnologies.com/outside/ImgDeviceBB9530WebGoogle.jpg
Phonegap
http://www.eleganttechnologies.com/outside/ImgDeviceBB9530PgGoogle.jpg
[Update]
To shed some light on what is happening, I ran the browser and the embedded browser (phonegap) against the W3 mobile web acid test: http://www.w3.org/2008/06/mobile-test/
I definitely notice differences between the two, but I don't yet know the 'why' and the 'how-to-address'.
Acid via built-in browser
(source: eleganttechnologies.com)
BTW - I ran this earlier today and got a couple more green square than just now.
Acid via browser embedded into phonegap
http://www.eleganttechnologies.com/outside/ImgDeviceBb9530PgAcid.jpg
Disclaimer: I don't know anything about phonegap, but have a pretty good theory. By default the embedded browser control on BlackBerry uses an older version of the rendering engine than the BlackBerry browser itself does.
At the BlackBerry developer conference last year, a talk was given about this, and there's an undocumented option to use the newer rendering engine. \
The option ID is 17000 (yes, a magic number, which could change, use at your own risk etc), and should be set to true. Not sure how you'd pass this option through phonegap (I'm not familiar with the toolkit) but using the BlackBerry APIs it's something like:
BrowserContent content;
...
content.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, 17000, true);
I don't know the specifics of the browsers you are using, but I do know that most of the big sites will detect your OS + browser combination to decide what HTML to show you.
If Google is seeing a different user agent, you might get a generic mobile version of the HTML instead os the Blackberry specific HTML you get for the built in browser.
If you have access to a web server, try hitting it with both browser setups and see if there is any difference in the log file. That might tell you something interesting.
As we can see in your Acid tests...
One browser (the built-in one) is reporting correctly as a BlackBerry9530, and the other (phonegap) is not presenting the user-agent ["Testing with ."].
In this case, Google is providing you with the default view of their homepage, whereas when you are reporting yourself as a BlackBerry device, you will get the BlackBerry specific rendering.
By the sounds of things, using phonegap is removing the default user-agent (most probably because it's not recognising your device). As phonegap is open-source, the best bet is to get in there, and debug it and find out what happens with the user-agent when the http requests leave the device and track it back from there.
Maybe one browser has capabilities that another one does not?
Hm. By looking at the screenshot I would say that the second page is probably missing some resources. It may be missing some images, scripts and the CSS files, which would explain different l&f. Knowing how Blackberry Browser Field API works, I would guess that the implementation that uses the BrowserField was not done correctly. Just my guess. In addition to that, when the browser field is initialized the caller needs to configure it properly by enabling the appropriate browser features - scripts, styles etc. Again, the API is done in a very weird way, I have gotten myself into this trap once. When setting the options, you cannot just create one mask (like CSS | WML | SCRIPT) and make one call. Options are numeric and, I believe, non-overlapping - but you still need to call the API for setting each option independently.
Also the way asynchronous loading of the resources for BrowserField takes time to understand.
Just my $0.02.

What quirks are in the Blackberry Web Browser that a developer should be aware of?

Before I start pulling my hair out on any "known issues", is there any quirks or problems that I should be aware of.
Specifically with cookies, JavaScript, HTML, CSS and images.
PS I have a copy of the docs provided by RIM, but I'm hoping others know of some lesser known issues.
Here are a few that I've noticed:
For some reason, the BB browser doesn't seem to handle underscores in the hostname correctly. I don't remember what happened, but if you hostname is like this: http://some_host/blah, I remember it having problems.
This can be corrected with a DNS entry that removes the _
Another thing we've seen is serving up .jad files for Java downloads. If your module contains _ or other special characters, the BB browser displays a HTTP 500 error when trying to fetch the .jar or parse the .jad. This is especially annoying because it's not actually an HTTP error, the server is serving up a file, but the BB browser just can't parse it, so it blames the server.
We fixed this by using Fiddler to hit the .jad URL and view the contents of the HTTP response. If your .jad has any special characters (or sometimes URL/HTTP encoded strings) you might need to simplify your module name to only use A-Za-z0-9
I know those aren't exactly html/css things, but thought I'd post this anyway!
I had used the blackberry browsers on emulator versions to test my web pages.
These are some i would like to point out.
Please forgive me in case of any deviation with a real case because these are specific to emulator versions on windows 7 OS. I dint have the devices to check and verify.
When we are coming down to a BB OS version below 5.X (eg. BB 9630), the browsers support for java script will be turned off by default. So you need to go browser options turn on it manually.
When we go further down to BB OS version 4.2, the style sheet support will be turned off by default. Causing your webpages to render without applying style sheet. So that time you need both the java script and style sheet supports to be turned on manually.
Even when i was on a OS version 7.X or 6.X, the internet connection was working and i could connect to pages. When i went down to version 5, those emulator browsers shown issues for connection. On googling i found that MDS is a requirement when we go down the versions and seek internet access.
I installed MDS, still it was not working for versions below 6, reason being the JAVA_HOME environment variable was not set in my advanced system settings in my-computer properties. But it was not even pointing out the issue and the MDS was closing instantly.
So after setting my JAVA_HOME to "C:\Program Files (x86)\Java\jre1.6.0_07" the place i installed JDK(we need JDK for MDS), internet connection started working.
Also if you are using g zip compression for your pages, below Blackberry OS version 6, the browsers no longer requests for a compressed one. (found it on OS version 5 emulators BB 9700,BB 8520).
Also when you are going to use a css property or html entity that you doubt support, be sure to go to the corresponding OS version content developer guide and find from which version are they providing the full support and partial support.
Check out the BlackBerry Browser Version 4.2 Content Developer Guide. It is for the older 4.2 browser but still has lots of good info about what HTML, CSS, and javascript is supported.
My experience with BB 8700 is that you should not use JavaScript, neither depend on CSS to be rendered correctly. It also has no flash player by default so you're off to plain server-side HTML form processing/ASP/CGI. Also beware of size, as internet can get pretty slow while on the road.
One known issue is that the Blackberry browser completely ignores the css display property, so you can't use display:none to hide content.
We've also had trouble with basic form submittal - sometimes, the POST doesn't happen at all, other times it happens but some or all of the form fields go AWOL. We haven't been able to get to the bottom of this issue, but it seems to occur mostly with the BB Curve series.

Resources