Action Coin
 



전자정부프레임워크 프로젝트를 github 연동후 다음과 같은 에러가 나면
org.eclipse.jgit.api.errors.TransportException: Nothing to fetch.
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:253)
at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:97)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:128)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:139)
at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.runInWorkspace(PullOperationUI.java:114)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.errors.TransportException: Nothing to fetch.
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1087)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 8 more


config 파일 [remote "origin"] 항목에

fetch = +refs/heads/*:refs/remotes/origin/*


를 추가한다.

이클립스에서 모든 프로젝트에 적용되게 하려면

Windows -> Preferences -> Team -> Git -> Configuration - Repository Settings 탭
-> Add Entry
Key : remote.origin.fetch
Value : +refs/heads/*:refs/remotes/origin/*

config 파일 전체 내용
[core]
symlinks = false
repositoryformatversion = 0
filemode = false
logallrefupdates = true
[remote "origin"]
url = git url
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master



Posted by incree

2018/02/11 13:08 2018/02/11 13:08
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/386

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

전자정부 3.6.0에 포함된 spring 에서 기본으로 제공하는 엑셀 다운로드는

HSSFWorkbook 을 사용하기 때문에 65536 레코드가 넘어가면 에러가 발생한다.


XSSFWorkbook 형태로 다운로드 받기 위해서는 AbstractView를 직접 구현해 주어야 한다.



1. pom.xml에 poi, poi-ooxml dependency 추가


<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>


2. AbstractView 구현

package com.incree.excel;

import java.util.List;
import java.util.Map;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFDataFormat;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Component;

@Component("listExcelView")
public class ListExcelView extends AbstractView  {
private static final String CONTENT_TYPE = "application/vnd.ms-excel";

public ListExcelView() {
setContentType(CONTENT_TYPE);
}

  /**
   * 스프링 AbstractExcelView 에 있는 함수 편리하게 쓰기 위해 추가
   */
protected XSSFCell getCell(XSSFSheet sheet, int row, int col) {
XSSFRow sheetRow = sheet.getRow(row);
if (sheetRow == null) {
sheetRow = sheet.createRow(row);
}
XSSFCell cell = sheetRow.getCell(col);
if (cell == null) {
cell = sheetRow.createCell(col);
}
return cell;
}

/**
   * 스프링 AbstractExcelView 에 있는 함수 편리하게 쓰기 위해 추가
   */
protected void setText(XSSFCell cell, String text) {
cell.setCellType(CellType.STRING); // 스프링엔 cell.setCellType(HSSFCell.CELL_TYPE_STRING); 로 돼 있지만 deprecated 됐으므로 수정
cell.setCellValue(text);
}

@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
XSSFWorkbook wb = new XSSFWorkbook();
        XSSFSheet sheet = (XSSFSheet) wb.createSheet("쉬트이름");

        XSSFCell cell = null;

        XSSFDataFormat format = wb.createDataFormat();
        XSSFCellStyle style = wb.createCellStyle();
    style.setDataFormat(format.getFormat("#,###"));

int cellStartIndex = 2;

// set header information
setText(getCell(sheet, 1, 0), "셀내용");
setText(getCell(sheet, 2, 1), "셀내용2");
setText(getCell(sheet, 3, 2), "셀내용3");

               // List resultList =  (List) model.get("resultList");

..............
..............
..............


ServletOutputStream out = response.getOutputStream();
wb.write(out);

        if (out != null) out.close();
        if (wb != null) wb.close();
}
}

3. controller 구현

package com.incree.excel;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ListController {
@RequestMapping("/listExcelDownload.do")
public ModelAndView listExcelDownload(Model model, HttpServletResponse response) throws Exception{
// List resultList = getList();

// Map<String, Object> map = new HashMap<String, Object>();
// map.put("resultList", resultList);

response.setHeader("Content-Disposition", "attachment; fileName=\"list_excel.xlsx\";");
response.setHeader("Content-Transfer-Encoding", "binary");

return new ModelAndView("listExcelView", map);
}

}

Posted by incree

2017/12/19 14:51 2017/12/19 14:51
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/384

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다


전자정부프레임워크에는 EgovIdGnrService 라는 id를 생성해 주는 기능이 있다.

가끔 이 기능을 사용할때 다음과 같은 에러가 발생할 수 있다.(mysql)

 [IDGeneration Service] ORDER_ID 테이블을 업데이트하는 예외가 발생했습니다.

다음의 update query 문에서 발생하는 에러이다.

UPDATE COMTECOPSEQ SET next_id = ? WHERE table_name = ?

에러 로그를 보면

egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl

클래스 223 줄에서 exception이 찍히는데, 에러 내용만 봐서는 어떤 에러인지 알기 힘들다.

전자정부프레임워크 사이트에 이 문제에 대한 답변이 하나 있는데

COMTECOPSEQ table에 lock이 걸려서 발생하는 문제이니 lock을 해결하라고 돼 있다
(https://open.egovframe.go.kr/cop/bbs/selectBoardArticle.do?bbsId=BBSMSTR_000000000013&nttId=18793)


사용자 삽입 이미지

전자정부프레임워크 답변



SELECT ORDER_ID FROM COMTECOPSEQ WHERE = ?

쪽에서 exception이 발생하는 경우는 DataAccessException 을 로깅해 주기 때문에

바로 디비 에러 사항을 확인할 수 있는데,

update에서는 DataAccessException 을 FdlException 로 throw 하기 때문에 디비에서 발생한 에러 내용을 바로 확인할 수 없다.

디버깅 해서 update시 발생한 DataAccessException 로그를 확인해 보면 아래와 같다

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorizedSQLExceptionfor SQL [UPDATE COMTECOPSEQ SET next_id = ? WHERE table_name = ?]; SQL state [HY000]; error code [1665]; Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.; nested exception isjava.sql.SQLException: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
      at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
      at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
      at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
      at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:660)
      at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:909)
      at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:970)
      at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:980)
      at egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl$1.doInTransaction(EgovTableIdGnrServiceImpl.java:218)
      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
      at egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl.allocateIdBlock(EgovTableIdGnrServiceImpl.java:160)
      at egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl.allocateLongIdBlock(EgovTableIdGnrServiceImpl.java:257)
      at egovframework.rte.fdl.idgnr.impl.AbstractDataBlockIdGnrService.getNextLongIdInner(AbstractDataBlockIdGnrService.java:120)
      at egovframework.rte.fdl.idgnr.impl.AbstractIdGnrService.getNextLongIdChecked(AbstractIdGnrService.java:151)
      at egovframework.rte.fdl.idgnr.impl.AbstractIdGnrService.getNextIntegerId(AbstractIdGnrService.java:203)
      at
      at
      at
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:747)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:676)
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at egovframework.burgerking.api.comm.filter.LogSessionIdFilter.doFilter(LogSessionIdFilter.java:32)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2840)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2334)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2262)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2246)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:916)
      at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:909)
      at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
      ... 57 more








에러는 transaction isolation level이 READ_COMMITTED (or READ_UNCOMMITTED)인데 BINLOG_FORMAT 이 statement 이기 때문에 발생하는 오류다.  


egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl  클래스 115줄에 보면

transaction isolation level을 강제로 READ_COMMITTED로 변경하는 코드가 있다.
 
this.transactionTemplate.setIsolationLevelName("ISOLATION_READ_COMMITTED");



이 코드에 있는 transaction isolation level을 변경하거나,

BINLOG를 사용하지 않거나

BINLOG_FORMAT을 mixed로 변경하면  [IDGeneration Service] ORDER_ID 테이블을 업데이트하는 예외가 발생했습니다.


에러는 해결할 수 있다.



P.S
 * 다른 이유로 에러나는 경우도 있을 수 있으나 경험해 보지 못해, 우선 경험하고 해결한 것만 포스팅
 * select 쪽 에러시에는 DataAccessException을 로깅하는데, update에는 왜 로깅하지 않을까?? 이 로깅만 돼 있었어도 고생안하고 바로 알았을텐데....






















Posted by incree

2017/08/22 14:42 2017/08/22 14:42
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/382

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[JAVA] split 세로바(|)

String aa = "/|R|00010300|3|302040300|302040100|301040100|R|/";

문자열이 위와 같고 | 로 나눌때
split("|")로 하면 원하는 결과가 나오지 않는다

split의 파라미터가 정규표현식 문자열이기 때문에

다음과 같이 해줘야 된다

String[] arr = aa.split("\\|");
for(int i = 0; i < arr.length; ++i) {
    out.println(arr[i] + "<br />");
}

Posted by incree

2013/03/28 14:44 2013/03/28 14:44
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/206

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

mapper 설정
<insert id="insert" parameterType="DischargeLoggingVo" useGeneratedKeys="true" keyProperty="seq">
        INSERT INTO discharge_logging (
                wire_id
                ,power_equip_code
                ,start_time
                ,end_time
                ,log_term
                ,vol_down1
                ,vol_down2
                ,vol_down3
                ,reg_time)
        VALUES (
                #{wire_id}
                ,#{power_equip_code}
                ,#{start_time}
                ,#{end_time}
                ,#{log_term}
                ,#{vol_down1}
                ,#{vol_down2}
                ,#{vol_down3}
                ,GETDATE())
    </insert>

자동증가되어 입력된 seq 값이 DischargeLoggingVo 의 seq 프로퍼티에 세팅된다
따라서 자바에서는 아래처럼 해당 값을 가져오면 된다.



java dao
public long insert(DischargeLoggingVo vo) { 
int insertedNum = sqlSessionFactory.openSession(true).insert(getInsertMapper(this.getClass().getName()), vo);
        return vo.getSeq();
    }

Posted by incree

2013/03/28 12:07 2013/03/28 12:07
, , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/205

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[JAVA] 전자정보 프레임워크 정보

jsp 컴파일 경로
D:\developer\javadev\eGovFrameDev-2.0.1-FullVer\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\biowet\org\apache\jsp\WEB_002dINF

Posted by incree

2012/11/26 04:38 2012/11/26 04:38
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/178

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[JAVA] 특정 폴더내의 파일탐색

package egovframework.iwt.cmm;

import java.io.File;
import java.util.ArrayList;

public class FileUtil {

    public static void getFileList(File targetPath, ArrayList arr) {
        if(targetPath.isDirectory()) {
            String [] fl = targetPath.list();
            File tmpFile = null;
            long nTmp;
            int filecnt = 0;

            for(int i = 0; i < fl.length; i++) {
                tmpFile = new File(targetPath.getAbsolutePath() + "/" + fl[i]);
                if(tmpFile.isDirectory()) {
                    getFileList(tmpFile, arr);
                }
                else {
                    arr.add(targetPath.getAbsolutePath()+"/"+fl[i]);
                }
            }
    
        }
        else {
            arr.add(targetPath.getAbsolutePath() + targetPath.getName());
        }
    }
}

todo
필터하는 기능 - 확장자, 시간, 파일명등..

Posted by incree

2012/11/22 18:48 2012/11/22 18:48
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/174

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[JAVA] class의 method 모두 찾기

package egovframework.iwt.cmm;

import java.lang.reflect.Method;
import java.util.List;

public class ClassUtil {
    public ClassVo[] getMethosFromClassNames(String[] classNames) {
        if(classNames == null) return new ClassVo[0];

        Class[] classes = new Class[classNames.length];

        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
        for(int i =0; i < classNames.length; i++ ) {
            try {
                classes[i] = classLoader.loadClass(classNames[i]);
            }
            catch(ClassNotFoundException cnfe) {
                cnfe.printStackTrace();
                classes[i] = ClassNotFoundException.class;
            }
        }

        return getMethosFromClasses(classes);
    }

    public ClassVo[] getMethosFromClasses(Class[] classes) {
        if(classes == null) return new ClassVo[0];

        ClassVo[] classVoArr = new ClassVo[classes.length];
        for(int i =0; i < classes.length; i++ ) {
            classVoArr[i] = new ClassVo();
            classVoArr[i].setClassName(classes[i].getName());
            classVoArr[i].setMethods(classes[i].getDeclaredMethods());
        }
        
        return classVoArr;
    }

    public static void main(String[] args) {
        String[] classNames = {"egovframework.com.cmm.ComDefaultCodeVO"
                               ,"egovframework.com.cmm.ComDefaultVO"};
        ClassUtil classUtil = new ClassUtil();
        ClassVo[] classVoArr = classUtil.getMethosFromClassNames(classNames);
        for(int i = 0; i < classVoArr.length; ++i) {
            System.out.println(classVoArr[i].getClassName());
            System.out.println("\t* 설명 : ");
            System.out.println("\t* 메소드 : ");
            Method[] methods = classVoArr[i].getMethods();
            for(int j = 0; j < methods.length; ++j) {
                try {
                    System.out.println("\t\t" + methods[j].getReturnType().getSimpleName() + " " + methods[j].getName() + "()");
                    System.out.println("\t\t");
                    System.out.println("\t\t");
                }
                catch(ArrayIndexOutOfBoundsException aiob) {
                    
                }
            }
        }
    }

    public class ClassVo {
        private String packageString;
        private String className;
        private Method[] methods;
        public String getPackageString() {
            return packageString;
        }
        public void setPackageString(String packageString) {
            this.packageString = packageString;
        }
        public String getClassName() {
            return className;
        }
        public void setClassName(String className) {
            this.className = className;
        }
        public Method[] getMethods() {
            return methods;
        }
        public void setMethods(Method[] methods) {
            this.methods = methods;
        }
    }
}

Posted by incree

2012/11/22 18:45 2012/11/22 18:45
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/173

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

spring security 삭제하기

web.xml에서
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter>
        <filter-name>EgovSpringSecurityLogoutFilter</filter-name>
        <filter-class>egovframework.com.sec.security.filter.EgovSpringSecurityLogoutFilter</filter-class>
      </filter>
    <filter>
        <filter-name>EgovSpringSecurityLoginFilter</filter-name>
        <filter-class>egovframework.com.sec.security.filter.EgovSpringSecurityLoginFilter</filter-class>
        <init-param>
            <description>로그인 실패시 반활 될 URL설정</description>
            <param-name>loginURL</param-name>
            <param-value>/uat/uia/egovLoginUsr.do</param-value>
        </init-param>
      </filter>
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>EgovSpringSecurityLogoutFilter</filter-name>
        <url-pattern>/uat/uia/actionLogout.do</url-pattern>
      </filter-mapping>
    <filter-mapping>
        <filter-name>EgovSpringSecurityLoginFilter</filter-name>
        <url-pattern>*.do</url-pattern>
      </filter-mapping>

이 부분 주석처리








EgovUserDetailsSecurityServiceImpl.java


package egovframework.com.sec.ram.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.security.Authentication;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.context.SecurityContext;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;

import egovframework.com.cmm.service.EgovUserDetailsService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
import egovframework.rte.fdl.string.EgovObjectUtil;



public class EgovUserDetailsSecurityServiceImpl extends AbstractServiceImpl implements EgovUserDetailsService {

   
    /**
     * 인증된 사용자객체를 VO형식으로 가져온다.
     * @return Object - 사용자 ValueObject
     */
    public Object getAuthenticatedUser() {
       
        return RequestContextHolder.getRequestAttributes().getAttribute("loginVO", RequestAttributes.SCOPE_SESSION);
        /*
        SecurityContext context = SecurityContextHolder.getContext();
        Authentication authentication = context.getAuthentication();
       
        if (EgovObjectUtil.isNull(authentication)) {
            // log.debug("## authentication object is null!!");
            return null;
        }
       
        Object principal = authentication.getPrincipal();
       
        if(principal instanceof EgovUserDetails){
           
            // log.debug("## EgovUserDetailsHelper.getAuthenticatedUser : AuthenticatedUser is " + details.getUsername());           
            EgovUserDetails details = (EgovUserDetails)principal;
            return details.getEgovUserVO();
           
        }else{
            // log.debug("## EgovUserDetailsHelper.getAuthenticatedUser : principal is not type of EgovUserDetails);
            return null;
        }
        */
       
    }

   
    /**
     * 인증된 사용자의 권한 정보를 가져온다.
     * 예) [ROLE_ADMIN, ROLE_USER, ROLE_A, ROLE_B, ROLE_RESTRICTED, IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED, IS_AUTHENTICATED_ANONYMOUSLY]
     * @return List - 사용자 권한정보 목록
     */
    public List<String> getAuthorities() {
        List<String> listAuth = new ArrayList<String>();
       
        SecurityContext context = SecurityContextHolder.getContext();
        Authentication authentication = context.getAuthentication();
       
        if (EgovObjectUtil.isNull(authentication)) {
            // log.debug("## authentication object is null!!");
            return null;
        }
       
        GrantedAuthority[] authorities = authentication.getAuthorities();

        for (int i = 0; i < authorities.length; i++) {
            listAuth.add(authorities[i].getAuthority());

            // log.debug("## EgovUserDetailsHelper.getAuthorities : Authority is " + authorities[i].getAuthority());
        }

        return listAuth;
    }
   
    /**
     * 인증된 사용자 여부를 체크한다.
     * @return Boolean - 인증된 사용자 여부(TRUE / FALSE)   
     */

    public Boolean isAuthenticated() {
        if (RequestContextHolder.getRequestAttributes() == null) {
            return false;
        } else {

            if (RequestContextHolder.getRequestAttributes().getAttribute(
                    "loginVO", RequestAttributes.SCOPE_SESSION) == null) {
                return false;
            } else {
                return true;
            }
        }

        /*
        SecurityContext context = SecurityContextHolder.getContext();
        Authentication authentication = context.getAuthentication();
       
        if (EgovObjectUtil.isNull(authentication)) {
            // log.debug("## authentication object is null!!");
            return Boolean.FALSE;
        }
       
        String username = authentication.getName();
        if (username.equals("roleAnonymous")) {
            // log.debug("## username is " + username);
            return Boolean.FALSE;
        }

        Object principal = authentication.getPrincipal();
       
        return Boolean.valueOf(!EgovObjectUtil.isNull(principal));
        */
    }

}

Posted by incree

2012/10/20 00:44 2012/10/20 00:44
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/167

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[JAVA] eclipse 설정

사용자 삽입 이미지

사용자 삽입 이미지
사용자 삽입 이미지

servers 탭의 해당하는 tomcat 선택 후 -> F3 -> Overview - General Information 하단의 Open launch configuration 클릭 후
Edit Configuration 창의 Arguments 탭을 선택 후 VM arguments: 입력란의 마지막 라인에

-XX:PermSize=256m -XX:MaxPermSize=256m

Posted by incree

2012/07/11 01:14 2012/07/11 01:14
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/140

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다


Notices

Archives

Authors

  1. incree

Recent Trackbacks

Calendar

«   2018/02   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28      

Site Stats

Total hits:
445392
Today:
69
Yesterday:
111