[Javalist] Spring kerdesek

Zsombor gzsombor at gmail.com
2012. Jún. 4., H, 21:08:46 CEST


A legegyszerűbb, ha felveszed az xml-edbe az adott beant, és csak az
autowiringot bízod a springre. (Lehet, hogy magát az osztályt sem tudja
betölteni - valami class hiányzik, vagy nativ cucc a működéséhez, stb ...)

Üdv
 Zs

2012/6/4 Böszörményi Péter <zmblevlist at gmail.com>

> Hat, nem lettem okosabb. :( Azt hiszem ebben az esetben felesleges az
> annotacio, es a bean tag az xml-ben. Az egyiket nyugodtan kidobhatod. A
> spring context inicializalaskor kiirkalja, hogy milyen singleton
> objektumokat hoz letre. Ott ellenorizheted, hogy leteznek-e a beanek a
> contextben. Esetleg debug szintre lehet allitani a logot, akkor latszik,
> hogy miket csinal inicializalas kozben.
>
> Masik otlet: nem lehet, hogy valami classloader kavarodas van, es emiatt
> nem passzolnak az osztalyok?
>
>
> On Mon, 04 Jun 2012 19:50:27 +0200, zamek <zamek at vili.pmmf.hu> wrote:
>
>  06/04/2012 07:15 PM keltezéssel, Böszörményi Péter írta:
>>
>>> Meg lehetne tekinteni, hogy pontosan hogyan nez ki az xml, mik, es
>>> hogyan lettek annotalva, milyen csomagokban vannak az osztalyok?
>>>
>>>  Persze, csak a relevans reszeket masoltam ki, hogy minel rovidebb
>> legyen. A DeviceServiceImpl mukodik, a kliens hivasait tudja fogadni.
>>
>> applicationContext.xml
>> ==============================**========================
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.**springframework.org/schema/**beans<http://www.springframework.org/schema/beans>
>> "
>>     xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<http://www.w3.org/2001/XMLSchema-instance>"
>> xmlns:aop="http://www.**springframework.org/schema/aop<http://www.springframework.org/schema/aop>
>> **"
>>     xmlns:context="http://www.**springframework.org/schema/**context<http://www.springframework.org/schema/context>"
>> xmlns:tx="http://www.**springframework.org/schema/tx<http://www.springframework.org/schema/tx>
>> "
>>     xsi:schemaLocation="http://**www.springframework.org/**schema/beans<http://www.springframework.org/schema/beans>
>>             http://www.springframework.**org/schema/beans/spring-beans-**
>> 2.5.xsd<http://www.springframework.org/schema/beans/spring-beans-2.5.xsd>
>>             http://www.springframework.**org/schema/context<http://www.springframework.org/schema/context>
>>            http://www.springframework.**org/schema/context/spring-**
>> context-2.5.xsd<http://www.springframework.org/schema/context/spring-context-2.5.xsd>
>> ">
>>
>> <context:component-scan base-package="com.zamek.**monitor.gwt.server"/>
>>
>> <bean id="getDeviceData" class="com.zamek.monitor.gwt.**
>> server.device.communication.**DeviceServiceImpl"/>
>>
>>
>> </beans>
>> ==============================**========================
>>
>> web.xml:
>> ==============================**========================
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<http://www.w3.org/2001/XMLSchema-instance>
>> "
>>          xsi:schemaLocation="http://**java.sun.com/xml/ns/javaee<http://java.sun.com/xml/ns/javaee>
>>               http://java.sun.com/xml/ns/**javaee/web-app_2_5.xsd<http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd>
>> "
>>          version="2.5"
>>          xmlns="http://java.sun.com/**xml/ns/javaee<http://java.sun.com/xml/ns/javaee>
>> ">
>>
>> <!-- Servlets -->
>> <context-param>
>> <param-name>**contextConfigLocation</param-**name>
>> <param-value>/WEB-INF/**applicationContext.xml</param-**value>
>> </context-param>
>>
>> <listener>
>> <listener-class>org.**springframework.web.context.**
>> ContextLoaderListener</**listener-class>
>> </listener>
>>
>> <servlet>
>> <servlet-name>**springGwtRemoteServiceServlet<**/servlet-name>
>> <servlet-class>org.spring4gwt.**server.**SpringGwtRemoteServiceServlet<**
>> /servlet-class>
>> </servlet>
>>
>>
>> <servlet-mapping>
>> <servlet-name>**springGwtRemoteServiceServlet<**/servlet-name>
>> <url-pattern>koszovo/**deviceServices/*</url-pattern>
>> </servlet-mapping>
>>
>> <!-- Default page to serve -->
>> <welcome-file-list>
>> <welcome-file>Koszovo.html</**welcome-file>
>> </welcome-file-list>
>>
>> </web-app>
>> ==============================**========================
>>
>> PollingService.java
>> ==============================**========================
>> package com.zamek.monitor.gwt.server;
>>
>> import javax.annotation.**PostConstruct;
>>
>> import org.springframework.context.**annotation.Scope;
>> import org.springframework.**stereotype.Component;
>>
>> @Component
>> @Scope("singleton")
>> public class PollingService {
>>
>> }
>> ==============================**========================
>>
>> DeviceServiceImpl.java
>> ==============================**========================
>> package com.zamek.monitor.gwt.server.**device.communication;
>>
>> import org.springframework.beans.**factory.annotation.Autowired;
>> import org.springframework.**stereotype.Service;
>>
>> import com.google.gwt.user.server.**rpc.RemoteServiceServlet;
>> import com.zamek.monitor.gwt.client.**device.communication.**
>> DeviceService;
>> import com.zamek.monitor.gwt.server.**PollingService;
>>
>> @Service("getDeviceData")
>> public class DeviceServiceImpl extends RemoteServiceServlet implements
>>         DeviceService {
>>
>>     @Autowired
>>     PollingService pollingService;
>>
>>     @Override
>>     public Response<Map<String, Pojo>> getDeviceData() {
>>     }
>> }
>> ==============================**========================
>>
>>
>
> --
> Üdvözlettel,
> Böszörményi Péter
>
> ______________________________**_________________
> Javalist mailing list
> Javalist at lists.javaforum.hu
> http://lists.javaforum.hu/**mailman/listinfo/javalist<http://lists.javaforum.hu/mailman/listinfo/javalist>
>
--------- következő rész ---------
Egy csatolt HTML állomány át lett konvertálva...
URL: <http://lists.javaforum.hu/pipermail/javalist/attachments/20120604/bc58c6ec/attachment.html>


További információk a(z) Javalist levelezőlistáról