2011-08-08 4 views
0

현재 약간의 프로그램을 작성 중이며 Blazeds와 Flex를 함께 사용하려고합니다. Blazeds와 MySQL 데이터베이스 간의 연결은 정상적으로 작동하지만 실행중인 catalina 서버를 통해 RemoteObject를 통해 연결하려고하면 항상 오류 메시지가 나타납니다.Blazeds와 Flex mySQL db 연결

[RPC 오류 faultString = "대상이 'employeeService'가 아닌 대상이 없습니다. 모든 서비스에 등록되어 있습니다. " faultCode = "Server.Processing"faultDetail = "null"] at mx.rpc :: AbstractInvoker/http : //www.adobe.com/2006/flex/mx/internal :: faultHandler() [E : \ dev \ mx.rpc :: Responder/fault() [E : \ dev \ 3.0.x \ frameworks \ projects \ rpc \ 3.0.x \ frameworks \ projects \ rpc \ src \ mx \ rpc \ AbstractInvoker.as : 216] 에서 mx.rpc :: Responder/mx.rpc :: AsyncRequest/fault() [E : \ dev \ 3.0.x \ frameworks \ projects \ rpc \ src \ mx \ rpc \ AsyncRequest.as : src \ mx \ rpc \ Responder.as : 49] mx.messaging :: MessageResponder/status에서 의 NetConnectionMessageResponder/statusHandler()에서 (전자 메일 : \ dev \ 3.0.x \ 프레임 워크 \ 프로젝트 \ rpc \ src \ mx \ 메시징 \ 채널 \ NetConnectionChannel.as : 523)) [E : \ dev에 \ 3.0.x의 \ 프레임 워크 \ 프로젝트 \ RPC \ SRC \ MX \ 메시징 \ MessageResponder.as : 222]

내가 원격-config 파일과 최종 도착 확인 ination이 거기에있다. Catalina를 구성해야합니까? 내가 생각할 수있는

+0

구성 파일을 수정 한 후 서버를 다시 시작 했습니까? – dtuckernet

답변

0

그냥 몇 가지 ...

  • 당신의 플렉스 프로젝트가 서버를 참조 올바르게 설정되어 있는지 확인합니다. 프로젝트 -> 속성 -> Flex 서버.
  • 서버 구성과 관련하여 플렉스 메시징 및 블레이즈 드 병을 프로젝트 또는 서버 lib에 추가 했습니까?
  • 소리가 나는 것처럼 들리지만 실제로는 이러한 문제가 실제로 해결되었습니다. 이러한 유형의 변경 후에도 서버를 다시 시작하고 프로젝트, 서버 및 서버 작업 디렉토리를 정리하십시오. '이클립스를 통해 내 Tomcat 서버) 당신이 문제로 계속 실행하고 확신이 있다면
  • 것은이 구성 될 수있다에이 일을 해요 봄 플렉스/mysql을/블레이즈 DS를 사용하여 turnkey
+0

플렉스 앱의 서버 설정을 확인하고, blazeds java 앱을 정리하고, 내 아파치 서버를 시작하고 재시작했습니다. 나는 이미 턴키를 사용하고있다. 조금 호기심이 있지만 제공된 hsqldb에 연결하려고하면 모든 데이터를 원하는 플렉스 앱에 전달합니다. 어쨌든 고마워. –

3

을 사용하여 4

lib 안에 jour가 필요함

sping-flex-core-1.5 
mysql-connector-java-5.1.10 
org.springframework.beans-3.0.5.RELEASE 
org.springframework.context-3.0.5.RELEASE 
org.springframework.jdbc-3.0.5.RELEASE..etc 

직원 VO 액션 스크립트를 작성

[Bindable] 
[RemoteClass (alias="com.model.employee.Employee")] 
public class Employee 

자바 측 패키지 com.model.employee;

Employee.java

EmployeeService.java (인터페이스) .. getEmployeeById (INT 아이디)

EmployeeServiceImpl.java

@Service("employeeService") 
@RemotingDestination(channels = { "my-amf", "my-secure-amf" }) 
public class EmployeeServiceImpl implements EmployeeService { 

private final DataSource dataSource; 

public UserServiceImpl(DataSource dataSource) { 
    this.dataSource = dataSource; 
} 

@RemotingInclude 
public Employee getEmployeeById(int id) { 
    Employee employee= new Employee(); 
    Connection c = null; 
    try { 
     c = this.dataSource.getConnection(); 
     PreparedStatement ps = c.prepareStatement("SELECT * FROM employee WHERE employee_id=?"); 
     ps.setInt(1, id); 
     ResultSet rs = ps.executeQuery(); 
     if (rs.next()) { 
      employee= new Employee(); 
      employee.setEmployeeId(rs.getInt("employee_id")); 
      employee.setEmployeeName(rs.getString("employee_name")); 
     } 
    } catch (Exception e) { 
     e.printStackTrace(); 
     throw new RuntimeException(e); 
    } 
    return employee; 
} 

지역 준수 클래스 WEB-INF/클래스

WEB-INF/appicationContext.xml

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:flex="http://www.springframework.org/schema/flex" 
xmlns:context="http://www.springframework.org/schema/context" 
xmlns:tx="http://www.springframework.org/schema/tx" 
xmlns:jdbc="http://www.springframework.org/schema/jdbc" 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/flex 
    http://www.springframework.org/schema/flex/spring-flex-1.5.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd 
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
    http://www.springframework.org/schema/jdbc 
    http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd"> 

<flex:message-broker> 
    <flex:remoting-service default-channels="my-amf" /> 
    </flex:message-broker> 

<context:annotation-config /> 
<context:component-scan base-package="com.model" /> 

<tx:annotation-driven /> 

<bean id="employeeService" class="com.model.employee.EmployeeServiceImpl"> 
    <constructor-arg ref="dataSource" />   
</bean> 

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> 

    <property name="driverClassName" value="com.mysql.jdbc.Driver"/> 
    <property name="url" 
    value="jdbc:mysql://dxfcmm:3306/eunice? autoReconnect=true&amp;zeroDateTimeBehavior=convertToNull"/> 
    <property name="username" value="XXX" /> 
    <property name="password" value="YYY" /> 
    <property name="validationQuery" value="SELECT 1"/> 
</bean> 

remote-config가 필요하지 않습니다.xml

톰캣을 시작하십시오. 정보 : Remoting destination 'employeeService'가 시작되었습니다. 성공적으로 시작되었습니다.

IN MMXL [Bindable] private var empl : Employee;

resultHandler 호 roEmp.getEmployeeById (ID) = empl를 종업원 등으로 event.result RemoteObject에 roEmp 정의;