CN1Sockets Simulator Problem

38 views
Skip to first unread message

jython234

unread,
Aug 11, 2014, 4:14:41 PM8/11/14
to codenameone...@googlegroups.com
Hello everyone,
Today I started writing my first real app using codename one, and I noticed that the standard API doesn't support Sockets.
So, I found CN1Sockets, and I was able to install the library fine. The only problem was that once I ran in the simulator, it would not be able to find ca.weblite.codename1.net.impl.NativeSocketImpl. I have posted the full error below:
java.lang.ClassNotFoundException: ca.weblite.codename1.net.impl.NativeSocketImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.findSystemClass(Unknown Source)
at com.codename1.impl.javase.ClassPathLoader.findClass(ClassPathLoader.java:100)
at com.codename1.impl.javase.ClassPathLoader.loadClass(ClassPathLoader.java:50)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.codename1.system.NativeLookup.create(NativeLookup.java:55)
at ca.weblite.codename1.net.Socket.isSocketSupported(Socket.java:51)
at tk.jython234.jychat.client.JyChatMain.start(JyChatMain.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.codename1.impl.javase.Executor$1.run(Executor.java:95)
at com.codename1.ui.Display.processSerialCalls(Display.java:1075)
at com.codename1.ui.Display.mainEDTLoop(Display.java:897)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Here is my machine info:
IDE: Eclipse
OS: Windows 8
Testing Device: Simulator
Target-Platform: iOS

Steve Hannah

unread,
Aug 11, 2014, 4:23:12 PM8/11/14
to codenameone...@googlegroups.com
Try refreshing the libs on the project, and perhaps try a clean and build on the project to make sure that it loads the classes into the classpath properly.

Steve


--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/5deb71b6-57ef-4174-930e-84f134a92d10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Web Lite Solutions Corp.

jython234

unread,
Aug 11, 2014, 4:24:34 PM8/11/14
to codenameone...@googlegroups.com
I already refeshed, and built, the error only happens when I run the simulator.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.

Steve Hannah

unread,
Aug 11, 2014, 4:32:18 PM8/11/14
to codenameone...@googlegroups.com
This issue was posted for Netbeans, but may apply to Eclipse as well.

Make sure you do a clean and build (not run) and then try to run it.


To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jython234

unread,
Aug 11, 2014, 4:37:46 PM8/11/14
to codenameone...@googlegroups.com
Sorry for not knowing this but, how do you just build? I never saw anything in eclipse that said "build".
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Web Lite Solutions Corp.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

Steve Hannah

unread,
Aug 11, 2014, 4:41:40 PM8/11/14
to codenameone...@googlegroups.com

jython234

unread,
Aug 11, 2014, 4:43:03 PM8/11/14
to codenameone...@googlegroups.com
Oh, I already try'd that, still no luck.



--
Steve Hannah
Web Lite Solutions Corp.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

Steve Hannah

unread,
Aug 11, 2014, 4:45:43 PM8/11/14
to codenameone...@googlegroups.com
It's likely the same problem as the Netbeans issue (the native classes not being compiled yet).  Maybe Shai or Chen have some suggestions.


To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jython234

unread,
Aug 11, 2014, 4:48:14 PM8/11/14
to codenameone...@googlegroups.com
I can find the source files, but not any compliled ones. It is sad that I can't use Sockets, my app really needs them, without it, its not an app. Are there any other socket libraries out there?



--
Steve Hannah
Web Lite Solutions Corp.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

Steve Hannah

unread,
Aug 11, 2014, 4:53:17 PM8/11/14
to codenameone...@googlegroups.com
Yes.  CN1 has built in socket support too.  The API is a little different and it only works on Android and iOS right now (maybe winphone too.. not sure).

Steve


To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jython234

unread,
Aug 11, 2014, 4:57:39 PM8/11/14
to codenameone...@googlegroups.com
Yes it is very different, however this will work, thanks for your help!



--
Steve Hannah
Web Lite Solutions Corp.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
Reply all
Reply to author
Forward
0 new messages