有没有人成功配置JDO datanucleus默认谷歌应用程序引擎在本地数据库上工作?
当我指定了值为"rdbms"的属性"datanucleus.storeManagerType"时,为什么我总是在jdoconfig.xml中收到错误.在最后部分.
我试过谷歌搜索但似乎没有运气.
引起:org.datanucleus.exceptions.NucleusUserException:没有类型为"rdbms"的可用StoreManager.请确保您已正确指定"datanucleus.storeManagerType"并且所有相关插件都在CLASSPATH中
<persistence-manager-factory name="postgresql">
<property name="datanucleus.mapping.Schema" value="jdo"/>
<property name="javax.jdo.PersistenceManagerFactoryClass" value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
<property name="datanucleus.ConnectionDriverName" value="org.postgresql.Driver"/>
<property name="datanucleus.ConnectionURL" value="jdbc:postgresql://localhost:5432/jdo"/>
<property name="datanucleus.ConnectionUserName" value="jdo"/>
<property name="datanucleus.ConnectionPassword" value="jdo"/>
<property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
<property name="datanucleus.autoStartMechanism" value="None"/>
<property name="datanucleus.autoCreateSchema" value="true"/>
<property name="datanucleus.validateTables" value="true"/>
<property name="datanucleus.validateConstraints" value="true"/>
<property name="datanucleus.validateColumns" value="true"/>
<property name="datanucleus.DetachAllOnCommit" value="true"/>
<property name="datanucleus.maxFetchDepth" value="1"/>
<property name="datanucleus.storeManagerType" value="rdbms"/>
Run Code Online (Sandbox Code Playgroud)
PMF.java的代码
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("postgresql");
Run Code Online (Sandbox Code Playgroud) 我正在使用App Engine的JDO实现的本地开发版本.当我查询包含其他对象作为嵌入字段的对象时,嵌入字段将返回null.
例如,假设这是我坚持的主要对象:
@PersistenceCapable
public class Branch {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
private String name;
@Persistent
private Address address;
...
}
Run Code Online (Sandbox Code Playgroud)
这是我的嵌入对象:
@PersistenceCapable(embeddedOnly="true")
public class Address {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
private String street;
@Persistent
private String city;
...
}
Run Code Online (Sandbox Code Playgroud)
以下代码不检索嵌入对象:
PersistenceManager pm = MyPersistenceManagerFactory.get().getPersistenceManager();
Branch branch = null;
try {
branch = pm.getObjectById(Branch.class, branchId);
}
catch (JDOObjectNotFoundException onfe) {
// not found
}
catch (Exception e) {
// failed
}
finally …Run Code Online (Sandbox Code Playgroud) 我很难让Datanucleus 2在Eclipse中使用Datanucleus插件增强GAE 1.7.0上的类来正常工作.当我按照这里的手动步骤操作时,这在旧版GAE中运行良好:
http://www.datanucleus.org/products/accessplatform/guides/eclipse/index.html
但是自从升级以来,GAE现在包含了这些库(它们的新版本看起来像),并且GAE还有一个可以设置的新"增强器"标志.我无论如何都无法在Eclipse中设置此标志.当我想要V2库并且Datanucleus根据此错误发生冲突时,GAE似乎仍然包含v1库:
Jul 1, 2012 5:59:55 PM org.datanucleus.enhancer.DataNucleusEnhancer <init>
INFO: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JPA"
Exception in thread "main" java.lang.NoSuchFieldError: NUCLEUS_CONTEXT_LOADER
at org.datanucleus.NucleusContext.<clinit>(NucleusContext.java:73)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:171)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1265)
Run Code Online (Sandbox Code Playgroud)
我尝试了很多不同的东西.我尝试过使用所有默认设置.我已经尝试将v2库添加到Datanucleus运行时类路径条目.我试过在src和libs中删除GAE 1.7.0 SDK中的v1库.但不知怎的,GAE仍在继续(或者试图超越V1库.我甚至尝试过手动设置配置的旧方法,如上面链接所指定的.这有点令人沮丧,因为我现在好像在我根本无法使用这些库的情况下.至少在旧版本的GAE中我可以手动设置它起作用.现在似乎什么都没有用.有什么建议吗?
我在使用eclipse的Windows XP和用于gwt + gae app的datanucleus增强器.当我运行增强器时,我收到一个错误:
Error
Thu Oct 21 16:33:57 CDT 2010
Cannot run program "C:\Program Files\Java\jdk1.6.0_18\bin\javaw.exe" (in directory "C:\ag\dev"): CreateProcess error=87, The parameter is incorrect
java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_18\bin\javaw.exe" (in directory "C:\ag\dev"): CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessBuilder.start(Unknown Source)
at com.google.gdt.eclipse.core.ProcessUtilities.launchProcessAndActivateOnError(ProcessUtilities.java:213)
at com.google.appengine.eclipse.core.orm.enhancement.EnhancerJob.runInWorkspace(EnhancerJob.java:154)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more
Run Code Online (Sandbox Code Playgroud)
我之前遇到过这个问题,这是由于一个很长的类路径.我花了一个半小时缩短了我的类路径,移动了库,甚至移动了我的eclipse安装,但没有运气.
关于我应该从哪里开始寻找答案的任何想法?错误消息不包含有关其所在目录或任何目录的任何信息.这有点令人气愤!是否有可能使javaw的输出更详细?有可能绕过这个类路径大小的bug吗?
我收到了这个错误
The command line is too long.
mvn install
Standard error from the DataNucleus tool org.datanucleus.enhancer.DataNucleusEnhancer
The command line is too long.
Run Code Online (Sandbox Code Playgroud) logging.properties我的Java AppEngine项目(使用java.util.logging)中有一个文件,如下所示:
# Set the default logging level for all loggers to WARNING
.level = INFO
# tighten logging on the DataNucleus Categories
DataNucleus.JDO.level=WARN
# - All messages general to JDO
DataNucleus.JPA.level=WARN
# - All messages general to JPA
DataNucleus.Persistence.level=WARN
# - All messages relating to the persistence process
DataNucleus.Query.level=WARN
# - All messages relating to queries
DataNucleus.Lifecycle.level=WARN
# - All messages relating to object lifecycle changes
DataNucleus.Cache.level=WARN
# - All messages relating to the DataNucleus Cache …Run Code Online (Sandbox Code Playgroud) 以下 JPQL:
UPDATE SignIn signIn SET signIn.cookieUUID = null WHERE signIn.user.id = :userID
Run Code Online (Sandbox Code Playgroud)
由于“= null”,出现以下错误:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NULL WHERE `B0`.`ID` = 9' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Run Code Online (Sandbox Code Playgroud)
但当我将该字段设置为空字符串 (= '') 时,它会起作用。
那么如何使用 JQPL 将列设置为 null 呢?
实体类:
public class CustomerSurvey implements Serializable {
@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator="CUSTOMER_SURVEY_SEQUENCE")
@Column(name = "SURVEYID", nullable = false)
private String surveyId;
@Column(name="ATTACHMENT")
@Lob
private byte[] attachment;
....
Run Code Online (Sandbox Code Playgroud)
持久性类/逻辑:
public List<CustomerSurvey> getSurveysByCustomer(String custNo)
throws WorkServiceException {
EntityManager em = entityManagerFactory.createEntityManager();
Query query = em.createNamedQuery("customerSurvey.findByCustomer")
.setParameter("custNo", custNo);
logger.debug(query);
List<CustomerSurvey> surveys = query.getResultList();
em.clear();
em.close();
return surveys;
}
Run Code Online (Sandbox Code Playgroud)
消费者类/逻辑:
List<CustomerSurvey> reviewSurveys = workService.getSurveysByCustomer("testCNo2");
for(CustomerSurvey rsurvey: reviewSurveys) {
Object obj = rsurvey.getAttachment();
byte[] buffer = (byte[]) obj;
OutputStream out = new FileOutputStream("C:\\Temp\\TulipsOut.jpg");
out.write(buffer);
}
Run Code Online (Sandbox Code Playgroud)
错误我得到:
引起:javax.jdo.JDODetachedFieldAccessException:您刚刚尝试访问字段"attachment"但是在分离对象时此字段未分离.要么不访问此字段,要么在分离对象时将其分离.在com.ge.dsp.iwork.test上的com.ge.dsp.iwork.entity.CustomerSurvey.jdoGetattachment(CustomerSurvey.java)com.ge.dsp.iwork.entity.CustomerSurvey.getAttachment(CustomerSurvey.java:89) …
我重新下载了Eclipse Juno并安装了Google App Engine SDK.在此之后,每当我开始eclipse时,我都会收到错误
无法找到主要类:com.google.appengine.tools.enhancer.Enhance.程序将会退出.
编辑:看起来有一个由Google AppEngine插件添加的构建器.Eclipse试图找到这个"Builder"并失败.我将此构建器的路径添加到我的系统类路径中,该构建器位于plugins\com.google.appengine.eclipse.sdkbundle_1.8.3\appengine-java-sdk-1.8.3\lib中.
现在我得到了一个不同的错误
DataNucleus Enhancer(版本3.1.1):类的增强2013年8月21日下午8:48:14 org.datanucleus.metadata.MetaDataManager loadClasses SEVERE:在CLASSPATH中找不到类"in.chimanrao.model.Account".请检查您的规格和CLASSPATH.org.datanucleus.exceptions.ClassNotResolvedException:在CLASSPATH中找不到类"in.chimanrao.model.Account".请检查您的规格和CLASSPATH.
如何将自定义类路径传递给此DataNucleus Enhancer?
我目前正在尝试使用HDFS和HBASE.Hadoop和HBASE已正确安装在计算机上,并且我的应用程序在托管在同一台计算机上时可以正常运行.
但是在另一台机器上托管时.首次点击HBASE我得到一个错误说:
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [sitepulsewebsite] in context with path [/SitePulseWeb] threw exception [Request processing failed; nested exception is javax.jdo.JDODataStoreException
NestedThrowables:org.apache.hadoop.hbase.MasterNotRunningException: localhost:60000] with root cause
org.apache.hadoop.hbase.MasterNotRunningException: localhost:60000
Run Code Online (Sandbox Code Playgroud)
在第二次打击我得到例外:
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [sitepulsewebsite] in context with path [/SitePulseWeb] threw exception [Request processing failed; nested exception is javax.jdo.JDODataStoreException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to localhost/127.0.0.1:60020 after attempts=1
NestedThrowables: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to localhost/127.0.0.1:60020 after attempts=1] with root cause
java.net.ConnectException: Connection refused …Run Code Online (Sandbox Code Playgroud) datanucleus ×10
java ×6
jdo ×3
jpa ×2
detach ×1
eclipse ×1
hadoop ×1
hbase ×1
javaw ×1
jpa-2.0 ×1
jpql ×1
lob ×1
maven ×1
postgresql ×1
spring-mvc ×1