the lookup works a bit better:

public List<User> getUsers() {
        final Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(System.currentTimeMillis());
        cal.add(Calendar.SECOND, 2);
        try {
            ((TimerService) new
InitialContext().lookup("java:comp/TimerService")).createTimer(cal.getTime(),
"Hi!!!!");
        } catch (Exception e) {
            e.printStackTrace(); // throw a cast exception because of the
wrapper but it works
        }
        return users;
    }

2011/4/17 Romain Manni-Bucau <rmannibu...@gmail.com>

> Hi Thiago,
>
> i have it:
>
> 2011-04-17 19:56:06,293 - WARN  - Injection: No such property
> 'test.ejb.UserImpl/timerService' in class test.ejb.UserImpl
>
> java.lang.NullPointerException
>       test.ejb.UserImpl.getUsers(UserImpl.java:39)
>
> - Romain
>
>
> 2011/4/17 Thiago Veronezi <thi...@veronezi.org>
>
>> Hi devs,
>> I've changed my project to run on TomEE3.2 and on the standalone instance.
>> The standalone version is running fine. You can check it out here:
>> http://dl.dropbox.com/u/1459144/embedded-server.jar
>> Execute "java -jar embedded-server.jar", wait for "Your server is up and
>> running" and access https://localhost:8443/
>>
>> The problem is the war version running on TomEE (both versions 3.2 and
>> trunk). It seems that the resources annotated by "@Resource" (timeservice)
>> are not being injected. Do you know what am i missing here?
>>
>> This is the war file: http://dl.dropbox.com/u/1459144/ROOT.war. My
>> project
>> should be the root project due to my JS files. You should also create a
>> "root" user on "tomcat-users.xml" to be able to login.
>>
>> <role rolename="ROLE_USER"/>
>> <user username="root" password="1234" roles="ROLE_USER"/>
>>
>> This project is a simplified version of the ROOT.war:
>> http://dl.dropbox.com/u/1459144/test.zip
>> You can check the source code of this project to see the problem being
>> reproduced.
>>
>> thanks!
>> Thiago
>>
>
>

Reply via email to