小编sim*_*ico的帖子

如何续订jar签名?

警告:签名者证书已过期.

当我尝试使用jarsigner进行签名时,我得到以下内容,并且输出jar不会生成.

如何续订我的jar签名?

jar-signing jarsigner

7
推荐指数
1
解决办法
5104
查看次数

为什么编译器无法识别元模型属性?

java se 6项目是否支持eclipselink jpa2的标准api?如果没有,那就是我的问题.我是否需要在persistence.xml中为条件api指定任何特殊内容?

这是我的标准查询:

 final EntityType<Meaning> Meaning_ = em.getMetamodel().entity(Meaning.class);
    final CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Integer> cq = cb.createQuery(Integer.class);
    final Root<Meaning> meng = cq.from(Meaning.class);
    cq.where(meng.get(Meaning_.lastPublishedDate)); //this attributes are not recognized/found
    cq.select(meng.get(Meaning_.objId));            // "                "                   
    TypedQuery<Integer> q = em.createQuery(cq); 
    return q.getResultList();
Run Code Online (Sandbox Code Playgroud)

这是我的意义实体:

@Entity
public class Meaning implements Serializable{
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int objId;

public int getObjId() {
    return objId;
}

@Temporal(javax.persistence.TemporalType.DATE)
private Date lastPublishedDate = null;//never

public Date getLastPublishedDate(){
        return lastPublishedDate;
    } …
Run Code Online (Sandbox Code Playgroud)

java eclipselink criteria-api jpa-2.0

6
推荐指数
1
解决办法
8231
查看次数

我可以避免一个边缘是测试依赖的依赖循环吗?

考虑一个testCycle与模块家长DummyCoreTestFramework.

TestFramework取决于DummyCore,并DummyCore具有测试dedepency TestFramework.

独立构建和测试每个模块maven没有问题.但mvn test父母的testCycle结果是:

    The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.mysimpatico:TestFramework:1.0-SNAPSHOT'}' and 'Vertex{label='org.apache:DummyCore:1.0-SNAPSHOT'}' introduces to cycle in the graph org.apache:DummyCore:1.0-SNAPSHOT --> com.mysimpatico:TestFramework:1.0-SNAPSHOT --> org.apache:DummyCore:1.0-SNAPSHOT -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the …
Run Code Online (Sandbox Code Playgroud)

inheritance circular-dependency dependency-management pom.xml maven

6
推荐指数
1
解决办法
7870
查看次数

如何设置mvn exec的类路径:exec?

我正在尝试使用类路径中的本地jar运行mvn exec:exec(或mvn exec:java)运行我的程序.但是jar无法加载:

Exception in thread "main" java.lang.Error: Unable to load voice directory. java.lang.ClassNotFoundException: com.sun.speech.freetts.en.us.cmu_us_slt_arctic.ArcticVoiceDirectory
at com.sun.speech.freetts.VoiceManager.getVoiceDirectories(VoiceManager.java:211)
at com.sun.speech.freetts.VoiceManager.getVoices(VoiceManager.java:111)
at com.sun.speech.freetts.VoiceManager.getVoice(VoiceManager.java:521)
at xpress.audio.TTS.<init>(TTS.java:66)
at xpress.audio.TTS.<init>(TTS.java:62)
at xpress.audio.AudioProducer.main(AudioProducer.java:18)
Run Code Online (Sandbox Code Playgroud)

使用以下java工作直接从CLI运行程序:

    C:\XpressAudio\target\classes>java -cp "C:\XpressAudio\target\XpressAudio-1.0-SN
APSHOT-jar-with-dependencies.jar;C:\XpressAudio\cmu_us_slt_arctic.jar;C:\XpressA
udio\en_us.jar;C:\XpressAudio\*" xpress.audio.AudioProducer
Run Code Online (Sandbox Code Playgroud)

<build>是我的一部分pom.xml:

 <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>java</executable>
                    <mainClass>xpress.audio.AudioProducer</mainClass>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>cmu_us</groupId>
                        <artifactId>slt_arctic</artifactId>
                        <version>1.0</version>
                        <scope>system</scope>
                        <systemPath>${basedir}/cmu_us_slt_arctic.jar</systemPath>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
Run Code Online (Sandbox Code Playgroud)

有人能告诉我,我应该怎么修改pom.xml,这样mvn exec:exec的工作方式类似于 …

exec classpath maven

6
推荐指数
1
解决办法
2万
查看次数

从 Java 应用程序读取的文件是否会调用系统调用?

我的理解是,请求文件系统路径(例如/aFile)的用户应用程序将调用文件系统并取回所请求文件的虚拟地址。然后应用程序将尝试使用该地址作为参数进行读/写操作,作为 CPU 指令?在执行读命令时,内存管理单元会将该地址转换为物理地址,并查看页表。如果用户无权访问该内存位置(该信息携带在哪里?),操作将中止。否则,如果在内存中找到物理地址页,则对其进行读/写操作,否则从磁盘带入该页并重复该操作。

所以,似乎根本没有系统调用。有人可以纠正上述程序细节中可能存在的错误吗?

java filesystems file-io operating-system file

5
推荐指数
1
解决办法
1824
查看次数

为什么DMBS不能依赖OS缓冲池?

Stonebraker的论文(数据库管理操作系统支持)解释说,"从缓冲池管理器获取块的开销通常包括系统调用和核心到核心的移动." 忘记缓冲区替换策略等.我唯一提出的问题是引用.

我的理解是,当DBMS想要读取块x时,它会发出一条公共读取指令.应该与请求阅读的任何其他应用程序没有区别.

我不是在寻找通用答案(我得到了它们,并阅读了论文).我寻求所述问题的详细答案.请参阅从Java应用程序读取的文件是否调用系统调用?

database filesystems operating-system

5
推荐指数
1
解决办法
1274
查看次数

如何在jpa2中使用内存中的derby?

无论以下persistence.xml配置如何,数据库都会保留在磁盘上.

  <persistence-unit name="com.mysimpatico_inmemory_persistence_nbm_1.0-SNAPSHOTPU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.mysimpatico.memoplatform.persistence.entities.Expression</class>
<properties>
  <property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:tempDb;create=true"/>
  <property name="javax.persistence.jdbc.password" value=""/>
  <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
  <property name="javax.persistence.jdbc.user" value=""/>
</properties>
Run Code Online (Sandbox Code Playgroud)

http://wiki.apache.org/db-derby/InMemoryBackEndPrimer

derby eclipselink in-memory-database jpa-2.0

5
推荐指数
1
解决办法
1万
查看次数

在哪里存储测试的预期输出?

编写测试我希望测试的方法返回某些输出.通常我正在检查对于给定的数据库操作,我得到一定的输出.我的做法通常是在测试本身中将数组编写为快速映射/属性文件.此解决方案很快,并且不容易受到外部文件的运行时更改以从中加载预期结果.

一个解决方案是将数据放在一个java源文件中,这样我就可以减少测试并且仍然可以进行编译时检查.这个怎么样?

或者将预期结果作为资源加载更好的方法?.properties文件不够好,因为每个键只能有一个值.commons-config是否可行

我宁愿一个简单的解决方案,我的名字每个键的属性,所以对于每个条目我可能有一个doc-lengthnumFound属性值(听起来像一个XML节点的元素)?

你是怎么做到这一点的?

java xml testing properties

5
推荐指数
1
解决办法
482
查看次数

为什么我得到hg:unknown命令'convert'运行hg 1.7.3?

我正在尝试将svn repo转换为mercurial但我失败了.

$ hg convert http://memorizeasy.googlecode.com/svn hg-client
hg: unknown command 'convert'
Mercurial Distributed SCM


$ hg --version
Mercurial Distributed SCM (version 1.7.3)
(see http://mercurial.selenic.com for more information)
Run Code Online (Sandbox Code Playgroud)

svn version-control mercurial

4
推荐指数
1
解决办法
2800
查看次数

如何使用xmlstartlet选择和编辑xml节点?

在这里,我选择节点:

$ xmlstarlet sel -t -c "/configuration/property[name='http.agent.name']"/value conf/nutch-default.xml 
<value/>
Run Code Online (Sandbox Code Playgroud)

这不会对其进行编辑:

$ xmlstarlet edit  "/configuration/property[name='http.agent.name']"/value -v 'test' conf/nutch-default.xml 
I/O warning : failed to load external entity "/configuration/property[name='http.agent.name']/value"
Run Code Online (Sandbox Code Playgroud)

会更改更改的xmlstartlet命令是什么?xmlstartlet还不支持AFAIK -x。

我正在conf / nutch-default.xml

$ xmlstarlet ed --help
XMLStarlet Toolkit: Edit XML document(s)
Usage: xml ed <global-options> {<action>} [ <xml-file-or-uri> ... ]
where
  <global-options>  - global options for editing
  <xml-file-or-uri> - input XML document file name/uri (stdin otherwise)

<global-options> are:
  -P (or --pf)        - preserve original formatting
  -S (or --ps)        - preserve …
Run Code Online (Sandbox Code Playgroud)

xml bash command-line-interface

4
推荐指数
1
解决办法
7733
查看次数