이클립스2014. 2. 26. 19:04

 

방법

* Problem 에서 오류 확인한다.

* Maven Clean 과 이클립스 Clean 해본다

* 프로젝트의 [Properties]-[Java Build Path] 탭 들을 확인한다

 

Posted by 선한열심
JAVA2014. 2. 26. 18:24

 


[오류] com.ibatis.common.jdbc.exception.NestedSQLException
[해결] 쿼리 안에 -- #파라미터#  를 주석으로 처리했을 경우 발생할 수 있음

 
[오류]tms.rsf.client.RESTClient.createUri(RESTClient.java)
[해결]호출 URI에 공백이 있거나 잘못 되었을 경우, URI 확인하자

 

 

[오류] java.lang.NoClassDefFoundError: javax/mail/Address 
 mail.jar download: http://www.oracle.com/technetwork/java/index-138643.html
 activation.jar download: http://java.sun.com/products/archive/javabeans/jaf102.html

 mail.jar 톰캣의 lib 폴더에 넣고 서버 다시실행하면된다
 


[오류] java.lang.NoClassDefFoundError: org/springframework/web/util/Log4jConfigListener
[해결]
  1. ?? 이클립스 Project explorer에서 프로젝트 refresh 하고
  2. 이클립스 다시 실행
  3. jboss 재시작하면 없어짐 
 주의)  로그파일 Log4jConfigListener error 위에 다른 오류 있을 수 있음


[오류]-[JSTL] The method setText(boolean) in the type IfTag 오류 
출처 - http://pwu-developer.blogspot.kr/2009/11/jstl-test-condition-and-trailing-spaces.html
원인 : <c:if test="${not empty sp.mouse.strain}         "> 의 공백
해결 : <c:if test="${not empty sp.mouse.strain}"> 공백 없앰으로 오류해결
 

 

'JAVA' 카테고리의 다른 글

[펌]jar 내부 파일 읽기  (0) 2014.04.19
[펌]Java Architecture for XML Binding (JAXB) 예제  (0) 2014.03.03
Socket으로 Mail 전송 샘플  (0) 2014.02.24
SMTP 서버를 통해 메일 전송  (0) 2014.02.19
java.lang.reflect.Method 샘플  (0) 2013.12.05
Posted by 선한열심
JAVA2014. 2. 24. 14:55


import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Date;

class SocketMailTest
{
    public static void main(String[] args)
    {
        Socket socket = null;
        System.setProperty("line.separator", "\r\n");

        try {

            socket = new Socket("서버IP",서버PORT);  

            String forward = "jungws55@nate.com";        
            String reverse = "jungws55@naver.com";          
            String replyto = reverse;                    
            String subject = "Hello World";              

          
            String content = "<html><body><h2>Hello World</h2> </body></html>";

            BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            PrintWriter pw = new PrintWriter(socket.getOutputStream(),true);

            sendAndReceive(null, rd, pw);
            sendAndReceive("HELO mtarget.cn", rd, pw);
            sendAndReceive("MAIL FROM:<" + reverse + ">", rd, pw);
            sendAndReceive("RCPT TO:<" + forward + ">", rd, pw);
            sendAndReceive("DATA", rd, pw);

            pw.println("Subject:" + subject);
            pw.println("From:<"+ reverse +">");
            pw.println("To:<"+ forward +">");
            pw.println("Reply-To:<"+ replyto +">");
            pw.println("Date:" + (new Date()));
            pw.println("Mime-Version: 1.0;");
            pw.println("Content-Type: text/html;");
            pw.println("charset=\"utf-8\";");
            pw.println();
            pw.println();
            pw.println(content);
            pw.flush();

            sendAndReceive(".", rd, pw);
            sendAndReceive("QUIT", rd, pw);

        } catch (Exception e) {

        }

        if (socket != null) {

            try {
                socket.close();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    private static void sendAndReceive(String text, BufferedReader br, PrintWriter pw)  throws IOException {

            if (text != null) {
                System.out.println("Client> " + text);
                pw.println(text);
                pw.flush();
            }

            String response;
            if ((response = br.readLine()) != null) {
                System.out.println("Server> " + response);
            }
    }
}

'JAVA' 카테고리의 다른 글

[펌]Java Architecture for XML Binding (JAXB) 예제  (0) 2014.03.03
[ERROR] java 오류 정리  (0) 2014.02.26
SMTP 서버를 통해 메일 전송  (0) 2014.02.19
java.lang.reflect.Method 샘플  (0) 2013.12.05
Annotation Example  (0) 2013.12.05
Posted by 선한열심