Java me com.sun.lwuit.html.CSSEngine.applyStyleToUIElement上的java.lang.NullPointerException(未知源)
我正在用EclipsePulsar为j2me运行S60SDK。 我正在尝试加载Linkedn登录页面。 但是不获取如果我只通过设置htmlc.setPage()加载linkedin.com,那么它只显示linkedin name join now&。。但不要显示电子邮件和密码文本框以及登录按钮 我的班级代码如下:Java me com.sun.lwuit.html.CSSEngine.applyStyleToUIElement上的java.lang.NullPointerException(未知源),java-me,linkedin,lwuit,Java Me,Linkedin,Lwuit,我正在用EclipsePulsar为j2me运行S60SDK。 我正在尝试加载Linkedn登录页面。 但是不获取如果我只通过设置htmlc.setPage()加载linkedin.com,那么它只显示linkedin name join now&。。但不要显示电子邮件和密码文本框以及登录按钮 我的班级代码如下: public class Login { Form form = new Form(); String authorizeUrl = ""; LinkedInU
public class Login {
Form form = new Form();
String authorizeUrl = "";
LinkedInUser user;
public Form Login() {
try {
Display.init(this);
HttpRequestHandler handler = new HttpRequestHandler();// = new AsyncDocumentRequestHandler();
HTMLComponent htmlC = new HTMLComponent(handler);
user = new LinkedInUser(Const.consumerKey, Const.consumerSecret);
user.fetchNewRequestToken();
if (user.requestToken != null) {
authorizeUrl = "https://www.linkedin.com/uas/oauth/authorize?oauth_token="
+ user.requestToken.getToken();
}
//htmlC.setPage("http://m.google.com");
System.out.println(""+htmlC.toString());
System.out.println(""+authorizeUrl);
//htmlC.setPage("https://www.linkedin.com/uas/oauth/authorize?oauth_token=5a7ed20d-3a04-419d-85ea-ba99fc06ddbd");
htmlC.setPage(authorizeUrl);
System.out.println(authorizeUrl);
FlowLayout flow = new FlowLayout(Component.TOP);
form.setLayout(flow);
form.addComponent(htmlC);
//myMIDlet.platformRequest("http://wap.mdfactory.com");
} catch (Exception e) {
e.printStackTrace();
}
return form;
}
}
我收到以下一组错误:
Uncaught exception!
java.lang.NullPointerException
at com.sun.lwuit.html.CSSEngine.applyStyleToUIElement(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyStyle(Unknown Source)
at com.sun.lwuit.html.CSSEngine.checkSelector(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.CSSEngine.applyCSS(Unknown Source)
at com.sun.lwuit.html.HTMLComponent.applyAllCSS(Unknown Source)
at com.sun.lwuit.html.ResourceThreadQueue.threadFinished(Unknown Source)
at com.sun.lwuit.html.ResourceThreadQueue$ResourceThread.streamReady(Unknown Source)
at com.sun.lwuit.html.ResourceThreadQueue$ResourceThread.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
epocwind.out文件最后几行是
734.005 content size: 96.0000x96.0000
734.010 content size: 96.0000x96.0000
734.190 WSOCK: Protocol: [0F6414B8] 1 socket(s) have unread data
734.190 WSOCK: ServProvider: [0F646F18] 23 bytes in socket, 0 bytes unread
734.190 WSOCK: ServProvider: [0F646F18] indicating 23 bytes
734.190 WSOCK: ServProvider: [0F646F18] 5 bytes requested, 23 bytes unread
734.190 WSOCK: ServProvider: [0F646F18] received 5 bytes, 18 bytes left
734.190 WSOCK: ServProvider: [0F646F18] 18 bytes requested, 18 bytes unread
734.190 WSOCK: Protocol: [0F6414B8] 0 socket(s) have unread data
734.190 WSOCK: ServProvider: [0F646F18] 0 bytes in socket, 0 bytes unread
734.190 WSOCK: ServProvider: [0F646F18] received 18 bytes, 0 bytes left
734.190 WSOCK: ServProvider: [0F646F18] 0 bytes in socket, 0 bytes unread
734.190 WSOCK: ServProvider: [0F646F18] end of data, I guess
734.215 WSOCK: ServProvider: [0F646F18] Shutdown(00000000)
734.215 WSOCK: ServProvider: [0F646F18] SetNotify(00000000)
734.215 WSOCK: ServProvider: [0F646F18] destroyed
736.050 WSOCK: Interface: GetDataTransferred(0)
741.050 WSOCK: Interface: GetDataTransferred(0)
746.050 WSOCK: Interface: GetDataTransferred(0)
751.050 WSOCK: Interface: GetDataTransferred(0)
756.050 WSOCK: Interface: GetDataTransferred(0)
761.050 WSOCK: Interface: GetDataTransferred(0)
766.050 WSOCK: Interface: GetDataTransferred(0)
771.050 WSOCK: Interface: GetDataTransferred(0)
776.050 WSOCK: Interface: GetDataTransferred(0)
781.050 WSOCK: Interface: GetDataTransferred(0)
为什么会发生这样的事?请帮帮我 尝试用http而不是https打开页面。它不起作用。如果我是htmlC.setIgnoreCss(true);它可以工作,但页面显示为简单的白色页面内容是蓝黑色和白色。登录后给我一个启用cookie的错误,我检查了emulator浏览器设置,但仍然发生同样的事情