Hi guys,

i have got a problem about NullPointer-Exceptions....on my EJB i have got a
method....this one: 

public String[] findOnlineUser() {
        Query query = entityManager.createQuery("SELECT x FROM UserInformation
x WHERE x.online='"+true+"'");
        List<UserInformation> userList = (List<UserInformation>)
query.getResultList();
        String[] users = new String[userList.size()];
        int i=0;
        for(UserInformation user:userList) {
                users[i] = user.getId();
                i++;
        }
        
        if(userList.size()==0)
                return new String[] {};
        
                return users;
    }

On my testprogramm I have got a source code looks like this....

                UserService userService =
service.getPort(UserService.class);
                String[] onlineUsers = userService.findOnlineUser("myId");
                System.out.println(onlineUsers);

My Output > null
But in my method i try to hide the result of "null". Is there any mistake or
is it because XML-Transformation via Webservices (Data - to SOAP - to Data)?

Kind of Regards

george



--
View this message in context: 
http://openejb.979440.n4.nabble.com/NullPointerException-but-i-would-like-hide-it-tp4656534.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to