List:Cluster« Previous MessageNext Message »
From:Serdyn du Toit Date:June 5 2013 2:15pm
Subject:Re: ClusterJDatastoreException (possible obscure Windows error?)
View as plain text  
Hi Andrew,

Yep - the database "clusterdb" exists.

> There are people better placed than me to check the error.
No worries, the error is pretty recondite.  I think the only way I'm going
to solve this one is by moving to another machine.

The communication with the database is actually intact.  It actually
creates the database table, but does not insert my test record.  So I think
the data transfer is terminated prematurely due to something obscure on my
machine (remember this was exactly the same issue I encountered before
using a similar setup and Solr)

Going to buy\build a new machine tomorrow if I can't resolve this.

One more thing I'm going to try before then - upgrading my VirtualBox to
the latest version.  Maybe there's some strange "socket buffering or
connection keepalive" -type situation that the current version can't handle
properly (doubt it though, my version is pretty recent)

Thanks for the input - appreciated :)
Serdyn du Toit


On Wed, Jun 5, 2013 at 2:23 PM, Andrew Morgan <andrew.morgan@stripped>wrote:

> Hi Serdy,
>
>  There are people better placed than me to check the error but one thing I
> notice is that you have " com.mysql.clusterj.database=clusterdb" - have you
> created a database (schema) called clusterdb?
>
> Regards, Andrew.
>
> > -----Original Message-----
> > From: Serdyn du Toit [mailto:dutoitns@stripped]
> > Sent: 05 June 2013 10:16
> > To: cluster@stripped
> > Subject: ClusterJDatastoreException (possible obscure Windows error?)
> >
> > Hi,
> >
> > Hopeing someone can help me gain some insight into the following problem.
> >
> > I get the following exception on my Windows setup, but not on my Linux
> > setup:
> >
> > INFO: Created cluster connection 'localhost:1186' with node id 0.
> > <openjpa-2.2.2-r422266:1468616 nonfatal general error>
> > org.apache.openjpa.persistence.PersistenceException: Error getting
> > connection to cluster with properties
> > {com.mysql.clusterj.connect.verbose=0,
> > com.mysql.clusterj.connect.retries=4, com.mysql.clusterj.connect.delay=5,
> > com.mysql.clusterj.connectstring=localhost:1186,
> > com.mysql.clusterj.max.transactions=1024,
> > com.mysql.clusterj.connect.timeout.before=30,
> > com.mysql.clusterj.database=clusterdb,
> > com.mysql.clusterj.connect.timeout.after=20}:
> >  Caused by com.mysql.clusterj.ClusterJDatastoreException:Datastore
> > exception on connectString 'localhost:1186' nodeId 0; Return code: -1
> error
> > code: 0 message: .
> > at
> > org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrok
> > erFactory.java:218)
> > at
> > org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(Delegating
> > BrokerFactory.java:156)
> > at
> > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMan
> > ager(EntityManagerFactoryImpl.java:227)
> > at
> > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMan
> > ager(EntityManagerFactoryImpl.java:154)
> > at
> > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMan
> > ager(EntityManagerFactoryImpl.java:60)
> > at
> > prod.d6.core.util.temp_dao.daos.util.ClusterJpaManager.getEntityManager(
> > ClusterJpaManager.java:20)
> > at
> > prod.d6.core.util.temp_dao.testobjects.test.TestDataBeanTest.test(TestDat
> > aBeanTest.java:20)
> > 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
> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
> > Method.java:45)
> > <snip>
> >
> > My Linux setup is as follows: (This works) Client code runs on an Ubuntu
> > 11.04 VirtualBox.  MySql Cluster runs inside the same VirtualBox.
> >
> > My Windows setup is as follows: (This does NOT work, possibly due to an
> > integration issue between my Windows box and the Ubuntu VirtualBox)
> > Client code runs on Windows 7.  MySql Cluster runs on Ubuntu 12.04.2
> > Server.  The Ubuntu instance is running inside a VirtualBox on Windows 7.
> >
> > This is not the first time I'm having integration issues with a setup
> like this.
> > About two years back (but still using the same machine) I tried to
> integrate
> > with Solr (search server) from my Windows box.  It didn't work.
> >  When I moved all my code onto a Linux VirtualBox, with Solr running in
> the
> > VirtualBox as well - everything worked.
> >
> > I recall at the time I could see the client code and Solr communicating,
> but the
> > communication just seemed to stop midstream.  When I configured some
> > socket-related options on Solr (socket buffer sizes? but not really
> knowing
> > what I was doing) I could see that the communication with Solr was of a
> > different length - but it still stopped midstream (repeatedly the exact
> same
> > incomplete response length except when I modified the socket buffer
> sizes).
> >
> > Any ideas?  I'm going to start setting up a new box so long, something
> isn't
> > right with this machine... :/
> >
> > Except if its a weird configuration issue?
> >
> > Some salient thoughts:
> >
> > 1. I have setup port forwarding for MySql(5000) and nodes (1186).
>  Except for
> > more API nodes my setup is the quickstart setup discussed here:
> > http://downloads.mysql.com/tutorials/cluster/mysql_wp_cluster_quickstart
> > _linux.pdf
> > Are port forwarding for the specified ports sufficient?  Or might be
> there a
> > port I'm missing?
> >
> > 2. I'm using the Windows MySql Cluster distribution's lib folder as
> native
> > library location on the Windows machine.  Even though I'm communicating
> > with the Linux MySql Cluster distribution.  Believe this is okay, just
> > mentioning it here.
> >
> > I really believe there is something wrong with this machine, but here is
> my
> > persistence.xml:
> > (very rough)
> >
> > <?xml version="1.0"?>
> > <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> > version="2.0">
> >   <persistence-unit name="clusterdb" transaction-
> > type="RESOURCE_LOCAL">
> >
> >
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provi
> > der>
> >    
> <class>prod.d6.core.util.temp_dao.testobjects.TestDataBean</class>
> >     <properties>
> >       <property name="openjpa.BrokerFactory" value="ndb" />
> >       <property name="openjpa.ConnectionRetainMode" value="transaction"
> > />
> >    <property name="openjpa.jdbc.DBDictionary"
> > value="TableType=ndbcluster"
> > />
> >       <property name="openjpa.ndb.database" value="clusterdb" />
> >       <property name="openjpa.jdbc.SynchronizeMappings"
> > value="buildSchema"
> > />
> >             <property name="openjpa.Log" value="DefaultLevel=TRACE" />
> >     </properties>
> >   </persistence-unit>
> > </persistence>
> >
> > And I build an EntityManagerFactory as follows:
> > Properties properties = new Properties();
> > properties.put("openjpa.ConnectionDriverName",
> > com.mchange.v2.c3p0.ComboPooledDataSource.class.getName());
> > // Using port as specified in my.cnf
> > properties.put("openjpa.ConnectionProperties", "DriverClassName=" +
> > com.mysql.jdbc.Driver.class.getName()
> > +",jdbcUrl=jdbc:mysql://localhost:5000/clusterdb,characterEncoding=UTF8,
> > +useUnicode=true,user=root,password=,autocommit=false,idleConnectionT
> > est
> > +Period=60");
> > // Using port as specified in my.cnf
> > properties.put("openjpa.ConnectionURL",
> > "jdbc:mysql://localhost:5000/clusterdb");
> > properties.put("openjpa.ndb.connectString", "localhost:1186");
> > properties.put("openjpa.ConnectionUserName", "root");
> > properties.put("openjpa.ConnectionPassword", "");  emf =
> > Persistence.createEntityManagerFactory("clusterdb", properties);
> >
> > Any insights appreciated.
> >
> > Many thanks :)
>

Thread
ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit5 Jun
  • RE: ClusterJDatastoreException (possible obscure Windows error?)Andrew Morgan5 Jun
    • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit5 Jun
      • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit26 Jun
        • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit26 Jun
          • Re: ClusterJDatastoreException (possible obscure Windows error?)Craig L Russell26 Jun
            • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit26 Jun
              • Re: ClusterJDatastoreException (possible obscure Windows error?)Craig L Russell26 Jun
                • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit29 Jun
                  • Re: ClusterJDatastoreException (possible obscure Windows error?)Andrew Morgan29 Jun
                    • Re: ClusterJDatastoreException (possible obscure Windows error?)Johan Andersson29 Jun
                      • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit3 Jul