You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Duruk_Kab <du...@nuware.com> on 2011/02/01 14:23:08 UTC

Tapestry 5.1.0.5 with Virgo server (OSGi)

Hi,

I am migrating my application which was based on OSGi framework from DM
Server 1.0.2 to Virgo.

Before it was using Spring 2.5.6.Instrumented library now it is using Spring
3.5 library.

I used to do below setting in my web.xml for Spring DM Server:
<context-param>
  <param-name>tapestry.use-external-spring-context</param-name> 
  <param-value>true</param-value> 
</context-param>
<filter>
  <filter-name>app</filter-name> 
 
<filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class> 
</filter>

I am unable to deploy this application.

I have attached the application for your reference. 
http://tapestry-users.832.n2.nabble.com/file/n5980927/T5OSGi-ref.zip
T5OSGi-ref.zip 

Please help.

@ DK
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5980927.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Alex Kotchnev <ak...@gmail.com>.
DK,
  see http://tapestry.apache.org/integrating-with-spring-framework.html for
details on how to set up the spring application context in T5.

  On how to inject the service into your page : injecting by ID from the
spring context doesn't work (hence the message that there is no service
named dispatcher - actually, the Tapestry service IDs are different things
from the IDs you specify on the spring beans). If you just use @Inject (w/o
specifying a service ID) should be sufficient, as long as you don't have
multiple implementations of the same service in the spring application
context. If you do, inject the application context and pull the bean
directly from it

Regards,

Alex K

On Tue, Feb 1, 2011 at 11:08 AM, Duruk_Kab <du...@nuware.com> wrote:

>
> Apologies... Web module is not an OSGi module. Other two App and JPA are
> OSGi
> modules. Web is a traditional Java Web module having webapp folder and all
> the configuratiion files.
>
> I tried adding below settings to my web.xml but it gave me deployment
> error.
>
> <!-- CONFIGURE A PARENT APPLICATION CONTEXT -->
>  <context-param>
>    <param-name>contextClass</param-name>
>
>
> <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
>  </context-param>
>  <listener>
>
>
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>  </listener>
>  <!-- DISPATCHER SERVLET CONFIG -->
>  <servlet>
>    <servlet-name>t5osgi</servlet-name>
>
>
> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
>  </servlet>
>  <servlet-mapping>
>    <servlet-name>t5osgi</servlet-name>
>    <url-pattern>/app/*</url-pattern>
>  </servlet-mapping>
>
> How do i specify dispatcher servlet or application context info? Is this a
> right way? Can anyone help me to get a sample project. Please advice.
>
> Thanks,
> DK
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5981568.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Duruk_Kab <du...@nuware.com>.
Apologies... Web module is not an OSGi module. Other two App and JPA are OSGi
modules. Web is a traditional Java Web module having webapp folder and all
the configuratiion files.

I tried adding below settings to my web.xml but it gave me deployment error.

<!-- CONFIGURE A PARENT APPLICATION CONTEXT -->
  <context-param>
    <param-name>contextClass</param-name>
   
<param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
  </context-param>
  <listener>
   
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <!-- DISPATCHER SERVLET CONFIG -->
  <servlet>
    <servlet-name>t5osgi</servlet-name>
   
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>t5osgi</servlet-name>
    <url-pattern>/app/*</url-pattern>
  </servlet-mapping>

How do i specify dispatcher servlet or application context info? Is this a
right way? Can anyone help me to get a sample project. Please advice.

Thanks,
DK
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5981568.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Duruk_Kab <du...@nuware.com>.
These are three OSGi modules. Last Web module uses Tapestry.

JPA has a bean as:
<bean id="uploadServ" class="org.example.T5OSGi.jpa.DefaultDispatcher"/>

and a service which is exposed to be consumed as:
<osgi:service id="uploadDAO" ref="uploadServ"
interface="org.example.T5OSGi.jpa.Dispatcher"
context-class-loader="service-provider" />

Web module consumes this service as:
<osgi:reference id="uploadDAO" interface="org.example.T5OSGi.jpa.Dispatcher"
/>

and uses it to create a bean in servlet:
<bean id="dispatcher" class="org.example.T5OSGi.IndexDispatcher"
p:uploadRepository-ref="uploadDAO">
</bean>

I use this service to call the respective method in Index.java
@Inject
@Service("dispatcher")
private Dispatcher uploadRepository;

The application gets deployed properly, but when I access my Index page...
it gives me this error as: The Service Id is not being defined by any of the
modules.

The same above code used to work properly with Tapestry 5.1.0.5 + spring
2.5.6 + DM Server. But it is not working with Tapestry 5.1.0.5 + spring 3.5
+ Virgo server.

Is this a right way to map the service? I even tried using @InjectService
but still got the same error.

Thanks,
DK
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5981247.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Alex Kotchnev <ak...@gmail.com>.
Duruk,
   when you say you have three modules, do you mean that you have three OSGI
modules or three Tapestry modules ? If these are OSGI modules, is the
service that you're trying to use in the web module made public for the
module (or whatever terminology OSGI uses for that). ?

   It would probably be useful if you pasted a snipped of your page with
only the essentials to show how you're injecting the service that it can't
find.

Regards,

Alex K

On Tue, Feb 1, 2011 at 9:25 AM, Duruk_Kab <du...@nuware.com> wrote:

>
> Hi,
>
> This appliation has three modules:
> 1) App
> 2) JPA
> 3) Web
>
> I have created a Service in JPA module and using that as a reference in Web
> module. The files having these settings are as below:
> JPA - T5OSGi-ref\org.example.T5OSGi.jpa\src\main\resources\META-INF\spring
> Web - T5OSGi-ref\org.example.T5OSGi.web\src\main\webapp\WEB-INF
>
> When I trying to deploy the application on the Virgo server, it is giving
> error as in the image:
> http://tapestry-users.832.n2.nabble.com/file/n5981112/error.jpg
>
> It seems to be the issue with Tapestry. As it is unable to map the service,
> which was working fine with Tapestry 5.1.0.5 and Spring 2.5.6 framework.
>
> Please advice.
>
> @ DK
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5981112.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Igor Drobiazko <ig...@gmail.com>.
The exception message in your screenshot tells your porbably the reason for
your problem. A service with id "dispatcher" is missing.

On Tue, Feb 1, 2011 at 3:25 PM, Duruk_Kab <du...@nuware.com> wrote:

>
> Hi,
>
> This appliation has three modules:
> 1) App
> 2) JPA
> 3) Web
>
> I have created a Service in JPA module and using that as a reference in Web
> module. The files having these settings are as below:
> JPA - T5OSGi-ref\org.example.T5OSGi.jpa\src\main\resources\META-INF\spring
> Web - T5OSGi-ref\org.example.T5OSGi.web\src\main\webapp\WEB-INF
>
> When I trying to deploy the application on the Virgo server, it is giving
> error as in the image:
> http://tapestry-users.832.n2.nabble.com/file/n5981112/error.jpg
>
> It seems to be the issue with Tapestry. As it is unable to map the service,
> which was working fine with Tapestry 5.1.0.5 and Spring 2.5.6 framework.
>
> Please advice.
>
> @ DK
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5981112.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Duruk_Kab <du...@nuware.com>.
Hi,

This appliation has three modules: 
1) App 
2) JPA 
3) Web 

I have created a Service in JPA module and using that as a reference in Web
module. The files having these settings are as below: 
JPA - T5OSGi-ref\org.example.T5OSGi.jpa\src\main\resources\META-INF\spring 
Web - T5OSGi-ref\org.example.T5OSGi.web\src\main\webapp\WEB-INF 

When I trying to deploy the application on the Virgo server, it is giving
error as in the image:
http://tapestry-users.832.n2.nabble.com/file/n5981112/error.jpg 

It seems to be the issue with Tapestry. As it is unable to map the service,
which was working fine with Tapestry 5.1.0.5 and Spring 2.5.6 framework.

Please advice.

@ DK
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5981112.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.1.0.5 with Virgo server (OSGi)

Posted by Alex Kotchnev <ak...@gmail.com>.
Duruk,
  you would have much more luck getting answers if you try to describe what
the issue is , what errors you're getting, etc. I'm not sure too many people
have the time to download/install Virgo (is this an app server ??), deploy
and debug your app.

Regards,

Alex K

On Tue, Feb 1, 2011 at 8:23 AM, Duruk_Kab <du...@nuware.com> wrote:

>
> Hi,
>
> I am migrating my application which was based on OSGi framework from DM
> Server 1.0.2 to Virgo.
>
> Before it was using Spring 2.5.6.Instrumented library now it is using
> Spring
> 3.5 library.
>
> I used to do below setting in my web.xml for Spring DM Server:
> <context-param>
>  <param-name>tapestry.use-external-spring-context</param-name>
>  <param-value>true</param-value>
> </context-param>
> <filter>
>  <filter-name>app</filter-name>
>
>
> <filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
> </filter>
>
> I am unable to deploy this application.
>
> I have attached the application for your reference.
> http://tapestry-users.832.n2.nabble.com/file/n5980927/T5OSGi-ref.zip
> T5OSGi-ref.zip
>
> Please help.
>
> @ DK
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Tapestry-5-1-0-5-with-Virgo-server-OSGi-tp5980927p5980927.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>