- Forums
- >
- API Platform
- >
- Issues (and solutions!) with Java HTML 5 SDK Kitchen Sink
- Thread RSS
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Favorite
- Subscribe
Issues (and solutions! ) with Java HTML 5 SDK Kitchen Sink
- Mark as New
- Favorite
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Flag as Inappropriate
08.15.2012 10:36 AM
I downloaded the HTML5 SDK 2.1 r15 yesterday and ran into a couple of issues getting the Kitchen Sink samples to work. This post outlines the issues and my solutions to those.
Environment:
- build using Eclipse Indigo
- Java server runtime deployed on CloudBees
Issue #1: web.xml error at startup
After building the war file in Eclipse and uploading, I received the following error at startup:
Aug 15, 2012 5:16:55 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml file at jndi:/localhost/WEB-INF/web.xml java.lang.IllegalArgumentException: Invalid <url-pattern> att/notifications in servlet mapping
Fix for Issue #1: Pretty easy. Add a leading slash to att/notifications in the web.xml:
Go from this:
<url-pattern>att/notifications</url-pattern>
To this:
<url-pattern>/att/notifications</url-pattern>
Issue #2: Test.wav file not found for speech test
When I tried to run the speech example, it returned "Results - Success - Null". Looking at the logs, I saw
INFO: AttDirectRouter: {"error":"Test.wav (No such file or directory)","action":"ServiceProvider","method":"s peechToText","tid":1,"type":"rpc"}
There were really two problems here:
- The .war file doesn't include Test.wav sample sound file
- Where should you put Test.wav?
I first tried to put the Test.wav into the root of the .war file, but that didn't work, possibly because of how CloudBees handles the war file or where its default working directory is.
My solution to issue #2
My solution was pretty complex. Hopefully the dev team can find something a little cleaner:
1. Copied the test.wav file into the .conf folder
2. Modified the build.xml so it would copy the test.wav into the classes directory in the .war file. (2nd "include" line below)
<classes dir="conf">
<include name="**.properties"/>
<include name="**.wav"/>
</classes>
3. Modified the code for FileMapper.getFileForReference() and ServiceProviderSpeech.sendSpeech() to use the getResource() method to find the file, rather than new File(). It's about 20 lines of code and perhaps too complicated for this post, but I'm willing to share if anyone wants to see it.
Hope this helps anyone who might have run into these issues.
Thanks,
Jason
Re: Issues (and solutions! ) with Java HTML 5 SDK Kitchen Sink
- Mark as New
- Favorite
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Flag as Inappropriate
09.06.2012 09:36 PM
Hi Jason,
I tried to execute the sdk but i am not succeeded because of some issues.
In properties file(att-api.properties) i changed the scope to TL as i am more concerned on location based services but i received a error stating "Invalid Scope" then i changed the scope to "SMS" now i am able to see the home page with list of options and i selected SMS.
But when i clicked "Send SMS" button i got a 404 error and in my error console i found "Failed to load resource: the server http://localhost:8080/att/direct_router responded with a status of 404."
Can you tell me
1. Why i am not able to run the application with scope as TL?
2. What is the reason for 404 error? Currently i created the WAR using eclipse IDE and placed the WAR in my tomcat server and started the service. Did i missed anything ?
Re: Issues (and solutions! ) with Java HTML 5 SDK Kitchen Sink
- Mark as New
- Favorite
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Flag as Inappropriate
09.20.2012 12:40 PM
TL is an authorization scope. The clientModelScope variable specified on the att-api.properties holds the scopes for client model scopes to be used on the application. When the application registers itself, it obtains a token which is valid for the given scopes specified on that variable.
By default, all the client scopes are set:
clientModelScope=WAP,SMS,MMS,PAYMENT,SPEECH
TL, on the other hand, is as I said an Authorization scope, this means that you have to ask the user consent to use his/her information. Authorization retrieves a different token, using OAuth, based on the current user by displaying a consent page.
This scopes (TL, MIM, and MOBO) are configured on the Provider.js. They are used when Provider.
authorizeApp() method is called.
authorizeApp({
scope: /*Your scope: you can use TL in here */
success: /*your success cbk*/,
failure : /*your failure cbk*/
});
in case you don't pass the scope, all the possible scope will be passed as parameter to get authentication.
-
-
- of 1
-
-
