This content has been marked as final.
Show 7 replies
-
1. Re: Web Services
meetoblivion Jan 6, 2009 1:23 AM (in response to learner.klearchosklearchou.yahoo.co.uk)what happens if you make it a seam object, annotate with @Name ?
-
2. Re: Web Services
shane.bryzak Jan 6, 2009 6:59 AM (in response to learner.klearchosklearchou.yahoo.co.uk)Do you have a correctly configured standard-jaxws-endpoint-config.xml in your META-INF dir?
-
3. Re: Web Services
learner.klearchosklearchou.yahoo.co.uk Jan 7, 2009 9:28 AM (in response to learner.klearchosklearchou.yahoo.co.uk)Hello to all,
sorry for my late answer but yesterday I was not available.
I have included the xml that the seam reference states.
The object already contains the @Name.
More specifically
@Name("documentAction")
@Scope(ScopeType.CONVERSATION)
The object is an action that I already use for Seam.
The first line in the web service method is the following:
System.out.println("Application context " + Contexts.isApplicationContextActive() );
System.out.println("Application Context is " + Contexts.getApplicationContext() );
that returns false and null respectively.
What else do you think it could be wrong?
Thank you for your help. -
4. Re: Web Services
learner.klearchosklearchou.yahoo.co.uk Jan 7, 2009 11:45 AM (in response to learner.klearchosklearchou.yahoo.co.uk)Hello I have just now tried to place the @Name at the services object basically and not to the object that I want to receive using the getInstance and it worked!
But why at the Seambay example there is no such an annotation (@Name) and it works?
Tank you again.
-
5. Re: Web Services
learner.klearchosklearchou.yahoo.co.uk Jan 7, 2009 1:44 PM (in response to learner.klearchosklearchou.yahoo.co.uk)Hello,
I have changed the generated task of the build.xml (seam-gen)
and I have simply inserted this extra line:
<include name="standard-jaxws-endpoint-config.xml" />
after the ejb-jar.xml
<target name="jar" depends="compile,copyclasses"
description="Build the distribution .jar file">
<copy todir="${jar.dir}">
<fileset dir="${basedir}/resources">
<include name="seam.properties" />
<include name="*.drl" />
</fileset>
</copy>
<copy todir="${jar.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
<include name="ejb-jar.xml" />
<include name="standard-jaxws-endpoint-config.xml" />
</fileset>
</copy>
<copy tofile="${jar.dir}/META-INF/persistence.xml"
file="${basedir}/resources/META-INF/persistence-${profile}.xml"
overwrite="true"/>
<copy tofile="${jar.dir}/import.sql"
file="${basedir}/resources/import-${profile}.sql"
overwrite="true"/>
</target>
Is this enough?
Thank you, -
6. Re: Web Services
learner.klearchosklearchou.yahoo.co.uk Jan 7, 2009 2:08 PM (in response to learner.klearchosklearchou.yahoo.co.uk)Hello to all,
in order to summarize up to now what I have done.
1. I have included the standard-jaxws-endpoint-config.xml file that in the past I have wrongly just placed it in the correct folder without changing the build.xml file.
2. I removed the @Name("services") from the DocumentServices class because it was not needed anymore (as in seambay example).
3. I have one action called RegisterDocumentAction that contains a register method.
I have inserted a @Begin like this
@Begin(join = true)
public String register()
{
4. When I run the web service I receive an error like this:
14:34:07 ERROR [STDERR] java.lang.IllegalStateException: Transaction begin not d
etected, try installing transaction:ejb-transaction in components.xml
14:34:07 ERROR [STDERR] at org.jboss.seam.transaction.SeSynchronizations
.registerSynchronization(SeSynchronizations.java:57)
5. So I tried to follow the error message and I have inserted the <transaction:ejb-transaction/> at the components.xml
Unfortunately here the Jboss could not start with the following message:
15:04:39 ERROR [core.ContainerBase.[jboss.web].[localhost].[/documnetReader]] Ex
ception sending context initialized event to listener instance of class org.jbos
s.seam.servlet.SeamListener
java.lang.RuntimeException: error while reading /WEB-INF/components.xml
at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Init
ialization.java:154)
at org.jboss.seam.init.Initialization.create(Initialization.java:104)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.j
ava:34)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3856)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
361)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
0)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
Do you have please any ideas regarding the source of the problem ?
Best regards, -
7. Re: Web Services
learner.klearchosklearchou.yahoo.co.uk Jan 9, 2009 11:11 AM (in response to learner.klearchosklearchou.yahoo.co.uk)Finally I found the problem.
The namespace must be declared at the beginning of the XML.
The name space is
xmlns:transaction="http://jboss.com/products/seam/transaction"
Thus the complete XML when we add the <transaction:ejb-transaction />
at the components.xml is
<?xml version="1.0" encoding="UTF-8"?>
<components
xmlns="http://jboss.com/products/seam/components"
xmlns:transaction="http://jboss.com/products/seam/transaction"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:drools="http://jboss.com/products/seam/drools"
xmlns:bpm="http://jboss.com/products/seam/bpm"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:mail="http://jboss.com/products/seam/mail"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
....