X

Geertjan's Blog

  • July 27, 2015

Cassandra Meets NetBeans IDE

Geertjan Wielenga
Product Manager

Initial support for Cassandra in NetBeans IDE 8.0.2 is available. Get it here:

http://plugins.netbeans.org/plugin/59444

Install into NetBeans IDE 8.0.2, open the Services window (Ctrl-5),
right-click the Cassandra node, fill in a host (127.0.0.1 is the default), and a port (9042 is the default), and then
browse the Cluster.

In the screenshot above "Explore From Here" opens the Cassandra node in a separate window, i.e., giving you more space, if you don't want to work in the Services window.

Double-click a table in a user keyspace (or right-click on it) to view its values in a
table, as shown below. Choose "Dump Data" to print values into the Output window (Ctrl-4). Tables in system keyspaces are locked, i.e., data cannot be viewed.

In a future release of the plugin, the Cassandra node will be within the Databases node in the Services window, also Cassandra QL will be supported.

Sources are here, please fork and enhance: https://github.com/GeertjanWielenga/NetCassandraBeans

Join the discussion

Comments ( 16 )
  • guest Tuesday, July 28, 2015

    Great job just exactly what Cassandra users need :)


  • guest Wednesday, July 29, 2015

    I see from that code that you are not using ServicesTabNodeRegistration but registering a node factory in the layer.xml.

    Can you please explain or point me to a documentation which explains the differences between two approaches.

    Thank you.


  • Geertjan Wednesday, July 29, 2015

    ServicesTabNodeRegistration would create a root node in the Services window. In the screenshot, that's what you see, a root node for Cassandra. However, in the next version of the plugin, the Cassandra node will be in the correct place in the hierarchy, i.e., within the Databases node, which is why ServicesTabNodeRegistration would not be the appropriate way to register the node from that point onwards. I.e., the source code is not in sync at this point with the released plugin.


  • Mani Wednesday, July 29, 2015

    I played with the ServicesTabNodeRegistration. It does not have a Path attribute. Would be nice to have it though. Enhancement?


  • Geertjan Wednesday, July 29, 2015

    It's really intended for the root node of the Services window only. Each of the Nodes within the Services window have their own separate APIs and organizational structures, so having a path attribute wouldn't work.


  • Frank Jennings Saturday, September 19, 2015

    Thanks, Geertjan. This is exactly what I was looking for!


  • guest Friday, October 30, 2015

    I am getting the following error when I right click on Cassandra and do not get the explorer dialog

    java.lang.IllegalArgumentException: Original Node from map BinaryFileMap@1893e78{fo=MultiFileObject@180f8e8[UI/Runtime/com-ncb-CassandraTab.instance]} is null

    at org.openide.nodes.LazyNode.switchToOriginal(LazyNode.java:85)

    at org.openide.nodes.LazyNode.getActions(LazyNode.java:74)

    at org.openide.nodes.FilterNode.getActions(FilterNode.java:751)

    at org.openide.nodes.NodeOp.findActions(NodeOp.java:162)

    at org.openide.explorer.view.TreeView.createPopup(TreeView.java:1056)

    at org.openide.explorer.view.TreeView$PopupAdapter.showPopup(TreeView.java:1555)

    at org.openide.awt.MouseUtils$PopupMouseAdapter.maybePopup(MouseUtils.java:189)

    at org.openide.awt.MouseUtils$PopupMouseAdapter.mouseReleased(MouseUtils.java:184)

    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)

    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

    at java.awt.Component.processMouseEvent(Component.java:6505)

    at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)

    at java.awt.Component.processEvent(Component.java:6270)

    at java.awt.Container.processEvent(Container.java:2229)

    at java.awt.Component.dispatchEventImpl(Component.java:4861)

    at java.awt.Container.dispatchEventImpl(Container.java:2287)

    at java.awt.Component.dispatchEvent(Component.java:4687)

    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)

    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)

    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)

    at java.awt.Container.dispatchEventImpl(Container.java:2273)

    at java.awt.Window.dispatchEventImpl(Window.java:2719)

    at java.awt.Component.dispatchEvent(Component.java:4687)

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)

    at java.awt.EventQueue.access$200(EventQueue.java:103)

    at java.awt.EventQueue$3.run(EventQueue.java:694)

    at java.awt.EventQueue$3.run(EventQueue.java:692)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)

    at java.awt.EventQueue$4.run(EventQueue.java:708)

    at java.awt.EventQueue$4.run(EventQueue.java:706)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)

    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)

    [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


  • guest Monday, February 29, 2016

    Great job just exactly what Cassandra users need :)

    When I followed these steps, I can not explore Cassandra cluster.

    I have install Cassandra in my local PC and ip address: 127.0.0.0.

    Anyone can help me?


  • Geertjan Monday, February 29, 2016

    Based on your description, no way to help at all. Hopefully you have error messages or something, anything, at all.


  • David Tuesday, March 1, 2016

    Thanks for prompt response.

    I am new to Cassandra, I saw Cassandra button then "add cluster" and port number.

    After I have done these steps, I still can not expend Cassandra node.

    It seems like not connect at all, but I did not get any errors.

    I have download Cassandra plugin and install Cassandra in my local pc

    Any other steps need be done?

    Thanks


  • Geertjan Tuesday, March 1, 2016

    There definitely is an error message. Remove the user directory (http://wiki.netbeans.org/FaqWhatIsUserdir), restart the IDE, reinstall the plugin, try to use it again, when it fails, zip up the user directory and send it to me in an e-mail: geertjan dot wielenga at oracle dot com.


  • David Wednesday, March 2, 2016

    Thanks. It turned out Cassandra 3.0 bugs.

    If use 2.20, everything works fine.


  • guest Saturday, March 5, 2016

    sir i am trying to conncectivity java and cassandra but i am not properly done this code pleze send me proper code


  • Geertjan Saturday, March 5, 2016

    Thanks. Cassandra 3.0 has bugs. If you use 2.20, everything works fine.


  • guest Sunday, March 6, 2016

    i have an error ... cassandra and java connectivity in ubuntu(netbeans)

    please guide me....

    10:45:37.049 [main] DEBUG com.datastax.driver.core.Cluster - Starting new cluster with contact points [/127.0.0.1]

    Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory

    at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:993)

    at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:941)

    at com.datastax.driver.core.Cluster.<init>(Cluster.java:88)

    at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:144)

    at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:906)

    at cass.Cass.main(Cass.java:57)


  • Geertjan Thursday, March 17, 2016

    For users of Cassandra 3, get the latest release of the NetCassandraBeans plugin: https://blogs.oracle.com/geertjan/entry/work_better_with_cassandra_3


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.