View Issue Details

IDProjectCategoryView StatusLast Update
0001814SymmetricDSBugpublic2014-07-29 16:50
ReporterErnstErnstAssigned Tochenson 
Prioritynormal 
Status closedResolutionfixed 
Product Version3.6.1 
Target Version3.6.3Fixed in Version3.6.3 
Summary0001814: NullPointerException in AbstractTriggerTemplate.createInitalLoadSql
DescriptionI get a NullPointerException when I try to replicate a change to a replicated database table (see more details in the 'Steps To Reproduce' section).
Steps To ReproduceThis issue can be reproduced by using the attached files and following these steps:

create a database sym-corp in the SQL Server 2008 R2
create a database sym-corp in the SQL Server 2008 R2
--> corp and store databases exist

..\bin\dbimport --engine corp-000 --format XML C:\Users\user.name\symmetricds\sym-corp\symmetric-3.6.1\samples\create_sample.xml
..\bin\symadmin --engine corp-000 create-sym-tables
..\bin\dbimport --engine corp-000 C:\Users\user.name\symmetricds\sym-corp\symmetric-3.6.1\samples\insert_sample.sql
--> corp node is set up

..\bin\sym --engine corp-000 --port 7070
--> corp node starts

..\bin\sym --engine store-001 --port 9090
--> store node starts

..\bin\symadmin --engine corp-000 open-registration store 001
--> the store node registers at the corp node

..\bin\symadmin reload-node 001
--> tables are created on the store node

execute sql "ALTER TABLE dbo.item ADD COMMENT varchar(16)" at the corp node
--> new column 'COMMENT' is added to the table

..\bin\symadmin sync-triggers
..\bin\symadmin send-schema --node 001 dbo.item
..\bin\symadmin reload-node 001
--> NullPointerException on corp node, no changes on store node
Additional Information2014-07-16 11:08:34,417 ERROR [corp-000] [DataExtractorService] [qtp1023040-20] Failed to extract batch 001-132
java.lang.NullPointerException
    at org.jumpmind.symmetric.db.AbstractTriggerTemplate.createInitalLoadSql(AbstractTriggerTemplate.java:134)
    at org.jumpmind.symmetric.db.AbstractSymmetricDialect.createInitialLoadSqlFor(AbstractSymmetricDialect.java:214)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource.startNewCursor(DataExtractorService.java:1571)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource.selectNext(DataExtractorService.java:1542)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource.next(DataExtractorService.java:1501)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromSymDataSource.next(DataExtractorService.java:1358)
    at org.jumpmind.symmetric.io.data.reader.ExtractDataReader.nextTable(ExtractDataReader.java:94)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:160)
    at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:115)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extractOutgoingBatch(DataExtractorService.java:703)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extract(DataExtractorService.java:513)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extract(DataExtractorService.java:422)
    at org.jumpmind.symmetric.web.PullUriHandler.pull(PullUriHandler.java:117)
    at org.jumpmind.symmetric.web.PullUriHandler.handleWithCompression(PullUriHandler.java:89)
    at org.jumpmind.symmetric.web.AbstractCompressionUriHandler.handle(AbstractCompressionUriHandler.java:84)
    at org.jumpmind.symmetric.web.SymmetricServlet.service(SymmetricServlet.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
    at org.eclipse.jetty.server.Server.handle(Server.java:348)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
    at java.lang.Thread.run(Thread.java:662)
TagsNo tags attached.

Activities

ErnstErnst

2014-07-16 06:02

reporter  

symmetric.upload.log (800,308 bytes)

ErnstErnst

2014-07-16 06:03

reporter  

symmetric.store.upload.log (545,619 bytes)

ErnstErnst

2014-07-16 06:04

reporter  

store-001.properties (2,900 bytes)

ErnstErnst

2014-07-16 06:04

reporter  

corp-000.properties (2,908 bytes)

ErnstErnst

2014-07-16 06:05

reporter   ~0000544

should be

create a database sym-corp in the SQL Server 2008 R2
create a database sym-store in the SQL Server 2008 R2
--> corp and store databases exist

instead of

create a database sym-corp in the SQL Server 2008 R2
create a database sym-corp in the SQL Server 2008 R2
--> corp and store databases exist

chenson

2014-07-16 08:50

administrator   ~0000545

Can you test the fix? I had trouble reproducing.

http://snapshots.repository.codehaus.org/org/jumpmind/symmetric/symmetric-assemble/3.6.3-SNAPSHOT/symmetric-assemble-3.6.3-20140716.121313-5-server.zip

ErnstErnst

2014-07-16 09:53

reporter   ~0000546

When I use symmetric-3.6.3-SNAPSHOT, then the exception is:

2014-07-16 15:49:57,855 ERROR [corp-000] [DataExtractorService] [qtp14372770-20] Failed to extract batch 001-20
org.jumpmind.symmetric.SymmetricException: The extracted row data did not have the expected (2) number of columns: "11000001","Yummy Gum"

    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource$1.mapRow(DataExtractorService.java:1598)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource$1.mapRow(DataExtractorService.java:1576)
    at org.jumpmind.db.sql.JdbcSqlReadCursor.next(JdbcSqlReadCursor.java:115)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource.selectNext(DataExtractorService.java:1550)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromTableSource.next(DataExtractorService.java:1501)
    at org.jumpmind.symmetric.service.impl.DataExtractorService$SelectFromSymDataSource.next(DataExtractorService.java:1358)
    at org.jumpmind.symmetric.io.data.reader.ExtractDataReader.nextTable(ExtractDataReader.java:99)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:160)
    at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:115)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extractOutgoingBatch(DataExtractorService.java:703)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extract(DataExtractorService.java:513)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extract(DataExtractorService.java:422)
    at org.jumpmind.symmetric.web.PullUriHandler.pull(PullUriHandler.java:117)
    at org.jumpmind.symmetric.web.PullUriHandler.handleWithCompression(PullUriHandler.java:89)
    at org.jumpmind.symmetric.web.AbstractCompressionUriHandler.handle(AbstractCompressionUriHandler.java:84)
    at org.jumpmind.symmetric.web.SymmetricServlet.service(SymmetricServlet.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
    at org.eclipse.jetty.server.Server.handle(Server.java:348)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
    at java.lang.Thread.run(Thread.java:662)

ErnstErnst

2014-07-16 09:54

reporter  

symmetric.corp.symmetric-3.6.3-SNAPSHOT.log (274,429 bytes)

ErnstErnst

2014-07-16 09:54

reporter  

symmetric.store.symmetric-3.6.3-SNAPSHOT.log (156,457 bytes)

chenson

2014-07-16 11:31

administrator   ~0000547

Thanks. I'll spend more time trying to reproduce.

chenson

2014-07-16 14:31

administrator   ~0000548

I can't reproduce this. It is like the physical database table has had the comment column removed as a last step.

chenson

2014-07-16 14:48

administrator   ~0000549

I was able to reproduce by dropping a column. I was not able to reproduce by adding a column.

chenson

2014-07-17 07:10

administrator   ~0000550

I just realized that this probably happens because you are running the sync triggers utility which runs outside the server. The table is cached and doesn't have the same number of columns as the most current trigger hist. That should be fixable.

chenson

2014-07-20 18:52

administrator   ~0000555

I added a check to re-read the table metadata from the database if the trigger hist column count is > than the cached metadata column count. I think that will solve this specific issue.

Related Changesets

SymmetricDS: master 836b7b37

2014-07-16 08:02:09

chenson

Details Diff
0001814: NullPointerException in AbstractTriggerTemplate.createInitalLoadSql
0001814
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/db/AbstractTriggerTemplate.java Diff File

SymmetricDS: master 3662a4e4

2014-07-20 18:51:02

chenson

Details Diff
0001814: NullPointerException in AbstractTriggerTemplate.createInitalLoadSql
0001814
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataExtractorService.java Diff File

Issue History

Date Modified Username Field Change
2014-07-16 06:02 ErnstErnst New Issue
2014-07-16 06:02 ErnstErnst File Added: symmetric.upload.log
2014-07-16 06:03 ErnstErnst File Added: symmetric.store.upload.log
2014-07-16 06:04 ErnstErnst File Added: store-001.properties
2014-07-16 06:04 ErnstErnst File Added: corp-000.properties
2014-07-16 06:05 ErnstErnst Note Added: 0000544
2014-07-16 08:05 chenson Target Version => 3.6.3
2014-07-16 08:05 chenson Assigned To => chenson
2014-07-16 08:05 chenson Status new => assigned
2014-07-16 08:50 chenson Note Added: 0000545
2014-07-16 09:00 chenson Changeset attached => SymmetricDS trunk r8479
2014-07-16 09:53 ErnstErnst Note Added: 0000546
2014-07-16 09:54 ErnstErnst File Added: symmetric.corp.symmetric-3.6.3-SNAPSHOT.log
2014-07-16 09:54 ErnstErnst File Added: symmetric.store.symmetric-3.6.3-SNAPSHOT.log
2014-07-16 11:31 chenson Note Added: 0000547
2014-07-16 14:31 chenson Note Added: 0000548
2014-07-16 14:48 chenson Note Added: 0000549
2014-07-17 07:10 chenson Note Added: 0000550
2014-07-20 18:52 chenson Note Added: 0000555
2014-07-20 18:52 chenson Status assigned => resolved
2014-07-20 18:52 chenson Fixed in Version => 3.6.3
2014-07-20 18:52 chenson Resolution open => fixed
2014-07-20 19:00 chenson Changeset attached => SymmetricDS trunk r8487
2014-07-29 16:50 chenson Status resolved => closed
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master 3662a4e4
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master 836b7b37