嗨!请帮我解决线程“main”中的异常异常 java.lang.InternalError: I/O 异常保存生成的文件:java.io.FileNotFoundException: com\sun\proxy\$Proxy0.class 我需要解组这个类属性正确。
这里有我的类实现
@XmlRootElement( name = "mail_settings_document" )
@XmlType(propOrder = { "senderMail", "SMTPHostServer" , "SMTPPort" , "login" , "password" , "encryption"})
public class TMailDocument extends TDocument implements IMailDocument {
// --------------------- [ КОНСТРУКТОР КЛАССА ] -----------------------------------------------------------------------------------
public TMailDocument() {}
public TMailDocument( String path, IDocumentAction action ) { super( path, action ); }
// --------------------- [ КОНСТРУКТОР КЛАССА ] -----------------------------------------------------------------------------------
// --------------------- [ ПРИВАТНЫЕ ДАННЫЕ ] -------------------------------------------------------------------------------------
/** святая святых - параметры почты
*/
@XmlElement(name = "SENDER_MAIL")
private String senderMail = "";
@XmlElement(name = "SMTP_SERVER")
private String SMTPHostServer = "";
@XmlElement(name = "SMTP_PORT")
private String SMTPPort = "";
@XmlElement(name = "LOGIN")
private String login = "";
@XmlElement(name = "PASSWORD")
private String password = "";
@XmlElement(name = "ENCRYPTION", type = ENCRYPTION_TYPE.class)
private ENCRYPTION_TYPE encryption = ENCRYPTION_TYPE.UNKNOWN;
// --------------------- [ ПРИВАТНЫЕ ДАННЫЕ ] -------------------------------------------------------------------------------------
// --------------------- [ ПУБЛИЧНЫЕ МЕТОДЫ КЛАССА ] ------------------------------------------------------------------------------
public String name() { return this.getClass().getSimpleName(); }
/** геттеры и сеттеры параметров почты
*/
@Override
public String getSMTPHostServer() { return SMTPHostServer; }
@Override
public String getSenderMail() { return senderMail; }
@Override
public String getSMTPPort() { return SMTPPort; }
@Override
public String getLogin() { return login; }
@Override
public String getPassword() { return password; }
@Override
public ENCRYPTION_TYPE getEncryption() { return encryption; }
@Override
@XmlTransient
public IDocument setEncryption(ENCRYPTION_TYPE encryption) {
if ( encryption != null ) { this.encryption = encryption; }
return this;
}
@Override
@XmlTransient
public IDocument setSenderMail ( String from )
{
if ( from != null ) { this.senderMail = from; }
return this;
}
@Override
@XmlTransient
public IDocument setSMTPHostServer ( String host ) throws Exception
{
if ( host!= null ) { SMTPHostServer = host; }
return this;
}
@Override
@XmlTransient
public IDocument setSMTPPort ( String port ) throws Exception
{
if ( port!= null ) { SMTPPort = port; }
return this;
}
@Override
@XmlTransient
public IDocument setLogin ( String login ) throws Exception
{
if ( login!= null ) { this.login = login; }
return this;
}
@Override
@XmlTransient
public IDocument setPassword ( String pass ) throws Exception
{
if ( pass!= null ) { password = pass; }
return this;
}
}
我的班级界面:
public interface IMailDocument {
/** перечисление:какой тип шифрования используется
* UNKNOWN - пустое значение
* SSL - SSl
* TLS - TLS
* NONE - без шифрования
*/
public enum ENCRYPTION_TYPE
{
UNKNOWN,SSL,TLS,NONE;
public boolean isUnknown()
{
return this.equals(UNKNOWN);
}
};
// --------------------- [ ПУБЛИЧНЫЕ МЕТОДЫ КЛАССА ] ------------------------------------------------------------------------------
/** свойство:метод: получение сервера
*/
public String getSMTPHostServer();
/** свойство:метод: получение адреса отправителя
*/
public String getSenderMail();
/** свойство:метод: получение порта севрера
*/
public String getSMTPPort();
/** свойство:метод: получение логина
*/
public String getLogin();
/** свойство:метод: получение пароля
*/
public String getPassword();
/** свойство:метод: тип шифрвоания подключения
*/
public TMailDocument.ENCRYPTION_TYPE getEncryption();
/** метод: устанвока шифрования
*/
public IDocument setEncryption(ENCRYPTION_TYPE encryption);
/** метод: устанвока почты отпраивтеля
*/
public IDocument setSenderMail ( String from );
/** метод: установка сервера
*/
public IDocument setSMTPHostServer ( String host ) throws Exception;
/** метод: установка порта севрера
*/
public IDocument setSMTPPort ( String port ) throws Exception ;
/** метод: установка логина
*/
public IDocument setLogin ( String login ) throws Exception ;
/** метод: установка пароля
*/
public IDocument setPassword ( String pass ) throws Exception ;
}
PS所有文件都在正确的路径中并且编组顺利
Exception in thread "main" java.lang.InternalError: I/O exception saving generated file: java.io.FileNotFoundException: com\sun\proxy\$Proxy0.class (Системе не удается найти указанный путь)
at sun.misc.ProxyGenerator$1.run(Unknown Source)
at sun.misc.ProxyGenerator$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.ProxyGenerator.generateProxyClass(Unknown Source)
at java.lang.reflect.Proxy.getProxyClass0(Unknown Source)
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
at sun.reflect.annotation.AnnotationParser.annotationForMap(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationType.<init>(Unknown Source)
at sun.reflect.annotation.AnnotationType.getInstance(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
at com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(Unknown Source)
at com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getTypeInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at XDocumentFactory.XMLDocumentIO.loadXML(XMLDocumentIO.java:146)
at XDocumentFactory.DocumentLoader.loadDocument(DocumentLoader.java:62)
at XDocumentFactory.DocumentFactory.loadDocument(DocumentFactory.java:89)
at XMailMessanger.MailMessenger.loadSettings(MailMessenger.java:158)
at alfa.runner.main(runner.java:24)