0

Call EJB3 session bean from zk zul page

asked 2010-08-28 00:28:56 +0800

masum gravatar image masum
33 1
www.optinfra.com

updated 2010-08-28 11:24:48 +0800

Hi ,
I am trying this example.
http://www.zkoss.org/smalltalks/jndi/
I am using ZK+EJB3+jboss5.1+mysql+netbeans .My /WEB-INF/jboss-web.xml file is descripe belllow.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Service Reference 4.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
<jboss-web>
<ejb-local-ref>
<ejb-ref-name>personLocalBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>demo.PersonBeanLocal</local>
<local-jndi-name>ZkEJB3Demo/PersonBean/local</local-jndi-name>
</ejb-local-ref>
</jboss-web>


----------------------------------------------------------------------------------------------------------------------------
Here I have mentioned : ''ejb-ref-type'
but when I am run this zk web client then I have found that :
Element type "ejb-ref-type" must be declared. @ vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/DemoWeb.war/WEB-INF/jboss-web.xml[7,17]

Any one give me a idea ,how to solve this problem ?
-------------------------------------------------------------------------------------------------------------------------------------
Jboss server log status is following :ERROR
---------------------------------------------
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element type "ejb-ref-type" must be declared. @ vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/DemoWeb.war/WEB-INF/jboss-web.xml[7,17]
------------------------------------------------------------------------------------------------------------------------------------

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2010-08-30 20:00:33 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi masum
As the message say "ejb-ref-type" must be declared
You have to use a new tag of jboss config

link publish delete flag offensive edit

answered 2010-08-31 05:27:51 +0800

masum gravatar image masum
33 1
www.optinfra.com

Hi
Thanks your suggestion.

link publish delete flag offensive edit

answered 2010-09-13 23:08:24 +0800

aktejo gravatar image aktejo
155 3

Hi jimmy,.. Integrating EJB with zk is (actually) exciting and convenient. I follow the instruction in http://www.zkoss.org/smalltalks/jndi/ and it works like a charm.

but i wonder that it doesn't work if I put the tag ' <?variable-resolver class="org.zkoss.zkplus.jndi.JndiVariableResolver" ?>' other than index.zul (zuls included after the index.zul)
fyi I am using MVC "apply" pattern go control zuls (GenericForwardComposer subclass).

the variable resolver only works on index.zul and its controller.

any idea?

link publish delete flag offensive edit

answered 2010-09-19 10:18:34 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi aktejo
<?variable-resolver class="org.zkoss.zkplus.jndi.JndiVariableResolver" ?> only can exist in one zul page
You can just put it on root page

link publish delete flag offensive edit

answered 2010-10-12 08:03:59 +0800

masum gravatar image masum
33 1
www.optinfra.com

updated 2010-10-12 08:05:05 +0800

hi ,
Every EJB3 has one local interface and Remote interface. local interface for same jvm .Remote interface for different jvm.
so, Interface using for client access to ejb session . but zkoss use @localbinding and @ remotebinding . I am not sure
when use localbinding with my zkapplication .
anyone give me a idea ?

Thanks
Masum

link publish delete flag offensive edit

answered 2010-10-14 20:32:45 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

zkoss use @localbinding
what zk feature do you use?

link publish delete flag offensive edit

answered 2010-10-16 11:23:11 +0800

masum gravatar image masum
33 1
www.optinfra.com

hi
I am use EJB3 session bean in zkoss application .

link publish delete flag offensive edit

answered 2010-10-25 20:25:48 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

OK, both two annotation are in EJB3,
You can refer to the following link
http://www.anyang-window.com.cn/ejb30-in-the-jndi-bindings-and-multi-channel-transmission/

link publish delete flag offensive edit

answered 2012-12-06 06:07:03 +0800

aktejo gravatar image aktejo
155 3

I have weird zk variable resolver ejb binding behavior.

It works as usual when I didn't put zk.xml into classpath (WEB-INF/zk.xml)
But if i put zk.xml ( to set disable event thread false) the automatic binding only happend on index.zul. the other zul included after cannot find ejb reference from variable resolver.

fyi, I am using zk 5.0.5. this happend only when i deploy apps to websphere (8.0 - 8.5). it is ok on Glassfish.

Any idea ?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-08-28 00:28:56 +0800

Seen: 1,668 times

Last updated: Dec 06 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More