Problem with simple h:form, h:selectManyListbox and h:commandButton


I'm currently having trouble with this simple form getting working:

<h:form id="choose_projects_form">
	<div class="table_big">
		<div class="table_header">
			<h:outputText value="#{msg.USER_REPORTS_CHOOSE_PROJECTS_TITLE}" />
		</div>

		<div class="para">
			<div class="form_label">
				<h:outputLabel for="selectedProjects" value="#{msg.USER_CHOOSE_PROJECTS}" />
			</div>

			<div class="form_field">
				<h:selectManyListbox styleClass="projects" id="selectedProjects" size="5" value="#{choosenProjectsReportsController.selectedProjects}" required="true" requiredMessage="#{msg.USER_FIELD_SELECTED_PROJECT_REQUIRED}">
					<f:converter converterId="ProjectConverter" />
					<f:selectItems value="#{choosenProjectsReportsController.availableProjects}" var="project" itemValue="#{project}" itemLabel="#{msg[project.i18nKey]}" />
				</h:selectManyListbox>
			</div>

			<div class="clear"></div>

			<h:message for="selectedProjects" errorClass="errors" fatalClass="errors" warnClass="errors" showSummary="true" />
		</div>

		<div class="para notice">
			<h:outputText value="#{msg.USER_CHOOSE_PROJECTS_NOTICE}" />
		</div>

		<div class="table_footer">
			<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
			<h:commandButton styleClass="submit" type="submit" action="#{choosenProjectsReportsController.doChooseProjects()}" value="#{msg.BUTTON_SHOW_CHOOSEN_PROJECT_STATISTICS}" />
		</div>
	</div>
</h:form>

The backing bean (web controller) has this defined:

...
import javax.enterprise.context.SessionScoped;
...
@Named ("choosenProjectsReportsController")
@SessionScoped
public class ReportsChoosenCustomersWebSessionBean extends BaseReportsController implements ReportsChoosenCustomersWebSessionController {
...
private final List<ReportProject> availableProjects; // +getter as no setter is needed/possible
...
private ReportProject selectedProjects[]; // + getter/setter
...
}

In constructor the list is initialized, in a @PostConstruct method it is being filed (ReportProject is an enumeration).

All projects are being shown an the selectManyListbox and commandButton are both correctly being rendered. If it select one (or more) and hit the submit button, a POST request goes.

The problem is that doChooseProjects() is not being invoked and also the converter's getAsObject() method is not invoked. Also no error message shows up (including log file).

A search on Internet like "selectManyListbox converter action not invoked" (no quotes) doesn't turn up any useful.

Glasfish / Payara sometimes throw ClassCastException


I sometimes get this error message after I have redeployed (also with in-place deployment) a WAR project and have tried to use a JSF form:

Warnung: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
java.lang.ClassCastException: Object is not of remote type java.rmi.Remote
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:254)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:150)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$12.read(DynamicMethodMarshallerImpl.java:352)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:482)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:201)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:150)
at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:226)
at com.sun.ejb.codegen._GenericEJBHome_Generated_DynamicStub.create(com/sun/ejb/codegen/_GenericEJBHome_Generated_DynamicStub.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:421)
at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:75)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:527)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:487)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at de.chotime.jreports.beans.contact.ReportsContactWebSessionBean.<init>(ReportsContactWebSessionBean.java:237)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:119)
at org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:92)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:78)
at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:116)
at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:180)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:158)
at org.jboss.weld.util.bean.IsolatedForwardingBean.create(IsolatedForwardingBean.java:45)
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:76)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.get(ContextualInstanceStrategy.java:178)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:67)
at org.jboss.weld.event.ObserverMethodImpl.getReceiver(ObserverMethodImpl.java:339)
at org.jboss.weld.event.ObserverMethodImpl.getReceiverIfExists(ObserverMethodImpl.java:326)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:284)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:265)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:271)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:260)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:89)
at de.chotime.jreports.beans.login.ReportsUserLoginWebSessionBean.doUserLogin(ReportsUserLoginWebSessionBean.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.el.ELUtil.invokeMethod(ELUtil.java:332)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:537)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
at com.sun.el.parser.AstValue.invoke(AstValue.java:283)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:745)

My previous #JavaEE trainer said it is a bug in #Glassfish / #Payara but it starts to become more anoying. Does someone know something to prevent this from happening?

Yes, filling out a bug report may help. :-) But maybe there is a trick or so?

The most "outter" exception says:

javax.servlet.ServletException: javax.faces.view.facelets.FaceletException: javax.naming.NamingException: Lookup failed for 'java:global/jreports-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: ejb ref resolution error for remote business interfaceorg.mxchange.jcontacts.contact.ContactSessionBeanRemote [Root exception is java.lang.ClassCastException]]

The interface in question (see the JNDI string end) "ContactSessionBeanRemote" is annotated with @Remote (javax.ejb.Remote) and not java.rmi.Remote as the exception says.

It is declared as following:

public interface ContactSessionBeanRemote extends Serializable {
...
}

Local "connect" not working


I think I found a #bug in #friendica, latest develop code. I have rebased my branch to latest changes and revert all of my is_filled_array() changes to dba::is_result().

So what I did was I created an account for my wife and tried to connect to but all I got was a redirect and no entry in table 'intro'. There is also no entry of her account in 'fcontact'.

So what is wrong?

Poller cron job reports error


The latest #develop code reports a problem started by poller.php:

PHP Warning: Invalid argument supplied for foreach() in /home/.../public_html/friendica/include/poller.php on line 208
PHP Stack trace:
PHP 1. {main}() /home/.../public_html/friendica/include/poller.php:0
PHP 2. poller_run() /home/.../public_html/friendica/include/poller.php:265
PHP 3. poller_kill_stale_workers() /home/.../public_html/friendica/include/poller.php:58


Maybe again some better variable tests? And I saw a message this #friendica installation is having problems, several hits on F5 (reload) key brought it back again.

Glassfish versus Wildfly (Tomcat EE) with custom JARs


I'm currently setting up a #Glassfish container for letting run my #JavaEE applications (will be #GNU #GPLv3 or maybe later #Affero) as this was later my choice after a previous unsuccessful attempt with #WildFly (LAN only).

Back what happened before. First of, I had Glassfish 4.1.1 which is currently bugged (#RuntimeException) and doesn't allow me to setup essential things like #JBDC resources or connection pools. So I tried WildFly next.

My applications have custom JARs (libs) which in Glassfish I need to copy to $DOMAIN_HOME/lib/ (and the #MySQL connector to $GLASSFISH_HOME/modules/) and that is all. With WildFly I had trouble even setting up a really simple #EJB (logging with #log4j over a local interface), because I was not able to find to where to my custom JARs (some really simple JARs are required + log4j). So I tried to setup all as modules (module.xml) but no success.

After many unsuccessful attempts I switched back to #Glassfish and found an older (but working) 4.1 version which finally let my applications and the #JPA stuff all work correctly.

Sadly, I now have to "hang around" with #Oracle which is known to be slow in fixing bugs ... But at least my applications are running ...

Not really a good argument for switching to WildFly or #TomcatEE, right? Or where do I have to put my JARs (and log4j)?

(&$a) in method/function headers?


I found this thing very often in #Friendica code:
bla.php:
&lt;?php
function bla_init(&amp;$a) {
  $a-&gt;doSomething();
}

Why & here? Is this an old way of code style? Well, it allows me to modify $a into anything I want, also something incompatible, like this:
bad.php:
&lt;?php
function bad_init(&amp;$a) {
$a = 'Something else';
$a = 0.0001; // Also works!
}

You really don't want this! Better use this:
better.php
&lt;?php
function better_init(App $a) {
  $a-&gt;doItSecurely();
}

Now you (the naughty programmer) cannot change $a into something nasty anymore.

Messages not viewable in #master


Currently I cannot view any messages here in #friendica due to a bug there:

Warning: Invalid argument supplied for foreach() in /var/www/.../htdocs/mod/message.php on line 552

Warning: Cannot modify header information - headers already sent by (output started at /var/www/.../htdocs/mod/message.php:552) in /var/www/.../htdocs/index.php on line 559

Ehemalige GEZ fragt bei meiner Frau an ...


Der #Beitreibungsservice, auch als #GEZ bekannt, ... ehm, upps, wohl was verdreht ... ;-)

Naja, jedenfalls haben die sich bei meiner auslaendischen Frau gemeldet, neue Adresse und alter Name ... Wiedermal typisch. Vermutlich hat das niemand gemerkt, weil die einfach fleissig beim Generieren von "Beitragskonten" sind, dass sie zwar umgezogen, aber ihren Namen auf meinen geaendert hat?

Dieser Verein (kriminell in jeder Hinsicht) ist mit unter anderem der Grund, weshalb ich immer ernsthafter ueber #auswandern nachdenke und immer mehr plane, als nur "aus Spass" zu gucken.

Soll ich eurer Meinung nach besser eine #Kopie unserer #Eheurkunde beifuegen, oder werden die nur beglaubigte annehmen? Auf einen Anruf bei denen habe ich momentan wenig Laune ...

WhatsApp/Facebook or Friendica?


I have just finished talking with my mother on the phone. She said, most of her real-world friends are on #WhatsApp because most are there (or on #Facebook which she still dislikes).

I recommended #Friendica to her to try it out and gave her the hint that there is tryfriendica.de where she can try it out (in German language as she prefers). Still she feels "exotic" there because most of her friends are on WhatsApp as I wrote above.

Well, I don't want to force her to come to us, only to recommend to go away from #corporate "social networks" such as the "usual suspects" are, bloated with #advertisement everywhere.

She knows that the #TOS of #Facebook has the entry that all her data she enters there (text, images, videos) exclusively belongs to #MarkZuckerberg then for an infinite amount of time. But it looks like that the #honey-swarm-phenomena may win over prostituting herself. :-(

Well, at least she gives it a try. So keep fingers crossed!



@dragnucs After #RIPTwitter a lot of users from there flooded !gnusocial with new accounts - the absolute majority of them were shitposters. Admins had a very long night to ban and delete all this nonsens. On the other side this rised a the big rumour in twitter that !gnusocial is a censored network. Well - a very short summary....

Wenn ich das schon wieder lese ...


musst #WildFly, #Spring, #JPA, #Node, #Grunt, #AMD, #jQuery, #Sass nicht googeln


... dann kommt einem wieder die Galle hoch. :-( Wieder astronomische Anforderungen. Aber ja, man muss ja nicht alles koennen ...

Wissen diese Firmen eigentlich, wie viel da im Einzelnen hinter steckt? Hmm? Noe, wieso auch, einfach mal alles auflisten, was einem in den Sinn kommt.

Aber gut, ich bewerbe mich natuerlich weiter. :-/