Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Java EE 6 Web Profile
Java EE 6 Web Profile [message #1158037] Sun, 27 October 2013 17:14 Go to next message
Harald Wellmann is currently offline Harald WellmannFriend
Messages: 34
Registered: July 2009
Location: Hamburg, Germany
Member
Does Virgo Nano 3.6.2 support the Java EE 6 Web Profile? If partially, which parts are missing?

I'm not able to deploy simple sample apps, e.g. the moviefun.war from openejb/examples.

In particular, I'm having trouble defining a datasource.

Adding the usual stuff to configuration/openejb.xml, I get the following exception in the logs.

java.lang.NullPointerException: null
	at org.apache.derby.jdbc.EmbeddedDriver.acceptsURL(Unknown Source)
	at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1442)


Any ideas?

Thanks,
Harald
Re: Java EE 6 Web Profile [message #1158208 is a reply to message #1158037] Sun, 27 October 2013 19:54 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Quote:
Does Virgo Nano 3.6.2


Do you use Virgo Nano or Virgo Nano Web?

Can you post the configuration in openejb.xml?

Regards
Violeta
Re: Java EE 6 Web Profile [message #1158401 is a reply to message #1158208] Sun, 27 October 2013 23:03 Go to previous messageGo to next message
Harald Wellmann is currently offline Harald WellmannFriend
Messages: 34
Registered: July 2009
Location: Hamburg, Germany
Member
I'm using virgo-nano-full-3.6.2.RELEASE.zip

And I added these two elements to openejb.xml:

    <Resource id="movieDatabase" type="DataSource">
        JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
        JdbcUrl jdbc:derby:memory:movies;create=true
        JtaManaged true
    </Resource>

    <Resource id="movieDatabaseUnmanaged" type="DataSource">
        JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
        JdbcUrl jdbc:derby:memory:movies;create=true
        JtaManaged false
    </Resource>

Re: Java EE 6 Web Profile [message #1161204 is a reply to message #1158401] Tue, 29 October 2013 16:51 Go to previous messageGo to next message
Lazar Kirchev is currently offline Lazar KirchevFriend
Messages: 30
Registered: July 2009
Location: Sofia, Bulgaria
Member
Try to add the resources in context.xml as Tomcat resources and remove them from openejb.xml:

<Resource id="movieDatabase"
type="DataSource"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:memory:movies;create=true"
JtaManaged="true"/>

<Resource id="movieDatabaseUnmanaged"
type="DataSource"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:memory:movies;create=true"
JtaManaged="false"/>

[Updated on: Tue, 29 October 2013 16:53]

Report message to a moderator

Re: Java EE 6 Web Profile [message #1161626 is a reply to message #1161204] Tue, 29 October 2013 23:08 Go to previous messageGo to next message
Harald Wellmann is currently offline Harald WellmannFriend
Messages: 34
Registered: July 2009
Location: Hamburg, Germany
Member
I believe the context.xml syntax would be

<Resource name="movieDatabase"
  type="javax.sql.DataSource"
  driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
  url="jdbc:derby:memory:movies;create=true"/>


But that doesn't help either, I'm still getting the same exception.

Does anybody have any Java EE sample with JPA and a JNDI datasource working on Virgo?

All the samples I've seen so far either don't use JPA, or use OSGi services to provide a datasource.

I also tried other JDBC drivers and had exceptions loading the driver class.

By what kind of magic is the org.apache.commons.dbcp bundle supposed to be able to load driver classes from packages not imported by that bundle?
Re: Java EE 6 Web Profile [message #1162240 is a reply to message #1161626] Wed, 30 October 2013 08:43 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 72
Registered: July 2009
Member
Not exactly your case, as I am using Virgo Server for Apache Tomcat, but this is how I was able to use JNDI in Virgo Server for Apache Tomcat.

http://devshards.blogspot.it/2012/10/global-jndi-support-in-virgo-server-35.html

The post is about virgo 3.5 but works also in 3.6.x.

GianMaria.
Re: Java EE 6 Web Profile [message #1162618 is a reply to message #1162240] Wed, 30 October 2013 14:00 Go to previous messageGo to next message
Harald Wellmann is currently offline Harald WellmannFriend
Messages: 34
Registered: July 2009
Location: Hamburg, Germany
Member
GianMaria, your post is very informative, so is the message really that Virgo Nano Full does not support Java EE 6 out of the box?

IMHO adding fragments for missing imports and for supporting additional JDBC drivers sounds like a workaround for missing functionality.
Re: Java EE 6 Web Profile [message #1162736 is a reply to message #1162618] Wed, 30 October 2013 15:34 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 72
Registered: July 2009
Member
Hello Harald,

I am not a committer of Virgo and I never used Virgo Nano Full: I am using with Virgo Server for Apache Tomcat because I am interested in the OSGi programming model, and I can add that I am very satisfied by Virgo, its feature set and how it performs.

I posted the above link which contains information about Virgo Server for Apache Tomcat, in the hope that it may be helpful to you, but I am now afraid that it may be misleading: Virgo Nano Full is a different server with a different goal and the above may be completely wrong or not appropriate.

With respect to your last sentence IMHO the fact that Virgo Server for Apache Tomcat has a different approach to extensibility does not mean it lacks functionality. IMHO one of the greatest features of Virgo is that it is a very slim application server with a low memory and CPU footprint if compared to other products. The fact that it can be extended via fragments to me looks like a big plus.

GianMaria.


Developing for Virgo using PDE: http://bit.ly/1w0tTit
Global JNDI in Virgo: http://bit.ly/1to42mn
Hyperic to monitor Virgo: http://bit.ly/W1Fst9
Profile Virgo with JProfiler http://bit.ly/1FBLGCw
Re: Java EE 6 Web Profile [message #1162951 is a reply to message #1162736] Wed, 30 October 2013 18:44 Go to previous message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

- I downloaded Virgo Nano Full.
- I added the following to the <VNF>/configuration/context.xml

	<Resource name="movieDatabase" 
			type="javax.sql.DataSource"
			driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
			url="jdbc:derby:movies;create=true"
			JtaManaged="true"/>

	<Resource name="movieDatabaseUnmanaged" 
			type="javax.sql.DataSource"
			driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
			url="jdbc:derby:movies;create=true"
			JtaManaged="false"/>


- I added org.apache.derby bundle to the impl.bunldes property located in <VNF>/configuration/config.ini

impl.bundles=org.eclipse.persistence.jpa;bundle-version\=2.4.1.v20121003-ad44345,org.eclipse.persistence.core;bundle-version\=2.4.1.v20121003-ad44345,org.apache.openwebbeans.impl;bundle-version\=1.1.7.v201304201405,org.apache.openwebbeans.web;bundle-version\=1.1.7.v201304201405,org.apache.openwebbeans.jsf;bundle-version\=1.1.7.v201304201405,org.apache.derby;bundle-version\=10.8.2.2_v201211210650


- I also added to the bootdelegation javax.management.* : <VNF>/configuration/java6-server.profile

org.osgi.framework.bootdelegation = \
 org.eclipse.virgo.nano.authentication,\
 com.sun.*,\
 javax.xml.*,\
 org.apache.xerces.jaxp.*,\
 org.w3c.*,\
 org.xml.*,\
 sun.*,\
 javax.management.*,\
 javax.management


When I request http://localhost:8080/moviefun/setup.jsp I'm receiving:

javax.naming.NameNotFoundException: Name [org.superbiz.moviefun.ActionServlet/moviesBean] is not bound in this Context. Unable to find [org.superbiz.moviefun.ActionServlet].
	org.apache.naming.NamingContext.lookup(NamingContext.java:820)
	org.apache.naming.NamingContext.lookup(NamingContext.java:154)


May be I'm missing some other dependency that is available in Tomee but not in Virgo.


Please note that the steps above (except datasource declaration) are added because the application is not a bundle but a non-OSGI application.

Regards
Violeta
Previous Topic:Running Virgo as a lightweight container with Docker
Next Topic:greenpages sample getting errors on junit test
Goto Forum:
  


Current Time: Thu Mar 28 23:35:30 GMT 2024

Powered by FUDForum. Page generated in 0.02837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top