如何assert在Eclipse中启用关键字?
public class A
{
public static void main(String ... args)
{
System.out.println(1);
assert false;
System.out.println(2);
}
}
Run Code Online (Sandbox Code Playgroud) 我的tomcat服务器在Eclipse中工作正常,但是当我尝试启动服务器时它没有启动.
以下是错误:
[2012-08-15 09:26:09] [info] Procrun (2.0.5.0) started
[2012-08-15 09:26:09] [info] Running Service...
[2012-08-15 09:26:09] [info] Starting service...
[2012-08-15 09:26:09] [197 javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:26:09] [994 prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:26:09] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:26:09] [info] Run service finished.
[2012-08-15 09:26:09] [info] Procrun finished.
[2012-08-15 09:29:06] [info] Procrun (2.0.5.0) started
[2012-08-15 09:29:06] [info] Running Service...
[2012-08-15 09:29:06] [info] Starting service...
[2012-08-15 09:29:06] [197 javajni.c] [error] %1 …Run Code Online (Sandbox Code Playgroud) 这个问题与oracle 10g数据库有关.相同的代码与MySQL数据库一起工作正常.
我的模型类
package com.killerlinks.model;
import java.io.Serializable;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
@Entity
@Table(name="links")
public class Linkform implements Serializable
{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="id")
private Long id;
@Column(name="tittle")
private String tittle;
@Column(name="xdesc")
private String desc;
@Column(name="url")
private String url;
@Column(name="category")
private String category;
@Column(name="xdate")
private String date;
@Column(name="xtime")
private String time;
@Column(name="tags")
private String tags;
@Column(name="image")
@Lob
private Blob fileData; …Run Code Online (Sandbox Code Playgroud) 这是我用来通过FTP使用Jakarta Commons Net将文件上传到远程位置的代码
public boolean ftpTransfer(String localfile, String destinationfile)
{
String server = "xxxx";
String username = "xxxxxx";
String password = "xxxxxxx";
try
{
FTPClient ftp = new FTPClient();
ftp.connect(server);
if(!ftp.login(username, password))
{
System.out.println("login");
ftp.logout();
return false;
}
int reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply))
{
System.out.println("disconnect");
ftp.disconnect();
return false;
}
InputStream in = new FileInputStream(localfile);
ftp.storeFile(destinationfile, in);
in.close();
ftp.logout();
ftp.disconnect();
}
catch (Exception ex)
{
ex.printStackTrace();
return false;
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
控制台中的错误是
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method) …Run Code Online (Sandbox Code Playgroud)