I am following the instructions in https://github.com/mapbox/mapbox-android-sdk#building-from-source and am currently using Android Studio. I used to use Eclipse for this Android project and I just plain gave up after spending all of yesterday trying to make integrating mapbox-android-sdk to work with my android project in Eclipse. I wish the instructions were clearer on mapbox-android-sdk--I am delighted to help them if I knew how.
I imported my old Android project into Android Studio, and then went into File->Import Project and chose the build.gradle inside MapboxAndroidSDK in the directory where I downloaded the git source tree in my system.
Then, while my android project needing maps supported was selected in Android Studio, I went to File->Import Module in Android Studio to add the *.aar file that was generated in the MapboxAndroidSDK directory.
Anyway, when I now run my app, I get the following errors. Any help is appreciated.
09-29 11:30:07.061 1111-1111/com.username.someapp D/﹕ HostConnection::get() New Host Connection established 0xb7b6bdb8, tid 1111
09-29 11:30:07.091 1111-1111/com.username.someapp W/EGL_emulation﹕ eglSurfaceAttrib not implemented
09-29 11:30:07.101 1111-1111/com.username.someapp D/OpenGLRenderer﹕ Enabling debug mode 0
09-29 11:30:16.431 1111-1111/com.username.someapp D/dalvikvm﹕ GC_FOR_ALLOC freed 104K, 5% free 3282K/3448K, paused 20ms, total 24ms
09-29 11:30:16.481 1111-1111/com.username.someapp W/dalvikvm﹕ VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
09-29 11:30:16.481 1111-1111/com.username.someapp W/dalvikvm﹕ VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
09-29 11:30:16.491 1111-1111/com.username.someapp I/dalvikvm﹕ Could not find method java.nio.file.Files.newOutputStream, referenced from method okio.Okio.sink
09-29 11:30:16.491 1111-1111/com.username.someapp W/dalvikvm﹕ VFY: unable to resolve static method 10776: Ljava/nio/file/Files;.newOutputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStrea
m;
09-29 11:30:16.491 1111-1111/com.username.someapp D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x000a
09-29 11:30:16.491 1111-1111/com.username.someapp W/dalvikvm﹕ VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
09-29 11:30:16.491 1111-1111/com.username.someapp W/dalvikvm﹕ VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
09-29 11:30:16.501 1111-1111/com.username.someapp I/dalvikvm﹕ Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
09-29 11:30:16.501 1111-1111/com.username.someapp W/dalvikvm﹕ VFY: unable to resolve static method 10775: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
09-29 11:30:16.501 1111-1111/com.username.someapp D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x000a
09-29 11:30:16.511 1111-1111/com.username.someapp D/AndroidRuntime﹕ Shutting down VM
09-29 11:30:16.511 1111-1111/com.username.someapp W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb1aaaba8)
09-29 11:30:16.531 1111-1111/com.username.someapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.username.someapp, PID: 1111
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.username.someapp/com.username.someapp.MapActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.username.someapp.MapActivity.onCreate(MapActivity.java:51)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
I think the issue may be resolved with the instructions in here that says
Don't forget to then also include the dependencies from MapboxAndroidSDK / build.gradle in your classpath!
but I have no idea how to do that in Android Studio. Could anyone point to exactly what dependencies and how? Should I add them as File->Project Structure->Dependencies->Library dependency->? Any insight into this is deeply appreciated.
Thanks, Scott Barta.
For anybody else who comes in here with similar issues, I want to spell out how I fixed the problem. It was, as Scott points out, an issue with my code, not with the SDK. For starters, please note that mapbox-android-sdk comes with a test application which works, so in the end if you are stuck here, remember that the app is likely not the issue.
Anyway, it turned out that I had not initiated the Activity correctly. I had to instantiate it with the correct MapView and also use the appropriate mapbox:mapid (which should be declared in the *.xml file or the manifest file. Also, the example in the original page was for a fragment which looked slightly different from my code which caused some confusion. Last, but certainly not the least, I have switched so many platforms to get this to work (eclipse, gradle and now android studio) that is likely one of the biggest causes. I plan capturing these changes to my app somewhere and if I see interest, I will update this answer with more details.
Related
I am attempting to follow this google codelab
Creating Android Slices
When I enter the following adb command
adb shell am start -a android.intent.action.VIEW -d slice-content://com.android.example.slicecodelab/temperature
The Slice Viewer crashes as follows:-
2019-03-19 10:16:05.704 8343-8583/com.example.android.sliceviewer E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.example.android.sliceviewer, PID: 8343
java.lang.NullPointerException: name == null
at java.lang.Enum.valueOf(Enum.java:242)
at android.graphics.PorterDuff$Mode.valueOf(PorterDuff.java:178)
at androidx.core.graphics.drawable.IconCompat.onPostParceling(IconCompat.java:757)
at androidx.core.graphics.drawable.IconCompatParcelizer.read(IconCompatParcelizer.java:19)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemHolderParcelizer.read(SliceItemHolderParcelizer.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemParcelizer.read(SliceItemParcelizer.java:15)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1342)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1311)
at androidx.slice.SliceParcelizer.read(SliceParcelizer.java:13)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemHolderParcelizer.read(SliceItemHolderParcelizer.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemParcelizer.read(SliceItemParcelizer.java:15)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1342)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1311)
at androidx.slice.SliceParcelizer.read(SliceParcelizer.java:13)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.ParcelImpl.<init>(ParcelImpl.java:37)
at androidx.versionedparcelable.ParcelImpl$1.createFromParcel(ParcelImpl.java:61)
at androidx.versionedparcelable.ParcelImpl$1.createFromParcel(ParcelImpl.java:58)
at android.os.Parcel.readParcelable(Parcel.java:2860)
at android.os.Parcel.readValue(Parcel.java:2754)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3123)
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:273)
at android.os.BaseBundle.unparcel(BaseBundle.java:226)
at android.os.Bundle.getParcelable(Bundle.java:939)
at androidx.slice.compat.SliceProviderCompat.bindSlice(SliceProviderCompat.java:320)
2019-03-19 10:16:05.704 8343-8583/com.example.android.sliceviewer E/AndroidRuntime: at androidx.slice.compat.SliceProviderCompat.bindSlice(SliceProviderCompat.java:378)
at androidx.slice.SliceViewManagerCompat.bindSlice(SliceViewManagerCompat.java:65)
at androidx.slice.widget.SliceLiveData$SliceLiveDataImpl$1.run(SliceLiveData.java:291)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
In fact whatever Android Slice tutorial I attempt to use the Slice Viewer fails in the exact same way
Are android Slices not ready for use?
What Am I dong wrong?
How can I fix Slice Viewer?
UPDATE
Ive raised an Issue (Issue 128658881) and Google are fixing this.
Slice-viewer app crashes on Devices below API 28 when we try to display icons in slice. The app doesn't crash on Pie.
This issue is described here
Recently I can observe very weird behavior of TestNG tests launched from surefire plugin. Once suite is finished tests execution just hang without any exceptions or informations. After killing executtion and clearing workspace it seems that SurefireBotter hanged:
Failed to clean project: Failed to delete C:\[path]\target\surefire\surefirebooter380043352616947373.jar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete C:\[path]\target\surefire\surefirebooter380043352616947373.jar
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:215)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.IOException: Failed to delete C:\[path]\target\surefire\surefirebooter380043352616947373.jar
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:249)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:191)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:117)
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:193)
The curious thing is that after killing process with maven manually after it hangs, I still can see java processes in system responsible for that booter.
Framework that I'm using is based on Spring, however I have no idea if this is meaningfull :)
Any hints will be more than welcome :)
You can kill the java process using JPS (a tool provide with the JDK). JPS will list process and id. You can kill the process by the id
I have developed a working Cooja simulatation that uses 1 sky mote (for RPL border router, that did not work with a cooja mote) and 30 Cooja motes.
I run cooja using ant big_mem.
The simulation was working correctly, and then I have saved it.
After quitting cooja I have tried to reuse it, but I always get the following error:
se.sics.cooja.GUI$SimulationCreationException: Mote type creation error: Error when creating corecomm instance: Lib4
at se.sics.cooja.GUI.loadSimulationConfig(GUI.java:3428)
at se.sics.cooja.GUI.loadSimulationConfig(GUI.java:3340)
at se.sics.cooja.GUI.doLoadConfig(GUI.java:2397)
at se.sics.cooja.GUI$4.run(GUI.java:636)
at java.lang.Thread.run(Thread.java:745)
Caused by: se.sics.cooja.MoteType$MoteTypeCreationException: Error when creating corecomm instance: Lib4
at se.sics.cooja.CoreComm.createCoreComm(CoreComm.java:343)
at se.sics.cooja.contikimote.ContikiMoteType.doInit(ContikiMoteType.java:385)
at se.sics.cooja.contikimote.ContikiMoteType.configureAndInit(ContikiMoteType.java:348)
at se.sics.cooja.contikimote.ContikiMoteType.setConfigXML(ContikiMoteType.java:1389)
at se.sics.cooja.Simulation.setConfigXML(Simulation.java:681)
at se.sics.cooja.GUI.loadSimulationConfig(GUI.java:3410)
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at se.sics.cooja.CoreComm.createCoreComm(CoreComm.java:334)
... 9 more
Caused by: java.lang.UnsatisfiedLinkError: se.sics.cooja.corecomm.Lib4.init()V
at se.sics.cooja.corecomm.Lib4.init(Native Method)
at se.sics.cooja.corecomm.Lib4.<init>(Lib4.java:50)
... 14 more
How can I solve it?
Thank you,
Daniel
I have discovered the problem. It it necessary to delete the obj_cooja folder that the simulation creates to solve the problem
We are trying to add a new Solr node to our cluster:
DC Cassandra
Cassandra node 1
DC Solr
Solr node 1 <-- new node (actually, a replacement for an old node)
Solr node 2
Solr node 3
Solr node 4
Solr node 5
During the bootstrap process:
The stream from node 3 to node 1 failed with an exception:
ERROR [STREAM-OUT-/IP_OF_NODE1] 2014-04-01 01:14:40,887 CassandraDaemon.java (line 196) Exception in thread Thread[STREAM-OUT-/IP_OF_NODE1,5,main]
java.lang.NullPointerException
at org.apache.cassandra.streaming.ConnectionHandler$MessageHandler.signalCloseDone(ConnectionHandler.java:249)
at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:375)
at java.lang.Thread.run(Thread.java:744)
The stream from node 4 to node 1 never started. The last relevant line in node 4's system.log is:
Received streaming plan for Bootstrap.
It should have been followed by:
Prepare completed. Receiving 0 files(0 bytes), sending x files(y bytes)
It seems that the bootstrap process is now stalled because the data file sizes are not changing anymore. How can I force those streams to be retried?
EDIT:
I restarted all nodes today in an attempt to force new node to retry the bootstrap process. Unfortunately, it encountered some stream failures again. This time, the exception in node 1 is as follows:
WARN [STREAM-IN-/IP_OF_NODE3] 2014-04-06 20:48:17,963 StreamSession.java (line 532) [Stream #c84effb0-bda9-11e3-a07d-89325af2f6bf] Retrying for following error
java.lang.RuntimeException: java.io.FileNotFoundException: /home/cassandra/data/my_keyspace/my_table/my_keyspace-my_table-tmp-jb-1209-Data.db (Too many open files)
at org.apache.cassandra.io.util.SequentialWriter.<init>(SequentialWriter.java:75)
at org.apache.cassandra.io.compress.CompressedSequentialWriter.<init>(CompressedSequentialWriter.java:71)
at org.apache.cassandra.io.compress.CompressedSequentialWriter.open(CompressedSequentialWriter.java:42)
at org.apache.cassandra.io.sstable.SSTableWriter.<init>(SSTableWriter.java:107)
at org.apache.cassandra.io.sstable.SSTableWriter.<init>(SSTableWriter.java:60)
at org.apache.cassandra.streaming.StreamReader.createWriter(StreamReader.java:111)
at org.apache.cassandra.streaming.compress.CompressedStreamReader.read(CompressedStreamReader.java:65)
at org.apache.cassandra.streaming.messages.IncomingFileMessage$1.deserialize(IncomingFileMessage.java:47)
at org.apache.cassandra.streaming.messages.IncomingFileMessage$1.deserialize(IncomingFileMessage.java:37)
at org.apache.cassandra.streaming.messages.StreamMessage.deserialize(StreamMessage.java:55)
at org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:283)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.io.FileNotFoundException: /home/cassandra/data/my_keyspace/my_table/my_keyspace-my_table-tmp-jb-1209-Data.db (Too many open files)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
at org.apache.cassandra.io.util.SequentialWriter.<init>(SequentialWriter.java:71)
ERROR [STREAM-IN-/78.46.63.218] 2014-04-06 20:48:17,964 StreamSession.java (line 418) [Stream #c84effb0-bda9-11e3-a07d-89325af2f6bf] Streaming error occurred
java.lang.IllegalArgumentException: Unknown type 0
at org.apache.cassandra.streaming.messages.StreamMessage$Type.get(StreamMessage.java:89)
at org.apache.cassandra.streaming.messages.StreamMessage.deserialize(StreamMessage.java:54)
at org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:283)
at java.lang.Thread.run(Thread.java:724)
There are tons of similar errors in the log. e.g.:
ERROR [CompactionExecutor:129] 2014-04-06 20:50:06,401 CassandraDaemon.java (line 196) Exception in thread Thread[CompactionExecutor:129,1,main]
java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: /home/cassandra/data/my_keyspace/my_table/my_keyspace-my_table-jb-51-Data.db (Too many open files)
at org.apache.cassandra.service.pager.QueryPagers$1.next(QueryPagers.java:154)
at org.apache.cassandra.service.pager.QueryPagers$1.next(QueryPagers.java:137)
at org.apache.cassandra.db.Keyspace.indexRow(Keyspace.java:400)
at org.apache.cassandra.db.index.SecondaryIndexBuilder.build(SecondaryIndexBuilder.java:62)
at org.apache.cassandra.db.compaction.CompactionManager$9.run(CompactionManager.java:833)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /home/cassandra/data/my_keyspace/my_table/my_keyspace-my_table-jb-51-Data.db (Too many open files)
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.open(CompressedRandomAccessReader.java:47)
at org.apache.cassandra.io.util.CompressedPoolingSegmentedFile.createReader(CompressedPoolingSegmentedFile.java:48)
at org.apache.cassandra.io.util.PoolingSegmentedFile.getSegment(PoolingSegmentedFile.java:39)
at org.apache.cassandra.io.sstable.SSTableReader.getFileDataInput(SSTableReader.java:1195)
at org.apache.cassandra.db.columniterator.SimpleSliceReader.<init>(SimpleSliceReader.java:57)
at org.apache.cassandra.db.columniterator.SSTableSliceIterator.createReader(SSTableSliceIterator.java:65)
at org.apache.cassandra.db.columniterator.SSTableSliceIterator.<init>(SSTableSliceIterator.java:42)
at org.apache.cassandra.db.filter.SliceQueryFilter.getSSTableColumnIterator(SliceQueryFilter.java:167)
at org.apache.cassandra.db.filter.QueryFilter.getSSTableColumnIterator(QueryFilter.java:62)
at org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:250)
at org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:53)
at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1550)
at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1379)
at org.apache.cassandra.db.Keyspace.getRow(Keyspace.java:327)
at org.apache.cassandra.db.SliceFromReadCommand.getRow(SliceFromReadCommand.java:65)
at org.apache.cassandra.service.pager.SliceQueryPager.queryNextPage(SliceQueryPager.java:77)
at org.apache.cassandra.service.pager.AbstractQueryPager.fetchPage(AbstractQueryPager.java:84)
at org.apache.cassandra.service.pager.SliceQueryPager.fetchPage(SliceQueryPager.java:33)
at org.apache.cassandra.service.pager.QueryPagers$1.next(QueryPagers.java:148)
... 10 more
Caused by: java.io.FileNotFoundException: /home/cassandra/data/my_keyspace/my_table/my_keyspace-my_table-jb-51-Data.db (Too many open files)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
at org.apache.cassandra.io.util.RandomAccessReader.<init>(RandomAccessReader.java:58)
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.<init>(CompressedRandomAccessReader.java:76)
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.open(CompressedRandomAccessReader.java:43)
... 28 more
This appears to be very similar to a Cassandra bug/issue:
https://issues.apache.org/jira/browse/CASSANDRA-6965
I'll follow up on that.
Meanwhile, you could run rebuild/repair on that new node.
EDIT: Another Cassandra issue that appears to be related:
CASSANDRA-6984 - "NullPointerException in Streaming During Repair"
https://issues.apache.org/jira/browse/CASSANDRA-6984
That issue is labeled as a Blocker, so it should get some prompt attention. I've inquired as to whether there is a workaround.
Stay tuned.
(Too many open files)
Looks like you need to increase your ulimit.
This is my problem:
I'm learning Java EE development and I wanted to build up a WebApplication using Ejb. First of all I tried developing on the same machine, creating a EJB module on a glassfish domain and accessing it through a web application running on the same machine but on different domain: all worked fine. I was able, using glassfish 3.1, to access to the EJBmodule from the webapp thanks to the definition of glassfish-web.xml in my WEB-ING folder:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<ejb-ref>
<ejb-ref-name>ejb/FirstBeanRemote</ejb-ref-name>
<jndi-name>corbaname:iiop:127.0.0.1:3700#java:global/EJBModule/FirstBean!ejb.FirstBeanRemote</jndi-name>
</ejb-ref>
</glassfish-web-app>
After this, I wanted to change experiment, using different machines for the ejb module and the webapp. First of all I installed on a debian machine glassfish 3.1 and deployed my module including the required interfaces. No errors returned in the deploying so I proceeded starting the domain and again all seems to work fine. In server.log I copied the portable jndi names for my EJB FirstBean:
Portable JNDI names for EJB FirstBean: [java:global/EJBModule/FirstBean, java:global/EJBModule/FirstBean!ejb.FirstBeanRemote]
So now on another machine using Netbeans ( under windows 7 ) I created the same webapp as the previous one just changing the glassfish-web.xml in this way:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<ejb-ref>
<ejb-ref-name>ejb/FirstBeanRemote</ejb-ref-name>
<jndi-name>corbaname:iiop:192.168.1.110:3700#java:global/EJBModule/FirstBean!ejb.FirstBeanRemote</jndi-name>
</ejb-ref>
</glassfish-web-app>
I'm sure about Ip(static in my lan) and port (I create a default domain on glassfish).
The problem comes now. When I start the webapplication I get the error:
com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean prova
at com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:211)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:103)
at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:103)
at com.sun.el.parser.AstValue.getValue(AstValue.java:179)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIOutput.getValue(UIOutput.java:169)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1764)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.sun.faces.spi.InjectionProviderException: com.sun.enterprise.container.common.spi.util.InjectionException: Eccezione durante il tentativo di inserire Remote ejb-ref name=ejb/FirstBeanRemote,Remote 3.x interface =ejb.FirstBeanRemote,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:192.168.1.110:3700#java:global/EJBModule123/FirstBean!ejb.FirstBeanRemote,refType=Session in class ciao.Prova: Lookup failed for 'java:comp/env/ejb/FirstBeanRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at org.glassfish.faces.integration.GlassFishInjectionProvider.inject(GlassFishInjectionProvider.java:194)
at com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:205)
... 51 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Eccezione durante il tentativo di inserire Remote ejb-ref name=ejb/FirstBeanRemote,Remote 3.x interface =ejb.FirstBeanRemote,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:192.168.1.110:3700#java:global/EJBModule123/FirstBean!ejb.FirstBeanRemote,refType=Session in class ciao.Prova: Lookup failed for 'java:comp/env/ejb/FirstBeanRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:703)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:470)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:171)
at org.glassfish.faces.integration.GlassFishInjectionProvider.inject(GlassFishInjectionProvider.java:184)
... 52 more
Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/env/ejb/FirstBeanRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=ejb/FirstBeanRemote,Remote 3.x interface =ejb.FirstBeanRemote,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:192.168.1.110:3700#java:global/EJBModule123/FirstBean!ejb.FirstBeanRemote,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'corbaname:iiop:192.168.1.110:3700#java:global/EJBModule123/FirstBean__3_x_Internal_RemoteBusinessHome__' [Root exception is org.omg.CORBA.BAD_PARAM: Buono: IOP00100009: string_to_object conversion failed due to bad schema specific part in name java:global/EJBModule123/FirstBean__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:599)
... 55 more
Caused by: javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=ejb/FirstBeanRemote,Remote 3.x interface =ejb.FirstBeanRemote,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:192.168.1.110:3700#java:global/EJBModule123/FirstBean!ejb.FirstBeanRemote,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'corbaname:iiop:192.168.1.110:3700#java:global/EJBModule123/FirstBean__3_x_Internal_RemoteBusinessHome__' [Root exception is org.omg.CORBA.BAD_PARAM: Buono: IOP00100009: string_to_object conversion failed due to bad schema specific part in name java:global/EJBModule123/FirstBean__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No]
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:191)
at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1109)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:169)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 59 more
Caused by: org.omg.CORBA.BAD_PARAM: Buono: IOP00100009: string_to_object conversion failed due to bad schema specific part in name java:global/EJBModule123/FirstBean__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy151.soBadSchemaSpecific(Unknown Source)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:227)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:154)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:145)
at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:976)
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:184)
... 64 more
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
at org.omg.CosNaming._NamingContextExtStub.resolve_str(_NamingContextExtStub.java:165)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:222)
... 68 more
It seems to me a jndi problem, infact in the exception list I can read "Lookup failed for 'java:comp/env/ejb/FirstBeanRemote', so the webapp is not even able to access to the EJBModule. But I'm wondering why, since I'm using the portable jndi provided me by the glassfish server itself!
I hope I was clear and someone can help me.
Max