enter image description hereI'm learning to use taos JDBC in myBatis project, and when I using the demo provide by TDengine. I met this problem unable to establish connection.
sql:insert into db1.t1(ts,temperature) values (now,23.23)
The exception was thrown while calling on execute this sql command.
I tried to run the sql in command line on the server , it is ok.
while ran on my windows client it failed.
Running env
server: TDengine 2.1.3.2 on ubuntu 18.4
client: window x64
taos-jdbcdriver:2.0.32
loginfo
2021-07-22 16:00:48.116 DEBUG 16276 --- [ main] c.t.e.m.m.T.dropSuperTable : ==> Preparing: drop table if exists temperature
2021-07-22 16:00:48.130 DEBUG 16276 --- [ main] c.t.e.m.m.T.dropSuperTable : ==> Parameters:
2021-07-22 16:00:48.139 DEBUG 16276 --- [ main] c.t.e.m.m.T.dropSuperTable : <== Updates: 0
2021-07-22 16:00:48.140 DEBUG 16276 --- [ main] c.t.e.m.m.T.createSuperTable : ==> Preparing: CREATE TABLE if not exists temperature(ts timestamp, temperature float) tags(location nchar(64), tbIndex int)
2021-07-22 16:00:48.141 DEBUG 16276 --- [ main] c.t.e.m.m.T.createSuperTable : ==> Parameters:
2021-07-22 16:00:48.161 DEBUG 16276 --- [ main] c.t.e.m.m.T.createSuperTable : <== Updates: 0
2021-07-22 16:00:48.163 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.164 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t0(String), 杭州(String), 0(Integer)
2021-07-22 16:00:48.226 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.227 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.228 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t1(String), 深圳(String), 1(Integer)
2021-07-22 16:00:48.242 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.243 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.243 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t2(String), 上海(String), 2(Integer)
2021-07-22 16:00:48.265 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.266 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.266 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t3(String), 上海(String), 3(Integer)
2021-07-22 16:00:48.286 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.287 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.287 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t4(String), 深圳(String), 4(Integer)
2021-07-22 16:00:48.301 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.302 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.302 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t5(String), 北京(String), 5(Integer)
2021-07-22 16:00:48.323 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.324 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.324 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t6(String), 杭州(String), 6(Integer)
2021-07-22 16:00:48.339 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.340 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.341 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t7(String), 深圳(String), 7(Integer)
2021-07-22 16:00:48.360 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.361 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.361 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t8(String), 深圳(String), 8(Integer)
2021-07-22 16:00:48.375 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.376 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Preparing: create table ? using temperature tags( ?, ?)
2021-07-22 16:00:48.376 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : ==> Parameters: t9(String), 北京(String), 9(Integer)
2021-07-22 16:00:48.403 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.createTable : <== Updates: 0
2021-07-22 16:00:48.423 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.insertOne : ==> Preparing: insert into t0(ts, temperature) values(?, ?)
2021-07-22 16:00:48.423 DEBUG 16276 --- [ main] c.t.e.m.m.TemperatureMapper.insertOne : ==> Parameters: 2020-11-11 00:00:00.0(Timestamp), 3.1568499(Float)
2021-07-22 16:00:57.045 DEBUG 16276 --- [ main] c.t.e.m.m.T.dropSuperTable : ==> Preparing: drop table if exists temperature
2021-07-22 16:00:57.045 DEBUG 16276 --- [ main] c.t.e.m.m.T.dropSuperTable : ==> Parameters:
2021-07-22 16:00:57.071 DEBUG 16276 --- [ main] c.t.e.m.m.T.dropSuperTable : <== Updates: 0
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLException: TDengine ERROR (8000000b): Unable to establish connection
### The error may exist in com/taosdata/example/mybatisplusdemo/mapper/TemperatureMapper.java (best guess)
### The error may involve com.taosdata.example.mybatisplusdemo.mapper.TemperatureMapper.insertOne-Inline
### The error occurred while setting parameters
### SQL: insert into t0(ts, temperature) values(?, ?)
### Cause: java.sql.SQLException: TDengine ERROR (8000000b): Unable to establish connection
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
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:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
at com.sun.proxy.$Proxy63.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:58)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:62)
at com.sun.proxy.$Proxy78.insertOne(Unknown Source)
at com.taosdata.example.mybatisplusdemo.mapper.TemperatureMapperTest.before(TemperatureMapperTest.java:49)
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:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.sql.SQLException: TDengine ERROR (8000000b): Unable to establish connection
at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:73)
at com.taosdata.jdbc.TSDBJNIConnector.executeQuery(TSDBJNIConnector.java:123)
at com.taosdata.jdbc.TSDBStatement.execute(TSDBStatement.java:85)
at com.taosdata.jdbc.TSDBPreparedStatement.execute(TSDBPreparedStatement.java:266)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
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:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy89.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
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:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy88.update(Unknown Source)
at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doUpdate(MybatisSimpleExecutor.java:54)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
... 41 more
enter image description here
I have tried this demo on my pc. it worked correctly.
unable to establish connection
this exception is always cause by network problem. but from you log info, it seemed that you can access to the TDengine.It is hard to say what caused this.
I advise that you can open the debug flag, and try to figure out what going on there.
you follow these steps to debug you TDengine and read the debug log
which normally is very useful.
for windows
{TDengine_home}/cfg/tao.cfg
add "debugFlag 135", Then run your demo code again and read your client log on
{TDengine_home}/log/taoslog.*
find your sql and you can find the error
The exception logs show that the error happened during statement.execute. You should have successfully created a connection object (e.g., createConnection).
at com.taosdata.jdbc.TSDBStatement.execute(TSDBStatement.java:85)
Did you use IP instead of hostname in your URL? Please use hostname since Tdengine latest versions require hostname. It may fail silently during creating connection and cause some weird problems.
Some other causes may be here in Tdengine FAQ.
2. When encoutered with the error " Unable to establish connection ", what can I do?
I have Spring boot 2 applications, when I am firing a select query, before actual query runs one validation query "SELECT 1" is being called because of DB pool wants to validate if the pooled connection is alive or not,
"Select 1" is also taking long time, what can be done to improve performance, of course disabling "Select 1" validation is not a good idea
2019-10-01 20:54:43.352 DEBUG 15196 --- [nio-8081-exec-1] org.hibernate.SQL :
/* SELECT
MY Hibernate Query
2019-10-01 20:54:43.354 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:7 created by (ConnectionID:1 ClientConnectionId: 5494adca-2bef-4403-bcb6-713b676df4fd)
2019-10-01 20:54:43.354 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:7 Executing (not server cursor) SELECT 1
2019-10-01 20:54:43.612 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerResultSet : SQLServerResultSet:7 created by (SQLServerStatement:7)
2019-10-01 20:54:43.647 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerPreparedStatement:8 created by (ConnectionID:1 ClientConnectionId: 5494adca-2bef-4403-bcb6-713b676df4fd)
2019-10-01 20:54:43.740 TRACE 15196 --- [nio-8081-exec-1] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [US]
2019-10-01 20:54:43.766 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerPreparedStatement:8: calling sp_executesql: SQL:/* SELECT c.shippingZone.currency.isoName FROM Country c WHERE c.id = :countryCode */ select currency2_.ISO_NAME as col_0_0_ from TBL_COUNTRY country0_ left outer join TBL_SHIPPING_ZONE_COUNTRY country0_1_ on country0_.ID=country0_1_.COUNTRY_ID cross join TBL_SHIPPING_ZONES shippingzo1_ cross join TBL_CURRENCIES currency2_ where country0_1_.SHIPPING_ZONE_ID=shippingzo1_.ID and shippingzo1_.CURRENCY_ID=currency2_.ID and country0_.ID=#P0
2019-10-01 20:54:44.029 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerResultSet : SQLServerResultSet:8 created by (SQLServerPreparedStatement:8)
2019-10-01 20:54:44.043 DEBUG 15196 --- [nio-8081-exec-1] org.hibernate.loader.Loader : Result set row: 0
2019-10-01 20:54:44.044 DEBUG 15196 --- [nio-8081-exec-1] org.hibernate.loader.Loader : Result row:
When i try to set ddl auto to update, every time I run the application, it shows that hibernate tries to create the tables again. I am trying to add another column in the database using the entity
#Column(name = "xref_reason", length = 20)
private String xRefReason;
Shouldn't it creates this column only that I added?
Here is the error.
Hibernate: create table tbcodetable (id bigint identity not null, codename varchar(255), codevalue varchar(255), desc1 varchar(255), desc2 varchar(255), primary key (id))2018-06-26 16:23:09.342 WARN 4284 --- [ost-startStop-1] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: There is already an object named 'tbcodetable' in the database.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:258) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1535) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:845) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:752) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7151) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2478) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:219) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:199) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:729) ~[mssql-jdbc-6.2.2.jre8.jar:na]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95) ~[HikariCP-2.7.8.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-2.7.8.jar:na]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.2.14.Final.jar:5.2.14.Final]
... 119 common frames omitted
even the foreign keys has the same error.
application.yml
spring:
profiles:
active: dev
datasource:
url: jdbc:sqlserver://localhost;database=dbname
username: user
password: password
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
hikari:
minimum-idle: 1
maximum-pool-size: 10
pool-name: collectionPool
auto-commit: false
jpa:
show-sql: true
hibernate:
default_schema: dbo
ddl-auto: update
naming:
physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
I have a 500 error in solR with this query :
q=*&wt=json&rows=0&fq=date:[2014-01-01T09:15:57.000Z/SECOND TO *]&facet=true&facet.field=text&facet.limit=5
I noticed that if put the parameter "facet.limit" to less than 5 it works but otherwise it does not. Here is the stack from SolR :
msg : "Error from server at http://localhost:8983/solr/core_replica1: Exception during facet.field: text"
trace : "org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:
Error from server at http://localhost:8983/solr/core_replica1: Exception during facet.field: text\n\tat
Do you know why this kind of error would happen?
I use Solr 6.6.0.
The field that I request is a org.apache.solr.schema.TextField that is :
Indexed | Tokenized | Stored | TermVector Stored | Store Offset With TermVector | Store Position With TermVector for the properties and shema
Thanks!
EDIT : solr logs :
2018-03-29 15:26:24.137 INFO (qtp42121758-601) [c:core s:shard2 r:core_node1 x:core_shard2_replica1] o.a.s.c.S.Request [core_shard2_replica1]
webapp=/solr path=/select params={facet.field={!terms%3D$text__terms}text&distrib=false&qt=weblab_facet&fl=id,score&shards.purpose=32&text__terms=est&fq=date:
[2014-01-01T09:15:57.000Z/SECOND+TO+*]&shard.url=http://localhost:8983/solr/core_shard2_replica1/&rows=0&version=2&f.mainDate.facet.range.end=NOW/DAY&q=*&facet.limit=5&f.mainDate.facet.range.gap=%2B1DAY&
NOW=1522329984131&isShard=true&facet=true&f.mainDate.facet.range.start=NOW/DAY-5DAYS&wt=javabin&facet.sort=count} hits=5 status=500 QTime=0
2018-03-29 15:26:24.137 ERROR (qtp42121758-601) [c:core s:shard2 r:core_node1 x:core_shard2_replica1] o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: Exception during facet.field: text
at org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
And :
2018-03-29 15:26:24.137 ERROR (qtp42121758-601) [c:core s:shard2 r:core_node1 x:core_shard2_replica1]
o.a.s.h.RequestHandlerBase
org.apache.solr.common.SolrException: Exception during facet.field: text
at org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
Caused by: java.lang.NullPointerException
at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:683)
I m trying to integrate Cassandra 2.1.1 with SOLR, but SOLR failed to
create index with following error message.
16767 [qtp297774990-12] INFO org.apache.solr.handler.dataimport.DataImporter – Loading DIH Configuration: dataconfigCassandra.xml
16779 [qtp297774990-12] INFO org.apache.solr.handler.dataimport.DataImporter – Data Configuration loaded successfully
16788 [Thread-15] INFO org.apache.solr.handler.dataimport.DataImporter – Starting Full Import
16789 [qtp297774990-12] INFO org.apache.solr.core.SolrCore – [Entity_dev] webapp=/solr path=/dataimport params={optimize=false&indent=true&clean=true&commit=true&verbose=false&command=full-import&debug=false&wt=json} status=0 QTime=27
16810 [qtp297774990-12] INFO org.apache.solr.core.SolrCore – [Entity_dev] webapp=/solr path=/dataimport params={indent=true&command=status&_=1416042006354&wt=json} status=0 QTime=0
16831 [Thread-15] INFO org.apache.solr.handler.dataimport.SimplePropertiesWriter – Read dataimport.properties
16917 [Thread-15] INFO org.apache.solr.search.SolrIndexSearcher – Opening Searcher#6214b0dc[Entity_dev] realtime
16945 [Thread-15] INFO org.apache.solr.handler.dataimport.JdbcDataSource – Creating a connection for entity Entity with URL: jdbc:cassandra://10.234.31.153:9160/galaxy_dev
17082 [Thread-15] INFO org.apache.solr.handler.dataimport.JdbcDataSource – Time taken for getConnection(): 136
17429 [Thread-15] ERROR org.apache.solr.handler.dataimport.DocBuilder – Exception while processing: Entity document : SolrInputDocument(fields: []):org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: select * from entity Processing Document # 1
at
org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:283)
at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:240)
at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:44)
at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:59)
at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:73)
at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:476)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:415)
at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:330)
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:232)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:416)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:480)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:461)
Caused by: java.lang.NullPointerException
at org.apache.cassandra.cql.jdbc.ListMaker.compose(ListMaker.java:61)
at org.apache.cassandra.cql.jdbc.TypedColumn.<init>(TypedColumn.java:68)
at org.apache.cassandra.cql.jdbc.CassandraResultSet.createColumn(CassandraResultSet.java:1174)
at org.apache.cassandra.cql.jdbc.CassandraResultSet.populateColumns(CassandraResultSet.java:240)
at org.apache.cassandra.cql.jdbc.CassandraResultSet.<init>(CassandraResultSet.java:200)
at org.apache.cassandra.cql.jdbc.CassandraStatement.doExecute(CassandraStatement.java:169)
at org.apache.cassandra.cql.jdbc.CassandraStatement.execute(CassandraStatement.java:205)
at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:276)
... 12 more
CREATE TABLE dev.entity (
id uuid PRIMARY KEY,
begining int,
domain text,
domain_type text,
template_name text,
****field_values list<frozen<fieldmap>>****
)
User Defined Type :
CREATE TYPE galaxy_dev.fieldmap (
key text,
value text );
Please let me know what driver or Jar use to create SOLR index for latest CASSANDRA.