1. jave-2.0.jar 파일 다운로드 (첨부파일)


   1.1 maven 이 지원되지 않는 것 같으므로 프로젝트의 Build Path 에서 Add External JARs를 통해 다운받은 jave2.0.jar 파일을 추가해 준다.


0879a19b4459ce425826875d862c5a54_1545880306_6486.png
 



1.2  프로젝트의 속성에서 Deployment Assembly 에도 추가해 준다.


0879a19b4459ce425826875d862c5a54_1545880384_2366.png
 


Java Build Path에 추가했으므로 Java Build Path Entries를 선택하고 다음


0879a19b4459ce425826875d862c5a54_1545880436_849.png
 


jave-2.0.jar 파일이 보일 것이다.


0879a19b4459ce425826875d862c5a54_1545880506_3494.png
 






2. wav파일과 mp3 파일이 저장된 경로 설정 (context-properties.xml)


<entry key="Globals.wavFileStorePath" value="/Users/ellord/Downloads/Neon3Workspace/ict_uae/src/test/" />



3. ffmpeg 파일을 다운받는다.(ffmpeg.org)


  3.1 OSX경우 brew 로 설치하면 편리함.


brew install ffmpeg



  3.2 Windows의 경우 stable 버전을 다운받는다.


다운로드위치 : https://ffmpeg.zeranoe.com/builds/ 





4. 컨트롤러에서 작업(TestController.java)



import it.sauronsoftware.jave.AudioAttributes;

import it.sauronsoftware.jave.Encoder;

import it.sauronsoftware.jave.EncoderException;

import it.sauronsoftware.jave.EncodingAttributes;

import it.sauronsoftware.jave.FFMPEGLocator;





@Controller

public class TestController {



    @Resource(name = "propertiesService")

    protected EgovPropertyService propertyService;



    @RequestMapping(value = "/test/waveomp3.do", method = RequestMethod.GET)

    public String convert(final ModelMap model) throws Exception {

    

  //경로확인

        String storePathString = propertyService.getString("Globals.wavFileStorePath");

        try{

        

        File source = new File(storePathString + "source.wav");//변환전 파일

        File target = new File(storePathString + "target.mp3");//변환후 파일

        

        AudioAttributes audio = new AudioAttributes();

        audio.setCodec("libmp3lame");

        audio.setBitRate(new Integer(128000));

        audio.setChannels(new Integer(2));

        audio.setSamplingRate(new Integer(44100));

        

        EncodingAttributes attrs = new EncodingAttributes();

        attrs.setFormat("mp3");

        attrs.setAudioAttributes(audio);

        

        //Encoder encoder = new Encoder();

        Encoder encoder = new Encoder(new MyFFMPEGExecutableLocator());

        encoder.encode(source, target, attrs);

        

        }catch(EncoderException e) {

         e.printStackTrace();

        

        }


model.addAttribute("mp3location"torePathString + "target.mp3");//변환된 mp3 파일 경로


  return "뷰파일 경로";

    }




    //ffmpeg 경로

    class MyFFMPEGExecutableLocator extends FFMPEGLocator{

        @Override

        protected String getFFMPEGExecutablePath() {

            // TODO Auto-generated method stub

      String path = "/usr/local/bin/ffmpeg";  //OSX, Linux기준

//String path = "C:\ffmpeg-win64-static\bin\ffmpeg.exe";//Windows 기준

            return path;


        }

    }

    

}




5. 해당 폴더에 mp3파일이 생성되는지 확인



0879a19b4459ce425826875d862c5a54_1545880732_4634.png
 



문의 : apps@ellord.net

jave-2.0.jar.zip


블로그 이미지

엘로드넷

,

1. oracle.com 에서 ojdbc.jar를 다운 받는다.


http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html



Thank you for accepting the OTN License Agreement; you may now download this software.

Oracle Database 12c Release 1 (12.1.0.2) JDBC Drivers & UCP Downloads

 
 Zipped JDBC Driver and Companion JARs 
 Download  ojdbc-full.tar.gz (9,348,239 bytes) - (SHA1 Checksum: 62ab3746ae6d6d5787fa2773ccc2c58f040f00a2) 
The TAR archive contains the latest 12.1.0.2 JDBC Thin driver (ojdbc7.jar and ojdbc6.jar), Universal Connection Pool (ucp.jar), other companion jars, and README that has more information about the contents of the tar file.
                                    OR
 Unzipped JDBC Driver and Companion JARs
 The JARs included in the ojdbc-full.tar.gz are also available as individual downloads in this section. 
 
 Download ojdbc7.jar (3,698,857 bytes) - (SHA1 Checksum: 7c9b5984b2c1e32e7c8cf3331df77f31e89e24c2) Certified with JDK7 and JDK8;
 Download ojdbc6.jar (3,692,096 bytes) - (SHA1 Checksum: 76f2f84c383ef45832b3eea6b5fb3a6edb873b93) For use with JDK6; 
 Download ucp.jar (733,729 bytes) - (SHA1 Checksum:384b4a763188849bfd68f313701ac11dafd1899b)
(Refer MOS note DOC ID 2074693.1) - For use with JDK6 & JDK7
 Download ojdbc.policy (10,542 bytes) - Sample security policy file for Oracle Database JDBC drivers
 Download orai18n.jar (1,659,574 bytes) - (SHA1 Checksum: 11969072d3de96bfd5b246071976e274d78598a7) - Classes for NLS support
 Download xdb6.jar (253,006 bytes) - (SHA1 Checksum: 6fbdaebf59cb33282548f4df14436cc179c64bee)
Classes to support standard JDBC 4.x java.sql.SQLXML interface (Java SE 6 & Java SE 7).
 Download ons.jar (106,496 bytes) - (SHA1 Checksum: 1aee60b3f7aa581d90f2f18d5e334a1913da52c9)
For use by the pure Java client-side Oracle Notification Services (ONS) daemon
 Download simplefan.jar (21,189 bytes) - (SHA1 Checksum: 80ca1246d5c9cad79985e9fff0acc9fb09ba1b2b)
Java APIs for subscribing to RAC events via ONS; simplefan policy and javadoc




ojdbc7.jar 파일을 다운 받는다.




2. 이클립스 환경설정에서 메이븐 설치 경로를 확인한다.





User Settings 에서 보듯


메이븐 설치 경로는 


/usr/local/Cellar/maven/3.5.3/bin 이 된다.



local repository 경로는 


/Users/ellord/.m2/repository 


이다.






3. 메이븐이 설치된 경로로 가서 실행한다.


mvn install:install-file -Dfile="다운받은파일경로" -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1 -Dpackaging=jar




ELLORDNET-MPR:bin ellord$ mvn install:install-file -Dfile="/Users/ellord/Downloads/ojdbc7.jar" -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1 -Dpackaging=jar

[INFO] Scanning for projects...

[INFO

[INFO] ------------------< org.apache.maven:standalone-pom >-------------------

[INFO] Building Maven Stub Project (No POM) 1

[INFO] --------------------------------[ pom ]---------------------------------

[INFO

[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---

[INFO] Installing /Users/ellord/Downloads/ojdbc7.jar to /Users/ellord/.m2/repository/com/oracle/ojdbc7/12.1/ojdbc7-12.1.jar

[INFO] Installing /var/folders/88/j2rmm2sx259_1nlkgr_8q_l40000gn/T/mvninstall7407903127386008808.pom to /Users/ellord/.m2/repository/com/oracle/ojdbc7/12.1/ojdbc7-12.1.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 0.471 s

[INFO] Finished at: 2018-06-11T15:23:07+09:00

[INFO] ------------------------------------------------------------------------

ELLORDNET-MPR:bin ellord$ 







4. 설치확인


ELLORDNET-MPR:oracle ellord$ cd /Users/ellord/.m2/repository/com/oracle/

ELLORDNET-MPR:oracle ellord$ ls -l

total 0

drwxr-xr-x  3 ellord  staff   96 Jun 11 14:59 ojdbc6

drwxr-xr-x  4 ellord  staff  128 Jun 11 15:23 ojdbc7

ELLORDNET-MPR:oracle ellord$ 



ojdbc7 이 설치되어 있다.





5. 프로젝트의 pom.xml 에 추가


<dependency>

    <groupId>com.oracle</groupId>

    <artifactId>ojdbc7</artifactId>

    <version>12.1</version>

</dependency>




6. 아래 그림처럼 추가되어 있다.









7. 끝.





블로그 이미지

엘로드넷

,

Spring JUnit4.12 버전에서 에러 나올 때,


아래 경로에서


hamcrest-core.jar 를 다운받아서 빌드패스에 Add External JARs 눌러서 추가해주면 된다.



https://github.com/junit-team/junit4/wiki/Download-and-Install




블로그 이미지

엘로드넷

,

web.xml

파일에서 


<filter-mapping> 안에 <url-pattern>/*</url-pattern> 인지 확인.


<url-pattern>/</url-pattern> 과 같이 하면 한글 깨짐.





<filter>

   

    <filter-name>encodingFilter</filter-name>

    <filter-class>

        org.springframework.web.filter.CharacterEncodingFilter

    </filter-class>

    <init-param>

        <param-name>encoding</param-name>

        <param-value>UTF-8</param-value>

    </init-param>

    <init-param>

        <param-name>forceEncoding</param-name>

        <param-value>true</param-value>

    </init-param>

</filter>

<filter-mapping>

    <filter-name>encodingFilter</filter-name>

    <url-pattern>/*</url-pattern>

</filter-mapping>

블로그 이미지

엘로드넷

,

WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI


servlet-context.xml 파일에서 controller가 있는 패키지가 정확하게 되어 있는지 확인.


<context:component-scan base-package="net.ellord.spring_test_controller" />



spring 기본 프로젝트를 생성하고 추가로 컨트롤러 패키지를 생성한 경우 확인필요.

블로그 이미지

엘로드넷

,

1. MySQL


<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>5.1.31</version>

</dependency>






2. Oracle


<dependency>

    <groupId>com.oracle</groupId>

    <artifactId>ojdbc14</artifactId>

     <version>10.2.0.4.0</version>

</dependency>



3. Oracle11g


<repositories>

<repository>

<id>codelds</id>

              <url>https://code.lds.org/nexus/content/groups/main-repo</url>

</repository>

</repositories>


<dependency>

    <groupId>com.oracle</groupId>

    <artifactId>ojdbc6</artifactId>

    <version>11.2.0.3</version>

</dependency>

블로그 이미지

엘로드넷

,