JBoss Developer: Message List - @Logger not injecting anything in Controller.classMost recent forum messageshttps://developer.jboss.org/community/seam?view=discussionsJive Engage2007-04-17T08:59:56Z2007-04-17T08:59:56ZenRe: @Logger not injecting anything in Controller.classPete Muir/people/pmuirdo-not-reply@jboss.com2007-04-17T08:59:56Z2007-04-17T08:59:56Z<!-- [DocumentBodyStart:8966b713-4ab6-43fd-a3ac-96575aea22f5] --><div class="jive-rendered-content"><p>Seam can't do it's magic if you use new to instantiate a Seam component. You need to use injection (or Component.getInstance())</p></div><!-- [DocumentBodyEnd:8966b713-4ab6-43fd-a3ac-96575aea22f5] --><img src='/beacon?t=1521468753335' />2007-04-17T08:59:56Z10 years 11 months ago0Re: @Logger not injecting anything in Controller.classSean Burns/people/paradigmzado-not-reply@jboss.com2007-04-17T08:12:11Z2007-04-17T08:12:11Z<!-- [DocumentBodyStart:0a3757f7-7807-4c26-821d-ad8cfdd894ea] --><div class="jive-rendered-content"><p>I just commented out the debug line in the source code, and everything is working perfecly, im not sure what to do from here, except use my custom built seam. (I don't really understand how the injection actually works)<br/><br/></p><!--[CodeBlockStart:0f4a2103-0c05-442e-a0d1-b8eb0ff73936][excluded]--><pre class="java" name="code">
protected &lt;T&gt; ClassValidator&lt;T&gt; getValidator(Class&lt;T&gt; modelClass)
{
return Model.forClass(modelClass).getValidator();
}
protected void debug(Object object, Object... params)
{
//log.debug(object, params);
}
protected void debug(Object object, Throwable t, Object... params)
{
log.debug(object, t, params);
}
</pre><!--[CodeBlockEnd:0f4a2103-0c05-442e-a0d1-b8eb0ff73936]--><div style="display:none;"></div><br/><br/></div><!-- [DocumentBodyEnd:0a3757f7-7807-4c26-821d-ad8cfdd894ea] -->2007-04-17T08:12:11Z10 years 11 months ago0@Logger not injecting anything in Controller.classSean Burns/people/paradigmzado-not-reply@jboss.com2007-04-16T13:53:36Z2007-04-16T13:53:36Z<!-- [DocumentBodyStart:5189d72f-dc13-430e-b972-f87f3a49cba7] --><div class="jive-rendered-content"><p>Hi,<br/><br/>I have a simple piece of code that is trying to persist/update the database<br/><br/></p><!--[CodeBlockStart:2b3bab35-36f6-48e1-93b3-32aeb4471c98][excluded]--><pre class="java" name="code">
VweraclientdnamesHome home = new VweraclientdnamesHome();
home.setVweraclientdnamesId(input.getId());
home.getInstance().setUsedForEras(true);
home.update();
</pre><!--[CodeBlockEnd:2b3bab35-36f6-48e1-93b3-32aeb4471c98]--><div style="display:none;"></div><br/><br/>where home is a instance of the EntityHome class <br/><br/>When I run this code I get this null pointer <br/><br/><blockquote class="jive-quote"><br/>Caused by: java.lang.NullPointerException<br/> at org.jboss.seam.framework.Controller.debug(Controller.java:183)<br/> at org.jboss.seam.framework.Home.updatedMessage(Home.java:40)<br/> at org.jboss.seam.framework.EntityHome.update(EntityHome.java:40)<br/> at coza.healthbridge.mypractice.admin.beans.session.EraClientDnamesBean.updateUsedForEras(EraClientDnamesBean.java:62)<br/> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</blockquote><br/><br/>and stepping through a debug it looks like the @Logger is not injecting the object in Controller.class <br/><br/>Any ideas? <br/><br/>I used seam gen (1.2.1) to generate the project and the entities. <br/>I then added another persistance unit to connect to another DB. <br/>I can view all the CRUD pages for both PU's <br/>I then just added this update code, and it is not working (I used seam 1.5 before this and the update code worked with seam gen) <br/><br/>Thanks <br/>Sean. <br/><br/><br/></div><!-- [DocumentBodyEnd:5189d72f-dc13-430e-b972-f87f3a49cba7] -->2007-04-16T13:53:36Z10 years 11 months ago20