我想拥有来自相同数据条目的版本.换句话说,我想用另一个版本号复制该条目.
id - Version 将是主键.
该实体应该如何?如何与其他版本复制?
id Version ColumnA
1 0 Some data
1 1 Some Other data
2 0 Data 2. Entry
2 1 Data
Run Code Online (Sandbox Code Playgroud) 我想知道gwt.xml中可能的user.agent值是多少.我找到了其中一些,但不幸的是不是完整的清单.
还有什么?Opera,ie7,ie8,......等
我对SLF4J有依赖性.我收到此错误:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Run Code Online (Sandbox Code Playgroud)
这是我的maven条目:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
问题出在哪儿?
编辑: 没有log4j依赖我得到以下异常
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
at org.apache.bval.jsr303.ConfigurationImpl.<clinit>(ConfigurationImpl.java:50)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at org.apache.bval.jsr303.ApacheValidationProvider.createGenericConfiguration(ApacheValidationProvider.java:66)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:173)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:50)
at com.daimler.zv9.basic.entity.AbstractEntity.<clinit>(AbstractEntity.java:73)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:195) …Run Code Online (Sandbox Code Playgroud) 我有一些文件应该根据每行开头的id进行排序.文件大约2-3 GB.
我试图将所有数据读入ArrayList并对它们进行排序.但记忆力还不足以让他们全部保留.这是行不通的.
线条看起来像
0052304 0000004000000000000000000000000000000041 John Teddy 000023
0022024 0000004000000000000000000000000000000041 George Clan 00013
我怎样才能对文件进行排序?
我对javaee Bibliothek有一个maven依赖.
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我在某些类中遇到了Eclipse中的错误.
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException
Run Code Online (Sandbox Code Playgroud)
我添加了javax.mail依赖项.
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
它没有用.任何的想法??
可能重复:
哪些eclipse文件属于版本控制
我们使用Eclipse IDE进行开发..settings文件夹总是有变化.有时我们在Eclipse中配置一些东西,但通常我们在Eclipse中改变任何东西.
Eclipse在没有我们任何要求的情况下更改设置?
.settings的最佳做法是什么?
我应该检查SVN中的eclipse设置(.settings)还是添加到忽略列表?
我尝试将svg转换为PNG.svg文件来自服务器Inputstream.
首先,我将svg流转换为字节数组:
byte[] streamBytes = IOUtils.toByteArray(svgStream);
Run Code Online (Sandbox Code Playgroud)
然后我OutputStream用以下代码将字节转换为(PNG).
private ByteArrayOutputStream svgToPng(byte[] streamBytes)
throws TranscoderException, IOException {
PNGTranscoder t = new PNGTranscoder();
TranscoderInput input = new TranscoderInput(new ByteArrayInputStream(streamBytes));
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(ostream);
t.transcode(input, output);
ostream.flush();
// ostream.close();
return ostream;
}
Run Code Online (Sandbox Code Playgroud)
但我通过" t.transcode(input, output);" 得到空指针异常
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
Premature end of file.
graphdata : null
at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:136)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
Run Code Online (Sandbox Code Playgroud)
注意:如果我将svgstream保存在磁盘上并使用以下transcoderinput和uri构造函数,那么它可以工作.但在我的情况下,我不想保存在磁盘上.
TranscoderInput input = new TranscoderInput(new File("c:/a.svg").toURI().toString());
Run Code Online (Sandbox Code Playgroud) 我尝试在Excel 2010中对数据进行排序空白字符始终位于结果的末尾.我在ZA订单中对AZ订单进行了排序.空行没有影响..?
知道我怎么能这样做吗?
我写了一个转换器.我正在使用CDI和注入并行.在这种情况下,不会注入类.如何使注射成为可能?
@FacesConverter(forClass = MyClass.class)
public class MyConverter implements Converter{
@EJB
private ClassForEJB classForEJB;
@Inject
private ClassForInject classForInject;
// Converter Methods
}
Run Code Online (Sandbox Code Playgroud) 我试图通过以下pom部分为我的maven生命周期添加一个目标.我定义了一个新插件并使用阶段和执行信息对其进行了配置.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<includes>**/entity/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<connectionDriverName>com.ibm.db2.jcc.DB2Driver</connectionDriverName>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
<sqlFile>${project.build.directory}/database.sql</sqlFile>
</configuration>
<executions>
<execution>
<id>sql</id>
<phase>generate-resources</phase>
<goals>
<goal>sql</goal>
</goals>
</execution>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
Run Code Online (Sandbox Code Playgroud)
然后我用maven运行mvn:install但是插件没有运行?