创建继承映射hhh000388:unsuccessful:create table questionnaire design错误在哪

1. Hibernate
Map集合映射属性,创建表失败或表不存在
发布时间: 18:38:37
八月 22, :39 下午 org.mon.Version &clinit&INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}八月 22, :39 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {4.2.15.Final}八月 22, :39 下午 org.hibernate.cfg.Environment &clinit&INFO: HHH000206: hibernate.properties not found八月 22, :39 下午 org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassist八月 22, :39 下午 org.hibernate.cfg.Configuration configureINFO: HHH000043: Configuring from resource: /hibernate.cfg.xml八月 22, :39 下午 org.hibernate.cfg.Configuration getConfigurationInputStreamINFO: HHH000040: Configuration resource: /hibernate.cfg.xml八月 22, :39 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntityWARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!八月 22, :39 下午 org.hibernate.cfg.Configuration addResourceINFO: HHH000221: Reading mappings from resource: org/crazyit/app/domain/Person.hbm.xml八月 22, :39 下午 org.hibernate.cfg.Configuration doConfigureINFO: HHH000041: Configured SessionFactory: null八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureWARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000115: Hibernate connection pool size: 20八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000006: Autocommit mode: false八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost/hibernate]八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000046: Connection properties: {user=root, password=****}八月 22, :39 下午 org.hibernate.dialect.Dialect &init&INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect八月 22, :39 下午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreationINFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4八月 22, :39 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateServiceINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)八月 22, :39 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &init&INFO: HHH000397: Using ASTQueryTranslatorFactory八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000228: Running hbm2ddl schema update八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000102: Fetching database metadata八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000396: Updating schema八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: person_inf八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: score八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: person_inf八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: score八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: person_inf八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: score八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: HHH000388: Unsuccessful: create table score (person_id integer not null, grade float, subject varchar(255) not null, primary key (person_id, subject))八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: Specif max key length is 767 bytes八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: HHH000388: Unsuccessful: alter table score add index FK_337iubgcdgwrfqpvg418dt5u5 (person_id), add constraint FK_337iubgcdgwrfqpvg418dt5u5 foreign key (person_id) references person_inf (person_id)八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: Table 'hibernate.score' doesn't exist八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000232: Schema update completeHibernate: insert into person_inf (name, age) values (?, ?)Hibernate: insert into score (person_id, subject, grade) values (?, ?, ?)八月 22, :40 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsWARN: SQL Error: 1146, SQLState: 42S02八月 22, :40 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsERROR: Table 'hibernate.score' doesn't exist八月 22, :40 下午 org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl releaseINFO: HHH000010: On release of batch it still contained JDBC statementsException in thread "main" org.hibernate.exception.SQLGrammarException: could not execute statement at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1256) at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:58) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:309) at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) at org.hibernate.engine.transaction.mit(AbstractTransactionImpl.java:175) at lee.PersonManager.createAndStorePerson(PersonManager.java:43) at lee.PersonManager.main(PersonManager.java:21)Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.score' doesn't exist 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 com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186) ... 14 more
l& 原因:创建表的时候把primary key (person_id, subject)作为主键,而subject字段太长不适合做主键,所以创建不了表。
l& 解决方法:修改字段的长度,把该字段改小。
来源:/wang89826/p/3930177.html八月 22, :39 下午 org.mon.Version &clinit&INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}八月 22, :39 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {4.2.15.Final}八月 22, :39 下午 org.hibernate.cfg.Environment &clinit&INFO: HHH000206: hibernate.properties not found八月 22, :39 下午 org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassist八月 22, :39 下午 org.hibernate.cfg.Configuration configureINFO: HHH000043: Configuring from resource: /hibernate.cfg.xml八月 22, :39 下午 org.hibernate.cfg.Configuration getConfigurationInputStreamINFO: HHH000040: Configuration resource: /hibernate.cfg.xml八月 22, :39 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntityWARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!八月 22, :39 下午 org.hibernate.cfg.Configuration addResourceINFO: HHH000221: Reading mappings from resource: org/crazyit/app/domain/Person.hbm.xml八月 22, :39 下午 org.hibernate.cfg.Configuration doConfigureINFO: HHH000041: Configured SessionFactory: null八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureWARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000115: Hibernate connection pool size: 20八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000006: Autocommit mode: false八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost/hibernate]八月 22, :39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000046: Connection properties: {user=root, password=****}八月 22, :39 下午 org.hibernate.dialect.Dialect &init&INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect八月 22, :39 下午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreationINFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4八月 22, :39 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateServiceINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)八月 22, :39 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &init&INFO: HHH000397: Using ASTQueryTranslatorFactory八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000228: Running hbm2ddl schema update八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000102: Fetching database metadata八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000396: Updating schema八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: person_inf八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: score八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: person_inf八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: score八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: person_inf八月 22, :40 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadataINFO: HHH000262: Table not found: score八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: HHH000388: Unsuccessful: create table score (person_id integer not null, grade float, subject varchar(255) not null, primary key (person_id, subject))八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: Specif max key length is 767 bytes八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: HHH000388: Unsuccessful: alter table score add index FK_337iubgcdgwrfqpvg418dt5u5 (person_id), add constraint FK_337iubgcdgwrfqpvg418dt5u5 foreign key (person_id) references person_inf (person_id)八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: Table 'hibernate.score' doesn't exist八月 22, :40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate executeINFO: HHH000232: Schema update completeHibernate: insert into person_inf (name, age) values (?, ?)Hibernate: insert into score (person_id, subject, grade) values (?, ?, ?)八月 22, :40 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsWARN: SQL Error: 1146, SQLState: 42S02八月 22, :40 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsERROR: Table 'hibernate.score' doesn't exist八月 22, :40 下午 org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl releaseINFO: HHH000010: On release of batch it still contained JDBC statementsException in thread "main" org.hibernate.exception.SQLGrammarException: could not execute statement at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1256) at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:58) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:309) at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) at org.hibernate.engine.transaction.mit(AbstractTransactionImpl.java:175) at lee.PersonManager.createAndStorePerson(PersonManager.java:43) at lee.PersonManager.main(PersonManager.java:21)Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.score' doesn't exist 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 com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186) ... 14 more
l& 原因:创建表的时候把primary key (person_id, subject)作为主键,而subject字段太长不适合做主键,所以创建不了表。
l& 解决方法:修改字段的长度,把该字段改小。
阅读(...) 评论()<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&NAL_extract函数中处置h264数据//处理到那算一帧数据呢_struts2.3.4+hibernate4.18+spring3.2
自动创办外键关联失败,创建序列失败_Win7+Ubuntu11.10(EasyBCD硬盘装配)__脚本百事通
稍等,加载中……
^_^请注意,有可能下面的2篇文章才是您想要的内容:
NAL_extract函数中处置h264数据//处理到那算一帧数据呢
struts2.3.4+hibernate4.18+spring3.2
自动创办外键关联失败,创建序列失败
Win7+Ubuntu11.10(EasyBCD硬盘装配)
NAL_extract函数中处置h264数据//处理到那算一帧数据呢
NAL_extract函数中处理h264数据//处理到那算一帧数据呢?
//Extract the NAL data from the mdat box mdat
int WvH264DataExtract::NAL_extract(BYTE * buf, int index, int mdat_size)
int nal_size = 0;
int mdat_size_count = 8;
while (mdat_size_count & mdat_size)
WriteBuffers((BYTE*)hex_SCP, 4);
nal_size = GetSize(buf + index, 4);
WriteBuffers(buf + index + 4, nal_size);
mdat_size_count += nal_size + 4;
index += nal_size + 4;
//Extract the NAL data from the H.264 video data acquired from the camera
UINT WvH264DataExtract::ExtractData()
int read_size = 0;
int buf_size = 0;
int bufBack_size = 0;
BYTE * buf = NULL;
BYTE * bufBack = NULL;
int mdat_size = 0;
bool SPSPPSfound =
UINT ret = 0;
printf("H.264 data extracting.");
while (stop == false)
read_size = 0;
buf_size = H264BUFFERSIZE;
buf = (BYTE*)malloc(buf_size);
if (bufBack_size & 0)
memcpy(buf, bufBack, bufBack_size);
free(bufBack);
bufBack = NULL;
if (GetBuffers(buf + bufBack_size, buf_size - bufBack_size) == 0)
bufBack_size = 0;
if(SPSPPSfound == false)
//Extract the SPS and PPS hearders from the avcC box
for (i = 0; i &= buf_size - 4; i++)
if (buf[i] == hex_avcC[0] &&
buf[i + 1] == hex_avcC[1] &&
buf[i + 2] == hex_avcC[2] &&
buf[i + 3] == hex_avcC[3])
if ((read_size = SPSPPS_extract(buf, i - 4)) == -1)
goto EXIT;
SPSPPSfound =
//Search the mdat box and acquire the data size
for (i = read_ i &= buf_size - 4; i++)
if (buf[i] == hex_mdat[0] &&
buf[i + 1] == hex_mdat[1] &&
buf[i + 2] == hex_mdat[2] &&
buf[i + 3] == hex_mdat[3])
mdat_size = GetSize(buf + i - 4, 4);
read_size = i + 4;
if (i & buf_size - 4)
bufBack_size = 4;
bufBack = (BYTE*)malloc(bufBack_size);
memcpy(bufBack, buf + (buf_size - 4), bufBack_size);
//Acquire the data as much as the mdat box size from the buffer
if (buf_size - read_size &= mdat_size)
if (buf_size - read_size == mdat_size)
bufBack_size = 0;
bufBack_size = buf_size - (read_size + mdat_size);
bufBack = (BYTE*)malloc(bufBack_size);
memcpy(bufBack, buf + read_size + mdat_size, bufBack_size);
bufBack_size = buf_size - read_
memmove(buf, buf + read_size, bufBack_size);
buf_size = mdat_
bufBack = (BYTE*)realloc(buf, buf_size);
buf = bufB
bufBack = NULL;
if(GetBuffers(buf + bufBack_size, buf_size - bufBack_size) == 0)
read_size = 0;
bufBack_size = 0;
//Extract the NAL data from the mdat box
read_size = NAL_extract(buf, read_size, mdat_size);
free(buf);
buf = NULL;
printf(".");
printf("\n");
printf("H.264 data extracted.\n");
free(buf);
buf = NULL;
if (bufBack)
free(bufBack);
bufBack = NULL;
#define SEARCH_SPSPPS 0
#define WRITE_SPS 1
#define WRITE_PPS 2
const BYTE hex_avcC[4] = {0x61, 0x76, 0x63, 0x43};
const BYTE hex_mdat[4] = {0x6D, 0x64, 0x61, 0x74};
const BYTE hex_SCP[4] = {0x00, 0x00, 0x00, 0x01};
WvH264DataExtract::WvH264DataExtract(void)
this-&stop =
this-&mp4Buffer = NULL;
this-&h264Buffer = NULL;
this-&keyMP4 = NULL;
this-&keyH264 = NULL;
this-&thread = NULL;
WvH264DataExtract::~WvH264DataExtract(void)
this-&mp4Buffer = NULL;
this-&h264Buffer = NULL;
this-&keyMP4 = NULL;
this-&keyH264 = NULL;
this-&thread = NULL;
static size_t hex2dec(char * hex)
size_t num = 0;
for (i = 0; ; i++)
if (hex[i] &= '0' && hex[i] &= '9')
buf = hex[i] - '0';
else if (hex[i] &= 'a' && hex[i] &= 'f')
buf = hex[i] - 'a' + 10;
else if (hex[i] &= 'A' && hex[i] &= 'F')
buf = hex[i] - 'A' + 10;
else if (hex[i] == '\0')
num = 0xFFFFFFFF;
num *= 16;
if (i &= 8)
//Overflow
num = 0xFFFFFFFF;
return(num);
static int GetSize(BYTE * buf, int size)
int data_size = 0;
BYTE size_hex_buf[4];
char size_hex[10];
char format[20] = "";
if (size & 4)
for (i = 0; i & i++)
size_hex_buf[i] = buf[i];
strcat(format, "%02x");
sprintf(size_hex, format, size_hex_buf[0], size_hex_buf[1],
size_hex_buf[2], size_hex_buf[3]);
data_size = hex2dec(size_hex);
return data_
//Write the 1-byte data into the buffer
void WvH264DataExtract::WriteBuffer(BYTE buf)
this-&keyH264-&Lock();
this-&h264Buffer-&push_back(buf);
this-&keyH264-&Unlock();
//Write the data as much as the specified size into the buffer
void WvH264DataExtract::WriteBuffers(BYTE * buf, int size)
if (size & 0)
this-&keyH264-&Lock();
this-&h264Buffer-&insert(h264Buffer-&end(), buf, buf + size);
this-&keyH264-&Unlock();
//Read the data as much as the specified size from the buffer
int WvH264DataExtract::GetBuffers(BYTE * buf, int size)
if (size & 0)
while (stop == false)
if (mp4Buffer-&empty() == false && (int)mp4Buffer-&size() & size)
keyMP4-&Lock();
for (i = 0; i & i++)
buf[i] = (BYTE)mp4Buffer-&front();
mp4Buffer-&pop_front();
keyMP4-&Unlock();
::Sleep(1);
//Extract the SPS and PPS headers from the avcC box
int WvH264DataExtract::SPSPPS_extract(BYTE * buf, int index)
bool SPSflg =
bool PPSflg =
int cnt = 0;
int condition = SEARCH_SPSPPS;
int avcC_size = 0;
int SPSPPS_size = 0;
avcC_size = GetSize(buf + index, 4);
for (i = 4; i & avcC_ i++)
dat = buf[index + i];
switch (condition)
case SEARCH_SPSPPS:
if (dat == 0x67)
WriteBuffers((BYTE*)hex_SCP, 4);
SPSPPS_size = GetSize(buf + (index + i - 2), 2);
condition = WRITE_SPS;
else if (dat == 0x68)
WriteBuffers((BYTE*)hex_SCP, 4);
SPSPPS_size = GetSize(buf + (index + i - 2), 2);
condition = WRITE_PPS;
case WRITE_SPS:
WriteBuffer(dat);
if (cnt &= SPSPPS_size)
condition = SEARCH_SPSPPS;
case WRITE_PPS:
WriteBuffer(dat);
if (cnt &= SPSPPS_size)
condition = SEARCH_SPSPPS;
printf("error : writing SPS or PPS\n");
return -1;
if(!SPSflg | !PPSflg)
printf("error : not found SPS or PPS\n");
return -1;
return index +
------解决方案--------------------都没用过stl。 WriteBuffer 只调用了一次?应该是把一个sps,pps信息写到最前面的一个buf, sps,pps里可以获得视频图像长,宽等信息。
WriteBuffers(多个s) 写进去的应该就是一帧。
我说说我的理解,但不一定对。 解码器找i帧, 是先查找 sps 就是搜索 0x00 00 01 ?? 然后搜索pps 0x00 00 01 ?? 在后I 0x00 00 01 ??. (0x00 00 01 ?? 是起始的标记)
你的结构是0x00 00 00 01(多个 00 都行), 对原始I帧的处理应该是加了个包头,包头有个标记字段hex_mdat[4] = {0x6D, 0x64, 0x61, 0x74},可以通过它得到这帧数据的大小。 然后把0x00 00 00 01替换成nal它记录了这个0x00 00 00 01后面数据的长度。
struts2.3.4+hibernate4.18+spring3.2
自动创办外键关联失败,创建序列失败
struts2.3.4+hibernate4.18+spring3.2
自动创建外键关联失败,创建序列失败!用 struts2.3.4+hibernate4.18+spring3.2 框架写一个web小程序,实体类用的jpa注解。
在让hibernate自动创建表时总是提示无法添加外键,并且无法创建用于生成id的sequence。
本该创建序列seq_6bit ,它却发出create table seq_6bit ( next_val bigint );insert into seq_6bit values ( 100000 )的语句!
这个程序在只用hibernate4.18时是能够自动创建相关表,建立关联关系,创建序列等。
为什么添加其他两个框架后,就不行了呢!
我用的数据库是oracle10g。
具体错误提示如下:
17:33:15,005 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Admin add index FK3CC2 (userId), add constraint FK3CC2 foreign key (userId) references users (userId)
17:33:15,097 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Admin add index FK3CC2 (userId), add constraint FK3CC2 foreign key (userId) references users (userId)
17:33:15,098 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,099 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Course_Teacher add index FK2FDB6BBE2921AA00 (tid), add constraint FK2FDB6BBE2921AA00 foreign key (tid) references Teacher (tId)
17:33:15,102 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Course_Teacher add index FK2FDB6BBE2921AA00 (tid), add constraint FK2FDB6BBE2921AA00 foreign key (tid) references Teacher (tId)
17:33:15,103 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,104 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Course_Teacher add index FK2FDB6BBED464D56A (cid), add constraint FK2FDB6BBED464D56A foreign key (cid) references Course (cId)
17:33:15,109 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Course_Teacher add index FK2FDB6BBED464D56A (cid), add constraint FK2FDB6BBED464D56A foreign key (cid) references Course (cId)
17:33:15,109 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,110 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Score add index FK4C04E72EEE5C98 (sId), add constraint FK4C04E72EEE5C98 foreign key (sId) references Student (sId)
17:33:15,113 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Score add index FK4C04E72EEE5C98 (sId), add constraint FK4C04E72EEE5C98 foreign key (sId) references Student (sId)
17:33:15,113 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,114 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Score add index FK4C04E72D464D56A (cId), add constraint FK4C04E72D464D56A foreign key (cId) references Course (cId)
17:33:15,117 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Score add index FK4C04E72D464D56A (cId), add constraint FK4C04E72D464D56A foreign key (cId) references Course (cId)
17:33:15,118 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,119 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Student add index FKF882C2 (userId), add constraint FKF882C2 foreign key (userId) references users (userId)
17:33:15,121 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Student add index FKF882C2 (userId), add constraint FKF882C2 foreign key (userId) references users (userId)
17:33:15,121 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,122 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table Teacher add index FKD6A63C2A38882C2 (userId), add constraint FKD6A63C2A38882C2 foreign key (userId) references users (userId)
17:33:15,123 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table Teacher add index FKD6A63C2A38882C2 (userId), add constraint FKD6A63C2A38882C2 foreign key (userId) references users (userId)
17:33:15,124 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,124 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - alter table users add index FK6A68E08C2A0A140 (qxNo), add constraint FK6A68E08C2A0A140 foreign key (qxNo) references QX (qxNo)
17:33:15,148 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: alter table users add index FK6A68E08C2A0A140 (qxNo), add constraint FK6A68E08C2A0A140 foreign key (qxNo) references QX (qxNo)
17:33:15,148 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00904: : 标识符无效
17:33:15,149 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - create table seq_6bit ( next_val bigint )
17:33:15,242 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: create table seq_6bit ( next_val bigint )
17:33:15,242 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00902: 无效数据类型
17:33:15,243 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - insert into seq_6bit values ( 100000 )
17:33:15,245 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: insert into seq_6bit values ( 100000 )
17:33:15,246 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00942: 表或视图不存在
17:33:15,246 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - create table seq_7bit ( next_val bigint )
17:33:15,249 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: create table seq_7bit ( next_val bigint )
17:33:15,250 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00902: 无效数据类型
17:33:15,250 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - insert into seq_7bit values ( 2013000 )
17:33:15,252 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: insert into seq_7bit values ( 2013000 )
17:33:15,253 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00942: 表或视图不存在
17:33:15,253 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - create table seq_8bit ( next_val bigint )
17:33:15,255 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: create table seq_8bit ( next_val bigint )
17:33:15,256 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00902: 无效数据类型
17:33:15,256 DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate:226 - insert into seq_8bit values (
17:33:15,266 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: insert into seq_8bit values (
17:33:15,266 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - ORA-00942: 表或视图不存在
17:33:15,267
INFO org.hibernate.tool.hbm2ddl.SchemaUpdate:240 - HHH000232: Schema update complete
我的主要程序代码:
@SequenceGenerator(name="tidSeq", sequenceName="seq_7bit",initialValue=2013000,allocationSize=1)
public class Teacher
private int tId;
private List&Course& courses = new ArrayList&Course&();
@ManyToMany(mappedBy="teachers",fetch=FetchType.EAGER, cascade={CascadeType.PERSIST,CascadeType.MERGE})
public List&Course& getCourses()
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="tidSeq")
public int gettId()
return tId;
@SequenceGenerator(name = "cidSeq", sequenceName = "seq_8bit", initialValue = , allocationSize = 1)
public class Course
private int cId;
private List&Teacher& teachers = new ArrayList&Teacher&();
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "cidSeq")
public int getcId()
return cId;
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER)
@JoinTable(joinColumns = { @JoinColumn(name = "cid") }, inverseJoinColumns = { @JoinColumn(name = "tid") })
@Fetch(FetchMode.SUBSELECT)
public List&Teacher& getTeachers()
applicationContext.xml:
&bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&
&property name="dataSource" ref="dataSource" /&
&property name="annotatedClasses"&
&value&com.soft103.oracletask.entity.Admin&/value&
&value&com.soft103.oracletask.entity.User&/value&
&value&com.soft103.oracletask.entity.QX&/value&
&value&com.soft103.oracletask.entity.Course&/value&
&value&com.soft103.oracletask.entity.Log&/value&
&value&com.soft103.oracletask.entity.Score&/value&
&value&com.soft103.oracletask.entity.Student&/value&
&value&com.soft103.oracletask.entity.Teacher&/value&
&/property&
&property name="hibernateProperties"&
&prop key="hibernate.dialect"&org.hibernate.dialect.MySQLDialect&/prop&
&prop key="hibernate.show_sql"&true&/prop&
&prop key="hibernate.format_sql"&true&/prop&
&prop key="hibernate.id.new_generator_mappings"&true&/prop&
&prop key="hibernate.hbm2ddl.auto"&update&/prop&
&prop key="cache.use_query_cache"&false&/prop&
&prop key="cache.use_second_level_cache"&true&/prop&
&prop key="cache.region.factory_class"&org.hibernate.cache.EhCacheRegionFactory&/prop&
&/property&
------解决方案--------------------你用oracle的数据库,居然敢用mysql的方言,把配置&prop key="hibernate.dialect"&org.hibernate.dialect.MySQLDialect&/prop&改成oracle10G的方言就行了
Win7+Ubuntu11.10(EasyBCD硬盘装配)
Win7+Ubuntu11.10(EasyBCD硬盘安装)
1)首先还是分区,在计算机上右键--管理--磁盘管理
装Ubuntu分配的硬盘大小最好是(20G以上)不要太小,这里请注意,ubuntu和windows文件系统完全不同,所以我们划好要给ubuntu的分区后,删除卷。到时候,安装好的ubuntu的分区,在windows下是看不到的,但是进入ubuntu是可以访问windows的磁盘的。这才叫双系统的吧,和wubi那种不一样哦。
2)准备两个东西EasyBCD软件和iso镜像(我用的easybcd是2.1版,就下载1.7之后版就行,要那种安装版的,不要绿色版)
下面打开EasyBCD软件,可以看到现在我们的计算机只有一个启动“入口”,
我们来给他加一个,选择Add Entries(添加移动入口点),
选NeoGrub 然后点Install NeoGrub点Save ,接着是Configure,
然后就会出现一个menu.lst文件
我们要编辑这个文件 因为系统就是这个文件找到我们的ubuntu的。
把下面的 英文 复制进去,把原来的全覆盖掉
title Install Ubunturoot (hd0,0)kernel (hd0,0)/vmlinuz boot=casper iso-scan/filename=/ubuntu-11.10-i386.iso ro quiet splash locale=zh_CN.UTF-8initrd (hd0,0)/initrd.lz
ubuntu-11.10-i386.iso是你的iso的名字,别写成我的了,这个要改成你的。
对于有的电脑上你的第一个盘符并不是C盘,在磁盘管理中可以看出,所以安装时需将(hd0,0)改为(hd0,1)【假设为第二个】。
关闭 保存。
接下来:把准备好的iso用压缩软件或者虚拟光驱打开,找到casper文件夹,复制initrd.lz和vmlinuz到C盘,然后在把iso也拷贝到C盘。
重启 你就会看到有2个 启动菜单给你选择 我们选择第2个 NeoGrub 这个
然后等待一段时间 就会见到我们 日思夜想的 ubuntu了。
默认 桌面有2个文档 一个是演示的不用管 我们选择 安装Ubuntu ,
记得在这之前 要按Ctrl+Alt+T 打开终端,输入代码:sudo umount -l /isodevice这一命令取消掉对光盘所在 驱动 器的挂载,否则分区界面找不到分区。
开始安装,
选语言不用说,
选安装类型,我们用自定义。
挂在分区的方案如下(以30G为例):
ext4(根分区可以大点)
8G ext4(剩下的给/home)
(1)在选择安装启动引导器的设备时,可以选择我们分好的 / 区,也可以新建一个/boot区。
(2)若重启就会发现原来 windows进不去了。
打开终端输入命令
sudo gedit /etc/default/grub
修改GRUB_TIMEOUT="10"
然后在终端中输入sudo update-grub
update 命令会自动找到 windows 7 启动项。并且自动更新 /boot/grub/grub.cfg 文件。这样重启就能进windows了。
最后进入Window7,打开EasyBCD删除安装时改的menu.lst文件,按Remove即可。
然后去我们的c盘 删除vmlinuz,initrd.lz和系统的iso文件。
利用EasyBCD可以更改启动项菜单按Edit Boot Menu按钮,可以选择将Windows7设为默认开机选项。
如果您想提高自己的技术水平,欢迎加入本站官方1号QQ群:&&,&&2号QQ群:,在群里结识技术精英和交流技术^_^
本站联系邮箱:

我要回帖

更多关于 questionnaire 模板 的文章

 

随机推荐