Friday, April 16, 2010

java.net.SocketException: Unrecognized Windows Sockets error: 0: Cannot bind

Oracle Coherence is a JVM-based Clustering technology. sometimes, when you start the jvms on windows environment, you may get some strange error. like this,
java.net.SocketException: Unrecognized Windows Sockets error: 0
: Cannot bind
at com.tangosol.coherence.component.net.Cluster.onStart(Cluster.CDB:108)
at com.tangosol.coherence.component.net.Cluster.start(Cluster.CDB:11)
at com.tangosol.coherence.component.util.SafeCluster.startCluster(SafeCl
uster.CDB:3)
at com.tangosol.coherence.component.util.SafeCluster.restartCluster(Safe
Cluster.CDB:7)
at com.tangosol.coherence.component.util.SafeCluster.ensureRunningCluste
r(SafeCluster.CDB:27)
at com.tangosol.coherence.component.util.SafeCluster.start(SafeCluster.C
DB:2)
at com.tangosol.net.CacheFactory.ensureCluster(CacheFactory.java:998)
at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(Defaul
double check you config file, it’s all correct.
then check whether you have enabled some network acceleration solution, Like Microsoft ISA Client, or Google Accelerator. they try to hooked up with windows socket provider. disable them, then problem gone.
have fun.

coherence user guide: http://coherence.oracle.com/display/COH35UG/Coherence+3.5+Home
some other googled exception:

Wednesday, April 14, 2010

Unable to open trace file '/sdcard/Mytwitter.trace': Permission denied

in android, you can enable trace by adding code like
Debug.startMethodTracing("mm.trace");

then the system will dump one big tracefile to /sdcard/mm.trace

at first, you may get error like

Unable to open trace file '/sdcard/mm.trace': Permission denied

when you view the permission, it's fine.

the trick is that start from 1.6, it need one permission so tat you could write something to sdcard

the permission is
android.permission.WRITE_EXTERNAL_STORAGE

public static final String WRITE_EXTERNAL_STORAGE

Since: API Level 4
Allows an application to write to external storage
Constant Value: "android.permission.WRITE_EXTERNAL_STORAGE"

Monday, April 12, 2010

WARNING: Application does not specify an API level requirement

when you forget to specify the minimum SDK version during the project setup, you may get the WARNING like

WARNING: Application does not specify an API level requirement

fix is easy, put the minimum SDK version into the manifest file



<uses-sdk minsdkversion="7"/>