[서버 에러]server tomcat v8.5 server at localhost failed to start.
<에러>
[서버 에러]server tomcat v8.5 server at localhost failed to start.
<해결>
Preferences > Java > Installed JREs > 기존 jdk Remove 해주고 Add로 환경변수 설정된 jdk 재설정
Preferences > Servers > Runtile Environments > 서버 Edit > 설정된 JRE 선택
이렇게 해도 해결되지 않으면
추가된 서버 더블클릭 후 Server Options 에서 Publish module contexts to separate XML files 체크
*publish module contexts to separate xml files
이클립스에서 환경설정이나 xml 파일 설정시 실제 tomcat 서버와 동기화 시켜주는 옵션
도서관련 웹페이지를 만드는 중에 a 이미지를 기본으로 설정해두고 커서를 올리면 b 이미지로 바뀌는 기능을 구현했다.
클릭하게 되면 상품의 페이지로 이동한다.
1. HTML 기능추가(.jsp 파일)
home.jsp 파일의 body 안에 입력해준다.
이미지 경로는 상대경로로 입력하면 되고 내 경우에는 설정이 끝났는데도 기능이 구현되지 않아서 코드를 뜯어보니 js 파일 경로가 잘못되어 있었다.
내 경우는 resources/js/script.js 경로로 수정했더니 잘 작동되었다.
<body>
<div class="product-image">
<a href="product-page.html"> <!-- 상품 페이지 링크 -->
<img src="image1.jpg" alt="이미지" id="productImg">
</a>
</div>
<script src="script.js"></script>
</body>
2. JavaScript 기능추가(.js 파일)
// JavaScript 파일 내에서 마우스 이벤트와 클릭 이벤트를 처리하여 이미지를 변경하고 페이지로 이동합니다.
const productImg = document.getElementById('productImg');
// 마우스를 올렸을 때의 처리
productImg.addEventListener('mouseenter', function() {
// 마우스를 올렸을 때의 이미지 경로
this.src = 'image1.jpg';
});
// 마우스를 내렸을 때의 처리
productImg.addEventListener('mouseleave', function() {
// 마우스를 내렸을 때의 이미지 경로
this.src = 'image2.jpg';
});
// 이미지를 클릭했을 때의 처리 (상품 페이지로 이동)
productImg.addEventListener('click', function() {
window.location.href = 'product-page.html'; // 이동할 페이지의 URL
});
MySQL Command Line Client를 이용해 직접 입력해주는 방법도 있지만 Workbench를 사용하면 훨씬 간편하게 스키마 및 테이블을 생성할 수 있다. 데이터 베이스의 구조는 Schema가 Table을 포함하고 Table은 Date를 포함한다고 생각하면 된다.
Schema 생성
1) MySQL Workbench 실행
2) SCHEMAS 창에서 우클릭 Create Schema 선택
3) 데이터 베이스의 이름을 정하고 저장하면 Schema 생성완료
Table 생성
1) 생성된 Schema에서 Tables 우클릭 Create Table 선택
2) Table Name를 설정하고 설계한대로 COLUMN을 추가한다.
생성된 테이블 컬럼 확인과 더미 데이터 입력 후 데이터 조회 테스트
1) 생성된 테이블 컬럼 확인
MySQL Command Line Client를 실행해 SHOW FULL COLUMNS FROM 스키마명.테이블명; 을 입력한다.
에러 : Template이 URL을 통해 다운로드가 되어야 하는데 에러가 나면서 다운로드가 안되는 상황이다.
해결 : 참고 페이지의 zip 파일을 다운받아
sts3 > workspace > .metadate > .sts > content > org.springframework.templates.mvc-3.2.2에 넣으면 해결된다.
MVC 없음 / 템플릿 다운로드 불가 의 경우 수동으로 파일을 넣어주면 된다.
MVC 없음의 경우 필요한 파일이 해당 위치에 없기 때문에 발생하는 에러라서 내가 필요한 파일을 해당 위치에 넣어주면 해결되는 것이고, invalid thread access, download of template~ 의 경우는 템플릿 다운로드가 진행되지 않는 상황이기 때문에 해당 템플릿을 기존 프로젝트에서 복사해 다운로드 폴더에 넣어주면 해결되는 것이다.
*참고페이지에서 템플릿 파일을 다운로드 받아 압축을 풀고 해당 폴더에 넣어준 후 프로그램을 재실행하면 된다.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <descriptors> <descriptor id="org.springframework.templates.mvc" kind="template" local="true" name="Spring MVC Project" requiresbundle="org.eclipse.m2e.core" size="0" version="3.2.2"> <description>A new Spring MVC web application development project</description> </descriptor> <descriptor category="GemFire" id="org.springframework.data.gemfire.template.standalone" kind="template" local="false" name="Spring Data GemFire Project (Standalone)" requires="[3.0.0,4.0)" size="7467" url="https://raw.github.com/SpringSource/spring-data-gemfire-sts-templates/master/builds/gemfire-standalone-sts-template-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a Spring Data GemFire project with an embedded cache and one region that runs as a standalone Java application.</description> </descriptor> <descriptor category="GemFire" id="org.springframework.data.gemfire.template.server.standalone" kind="template" local="false" name="Spring Data GemFire Cache Server Project (Standalone)" requires="[3.0.0,4.0)" size="7582" url="https://raw.github.com/SpringSource/spring-data-gemfire-sts-templates/master/builds/gemfire-server-sts-template-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a GemFire Cache Server project with a cache server, embedded cache and one region that runs as a standalone Java application.</description> </descriptor> <descriptor category="GemFire" id="org.springframework.data.gemfire.template.server.war" kind="template" local="false" name="Spring Data GemFire Cache Server Project (WAR)" requires="[3.0.0,4.0)" size="7543" url="https://raw.github.com/SpringSource/spring-data-gemfire-sts-templates/master/builds/gemfire-server-war-sts-template-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a GemFire Cache Server project with a cache server, embedded cache and one region that runs as a web application.</description> </descriptor> <descriptor category="GemFire" id="org.springframework.data.gemfire.template.client" kind="template" local="false" name="Spring Data GemFire Client Project" requires="[3.0.0,4.0)" size="7881" url="https://raw.github.com/SpringSource/spring-data-gemfire-sts-templates/master/builds/gemfire-client-sts-template-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a Spring Data GemFire project with a client cache and client region that runs as a standalone Java application.</description> </descriptor> <descriptor id="cohttp://m.springsource.sts.org.apache.tomcat" kind="server" local="false" name="Apache Tomcat 6.0.20" size="6282517" url="https://dist.springsource.com/release/STS/help/com.springsource.sts.org.apache.tomcat-6.0.20.20090615-0000.zip" version="6.0.20.20090615-0000"> <description/> </descriptor> <descriptor category="Batch" id="org.springframework.samples.batch.admin.web" kind="template" local="false" name="Spring Batch Admin Webapp" requiresbundle="org.eclipse.m2e.core" size="21532" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.batch.admin.web-2.3.3.zip" version="2.3.3"> <description>A WAR project for a Spring Batch Admin web application with simple custom job</description> </descriptor> <descriptor id="org.springframework.samples.batch.simple" kind="template" local="false" name="Simple Spring Batch Project" requires="[0.0.0,2.8.0)" size="14198" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.batch.simple-2.3.5.zip" version="2.3.5"> <description>A simple project that shows how to use Spring Batch with a reader and a writer in a single step job</description> </descriptor> <descriptor category="Batch" id="org.springframework.samples.batch.simple" kind="template" local="false" name="Simple Spring Batch Project" requires="2.8.0" requiresbundle="org.eclipse.m2e.core" size="13698" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.batch.simple-2.4.2.zip" version="2.4.2"> <description>A simple project that shows how to use Spring Batch with a reader and a writer in a single step job</description> </descriptor> <descriptor id="org.springframework.templates.mvc" kind="template" local="false" name="Spring MVC Project" requires="[0.0.0,2.8.0)" size="17198" url="https://dist.springsource.com/release/STS/help/org.springframework.templates.mvc-3.0.18.zip" version="3.0.18"> <description>A new Spring MVC web application development project</description> </descriptor> <descriptor id="org.springframework.templates.mvc" kind="template" local="false" name="Spring MVC Project" requires="2.8.0" requiresbundle="org.eclipse.m2e.core" size="16608" url="http://wisejia.iptime.org:8000/org.springframework.templates.mvc-3.2.2.zip" version="3.2.2"> <description>A new Spring MVC web application development project</description> </descriptor> <descriptor id="org.springframework.samples.spring.hibernate" kind="template" local="false" name="Simple Spring Hibernate Utility Project" requires="[0.0.0,2.8.0)" size="14052" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.spring.hibernate-2.5.1.zip" version="2.5.1"> <description>A simple jar project that has some Spring and Hibernate configuration and an integration test</description> </descriptor> <descriptor category="Persistence" id="org.springframework.samples.spring.hibernate" kind="template" local="false" name="Simple Spring Hibernate Utility Project" requires="2.8.0" requiresbundle="org.eclipse.m2e.core" size="14081" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.spring.hibernate-2.6.2.zip" version="2.6.2"> <description>A simple jar project that has some Spring and Hibernate configuration and an integration test</description> </descriptor> <descriptor id="org.springframework.samples.spring.jpa" kind="template" local="false" name="Simple Spring JPA Utility Project" requires="[0.0.0,2.8.0)" size="15587" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.spring.jpa-2.3.3.zip" version="2.3.3"> <description>A simple jar project that has some Spring and JPA configuration and an integration test.</description> </descriptor> <descriptor category="Persistence" id="org.springframework.samples.spring.jpa" kind="template" local="false" name="Simple Spring JPA Utility Project" requires="2.8.0" requiresbundle="org.eclipse.m2e.core" size="15075" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.spring.jpa-2.4.2.zip" version="2.4.2"> <description>A simple jar project that has some Spring and JPA configuration and an integration test.</description> </descriptor> <descriptor id="org.springframework.samples.spring.utility" kind="template" local="false" name="Simple Spring Utility Project" requires="[0.0.0,2.8.0)" size="12666" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.spring.utility-2.5.1.zip" version="2.5.1"> <description>A simple jar project that has some Spring configuration and an integration test</description> </descriptor> <descriptor id="org.springframework.samples.spring.utility" kind="template" local="false" name="Simple Spring Utility Project" requires="2.8.0" requiresbundle="org.eclipse.m2e.core" size="12684" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.spring.utility-2.6.1.zip" version="2.6.1"> <description>A simple jar project that has some Spring configuration and an integration test</description> </descriptor> <descriptor id="org.springframework.samples.petclinic" kind="sample" local="false" name="PetClinic" size="21722686" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.petclinic-2.5.0.20080208-1600.zip" version="2.5.0.20080208-1600"> <description/> </descriptor> <descriptor id="org.springframework.samples.springtravel" kind="sample" local="false" name="SpringTravel" size="4409712" url="https://dist.springsource.com/release/STS/help/org.springframework.samples.springtravel-2.5.2.20000702-1000.zip" version="2.5.2.20000702-1000"> <description/> </descriptor> <descriptor category="Spring Security" id="org.springframework.security.tutorials.basicsecurity" kind="tutorial" local="false" name="Securing your web application with Spring Security" size="4759272" url="https://dist.springsource.com/release/STS/help/org.springframework.security.tutorials.basicsecurity-1.0.0.zip" version="1.0.0"> <description>This tutorial shows how to configure simple role-based security for a standard web application.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorial.WhatsNewIn25" kind="tutorial" local="false" name="What's new in Spring 2.5" size="13310" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorial.WhatsNewIn25-1.0.0.zip" version="1.0.0"> <description>This cheat sheet demonstrates key concepts that are new in Spring 2.5.</description> <dependency id="org.springframework.samples.petclinic"/> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.addingManagementToYourSpringApplications" kind="tutorial" local="false" name="Adding Management to Your Spring Applications" size="15440" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.addingManagementToYourSpringApplications-1.0.0.zip" version="1.0.0"> <description>This tutorial demonstrates how to instrument your Spring applications for management using Spring, JMX and AOP.</description> <dependency id="org.springframework.samples.petclinic"/> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.gettingstartedwithspringjdbc" kind="tutorial" local="false" name="Getting Started with Spring JDBC" size="8568468" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.gettingstartedwithspringjdbc-1.0.1.zip" version="1.0.1"> <description>This tutorial shows how to get started using Spring JDBC for simple data access.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.jms.creatingmdb" kind="tutorial" local="false" name="Creating JMS-enabled Spring application" size="3675267" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.jms.creatingmdb-1.0.0.zip" version="1.0.0"> <description>This tutorial provides an overview of JMS features with the Spring Framework.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.junit.integrationtestingwithjunit4" kind="tutorial" local="false" name="Integration Testing with JUnit 4" size="7429423" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.junit.integrationtestingwithjunit4-1.0.0.zip" version="1.0.0"> <description>This tutorial will walk developers through the process of creating a JUnit 4 integration test.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.testing.junit3-legacy" kind="tutorial" local="false" name="Integration Testing with JUnit 3 and Spring" size="7438660" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.testing.junit3-legacy-1.0.0.zip" version="1.0.0"> <description>This tutorial will show you how to implement integration tests using the Spring JUnit 3.8 testing framework.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.testing.junit3" kind="tutorial" local="false" name="Integration Testing with JUnit 3 and the Spring TestContext Framework" size="7432757" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.testing.junit3-1.0.0.zip" version="1.0.0"> <description>This tutorial will show you how to implement integration tests using the Spring 2.5+ TestContext framework and JUnit 3.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.txmgmt.addingtxmangagement" kind="tutorial" local="false" name="Adding Declarative Transaction Management to Your Spring Applications" size="3939660" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.txmgmt.addingtxmangagement-1.0.0.zip" version="1.0.0"> <description>his tutorial demonstrates how to apply Spring's support for declarative transaction management.</description> </descriptor> <descriptor category="Spring Framework" id="org.springframework.tutorials.usingstoredprocedures" kind="tutorial" local="false" name="Using Stored Procedures" size="6387472" url="https://dist.springsource.com/release/STS/help/org.springframework.tutorials.usingstoredprocedures-1.0.0.zip" version="1.0.0"> <description>A tutorial for getting started using stored procedures.</description> </descriptor> <descriptor category="Spring Web" id="org.springframework.web.tutorials.creatingcontroller" kind="tutorial" local="false" name="Creating a Controller" size="26558" url="https://dist.springsource.com/release/STS/help/org.springframework.web.tutorials.creatingcontroller-1.0.0.zip" version="1.0.0"> <description>This tutorial will walk developers through the process of creating a @Controller to implement a basic use case end-to-end.</description> <dependency id="org.springframework.samples.springtravel"/> </descriptor> <descriptor category="Spring Web" id="org.springframework.web.tutorials.webprojectoverview" kind="tutorial" local="false" name="Spring Web Development Overview" size="27161" url="https://dist.springsource.com/release/STS/help/org.springframework.web.tutorials.webprojectoverview-1.0.0.zip" version="1.0.0"> <description>This tutorial provides an overview of web development with the Spring Framework.</description> <dependency id="org.springframework.samples.springtravel"/> </descriptor> <descriptor id="org.springframework.webflow.samples.booking.jsf" kind="sample" local="false" name="Hotel Booking Reference App (Spring MVC + Web Flow + JavaServerFaces version)" size="13644612" url="https://dist.springsource.com/release/STS/help/org.springframework.webflow.samples.booking.jsf-2.0.7.20090423-1700.zip" version="2.0.7.20090423-1700"> <description/> </descriptor> <descriptor category="Spring Web Flow" id="org.springframework.webflow.tutorial.GetStarted" kind="tutorial" local="false" name="Get Started with Spring Web Flow" size="8709" url="https://dist.springsource.com/release/STS/help/org.springframework.webflow.tutorial.GetStarted-1.0.0.zip" version="1.0.0"> <description>Learn how to use the Web Flow framework in your Spring application.</description> <dependency id="org.springframework.webflow.samples.booking.jsf"/> <dependency id="cohttp://m.springsource.sts.org.apache.tomcat"/> </descriptor> <descriptor category="Spring Web Services" id="org.springframework.webservices.tutorials.creatingcontroller" kind="tutorial" local="false" name="Creating a contract-first web service" size="9741990" url="https://dist.springsource.com/release/STS/help/org.springframework.webservices.tutorials.creatingcontroller-1.0.0.zip" version="1.0.0"> <description>This tutorial shows you how to create a contract-first web service with Spring-WS. The contract-first approach is an industry recognized best practice. In short it means we'll design an XML contract first and a Java implementation second.</description> <dependency id="cohttp://m.springsource.sts.org.apache.tomcat"/> </descriptor> <descriptor category="Integration" id="org.springframework.integration.sts.template.standalone.simple" kind="template" local="false" name="Spring Integration Project (Standalone) - Simple" requires="[3.0.0,4.0)" requiresbundle="org.eclipse.m2e.core" size="9500" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-standalone-simple-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a Spring Integration project that runs as a standalone Java application using core components only.</description> </descriptor> <descriptor category="Integration" id="org.springframework.integration.sts.template.standalone" kind="template" local="false" name="Spring Integration Project (Standalone) - File" requires="[3.0.0,4.0)" requiresbundle="org.eclipse.m2e.core" size="12100" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-standalone-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a Spring Integration project that runs as a standalone Java application using file polling and file output.</description> </descriptor> <descriptor category="Integration" id="org.springframework.integration.sts.template.war" kind="template" local="false" name="Spring Integration Project (War)" requires="[3.0.0,4.0)" requiresbundle="org.eclipse.m2e.core" size="155900" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-war-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a Spring Integration project that runs within a servlet container. Uses the Spring Integration Twitter adapter.</description> </descriptor> <descriptor category="Integration" id="org.springframework.integration.sts.template.adapter" kind="template" local="false" name="Spring Integration Adapter Template Project" requires="[3.2.0,4.0)" requiresbundle="org.springsource.ide.eclipse.gradle.core" size="122100" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-adapter-1.0.1.RELEASE.zip" version="1.0.1.RELEASE"> <description>Creates a Spring Integration Adapter Template. Requires Gradle Support.</description> </descriptor> <descriptor category="Integration" id="org.springframework.integration.sts.template.adapter" kind="template" local="false" name="Spring Integration Adapter Template Project" requires="[3.0.0,3.2)" size="118119" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-adapter-1.0.0.M4.zip" version="1.0.0.M4"> <description>Creates a Spring Integration Adapter Template. Requires Gradle Support. Deprecated, please update STS to version 3.2+ for the latest template version</description> </descriptor> <descriptor id="org.springframework.integration.sts.template.standalone.simple" kind="template" local="false" name="Spring Integration Project (Standalone) - Simple" requires="[0.0.0,3.0.0)" size="8390" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-standalone-simple-1.0.0.M2.zip" version="1.0.0.M2"> <description>Creates a Spring Integration project that runs as a standalone Java application using core components only. Deprecated, please update STS to version 3.2+ for the latest template version</description> </descriptor> <descriptor id="org.springframework.integration.sts.template.standalone" kind="template" local="false" name="Spring Integration Project (Standalone) - File" requires="[0.0.0,3.0.0)" size="10258" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-standalone-1.0.0.M2.zip" version="1.0.0.M2"> <description>Creates a Spring Integration project that runs as a standalone Java application using file polling and file output. Deprecated, please update STS to version 3.2+ for the latest template version</description> </descriptor> <descriptor id="org.springframework.integration.sts.template.war" kind="template" local="false" name="Spring Integration Project (War)" requires="[0.0.0,3.0.0)" size="56242" url="https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/si-template-war-1.0.0.M2.zip" version="1.0.0.M2"> <description>Creates a Spring Integration project that runs within a servlet container. Uses the Spring Integration Twitter adapter. Deprecated, please update STS to version 3.2+ for the latest template version</description> </descriptor> <descriptor id="org.springframework.templates.mvc" kind="template" local="true" name="Spring MVC Project" requiresbundle="org.eclipse.m2e.core" size="0" version="3.2.2"> <description>A new Spring MVC web application development project</description> </descriptor> <descriptor id="org.springframework.templates.mvc" kind="template" local="true" name="Spring MVC Project" requiresbundle="org.eclipse.m2e.core" size="0" version="3.2.2"> <description>A new Spring MVC web application development project</description> </descriptor> </descriptors>