Re: [xwiki-users] Configuring JNDI data sourse

2008-04-11 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
Hi!

[EMAIL PROTECTED] wrote:
 Hi,

   Configure JNDI data store in application container, where you xwiki
 instance is running.
 How it should be done ? can any one help?

 Regards,
 Project trainees.

Have you picked up the statement up here from 
http://xwikisql.gradsoft.ua/docs/XWikiSqlPluginGuide.html ? I think it 
will be clearer for everybody if you include this link or any other 
pointing to the source of the information!

JNDI could be used for accessing any database, but this is a matter 
concerning Java, more than XWiki: you don't want to use a JNDI 
datasource for XWiki to store its database (or you do, but this is not 
what I understand from your messages :-)

Being this table within XWiki schema, there is a lot of methods in XWiki 
API that will allow you to gain access to this data.

But if you want to use the familiar SQL, XWikiSql plugin from GradSoft 
and/or Groovy groovy.sql.Sql can be of help. XWikiSQL plugin requires a 
JNDI source to be defined. groovy.sql.Sql doesn't. But I don't know what 
of both betters is the best one or it could depend on the scenario.

As for Groovy, look for instance at this simple script I am using to 
retrieve data from another MySQL database:

%
import groovy.sql.Sql
db = Sql.newInstance(jdbc:mysql://myhost/mydatabase, username, 
password, com.mysql.jdbc.Driver)
List samplesIA = db.rows('SELECT * FROM saltmines s where es like I 
and ess like A and ids=1')
%

As I am trying to understand how this must be done, I will this thread 
posted with any new finding or solution. Your feedback is more than 
welcome! Thanks.

Hope this helps,

Ricardo

-- 
Ricardo Rodríguez
Your EPEC Network ICT Team

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Configuring JNDI data sourse

2008-04-10 Thread Aleksandar Vidakovic
Salut project trainees,

I use XWiki 1.3 and changed the hibernate.cfg.xml like this:

[config]

?xml version='1.0' encoding='utf-8'?
!DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate 
Configuration DTD//EN
 
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;
!-- Template for hibernate configuration. processing by maven using 
profiles.
  Replace original src/main/webapp/WEB-INF/hibernate.cfg.xml --
hibernate-configuration
   session-factory

 property name=show_sqlfalse/property
 property name=use_outer_jointrue/property

!--
 property name=dbcp.defaultAutoCommitfalse/property
 property name=dbcp.maxActive50/property
 property name=dbcp.maxIdle5/property
 property name=dbcp.maxWait3/property
 property name=dbcp.whenExhaustedAction1/property
 property name=dbcp.ps.whenExhaustedAction1/property
 property name=dbcp.ps.maxActive20/property
 property name=dbcp.ps.maxWait12/property
 property name=dbcp.ps.maxIdle20/property
--

 !-- Datasource configuration. --
 property name=connection.datasourcejava:jdbc/XWikiDS/property
 property 
name=dialectorg.hibernate.dialect.PostgreSQLDialect/property
 mapping resource=xwiki.hbm.xml/
 mapping resource=feeds.hbm.xml/

   /session-factory
/hibernate-configuration

[/config]

Hope this helps.

Cheers,

Aleks

[EMAIL PROTECTED] wrote:
 Hi,
 
   Configure JNDI data store in application container, where you xwiki
 instance is running.
 How it should be done ? can any one help?
 
 Regards,
 Project trainees.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
 

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Configuring JNDI data sourse

2008-04-10 Thread project_trainees
Hi,
   We are using XE 1.2.1 and Mysql 5.0.

  I configured hibernate.cfg.xml using the given code but it showing
an error when pointing the browser to
http://localhost:8181/xwiki/bin/view/main/webhome

HTTP ERROR: 500

Error number 3 in 0: Could not initialize main XWiki context
Wrapped Exception: Error number 3001 in 3: Cannot load class
com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager
from param xwiki.store.migration.manager.class
Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
Wrapped Exception: Could not parse configuration:
file:/C:/xwiki_home/webapps/xwiki/WEB-INF/hibernate.cfg.xml

RequestURI=/xwiki/bin/view/main/webhome

Powered by Jetty://

Can U help?

Thanks.
Regards,
Project trainees.

Aleks wrote:
Salut project trainees,

 I use XWiki 1.3 and changed the hibernate.cfg.xml like this:

 [config]

 ?xml version='1.0' encoding='utf-8'?
 !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate
 Configuration DTD//EN

 http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;
 !-- Template for hibernate configuration. processing by maven using
 profiles.
   Replace original src/main/webapp/WEB-INF/hibernate.cfg.xml --
 hibernate-configuration
session-factory

  property name=show_sqlfalse/property
  property name=use_outer_jointrue/property

 !--
  property name=dbcp.defaultAutoCommitfalse/property
  property name=dbcp.maxActive50/property
  property name=dbcp.maxIdle5/property
  property name=dbcp.maxWait3/property
  property name=dbcp.whenExhaustedAction1/property
  property name=dbcp.ps.whenExhaustedAction1/property
  property name=dbcp.ps.maxActive20/property
  property name=dbcp.ps.maxWait12/property
  property name=dbcp.ps.maxIdle20/property
 --

  !-- Datasource configuration. --
  property name=connection.datasourcejava:jdbc/XWikiDS/property
  property
 name=dialectorg.hibernate.dialect.PostgreSQLDialect/property
  mapping resource=xwiki.hbm.xml/
  mapping resource=feeds.hbm.xml/

/session-factory
 /hibernate-configuration

 [/config]

 Hope this helps.

 Cheers,

 Aleks

 [EMAIL PROTECTED] wrote:
 Hi,

   Configure JNDI data store in application container, where you xwiki
 instance is running.
 How it should be done ? can any one help?

 Regards,
 Project trainees.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users


 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users


___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Configuring JNDI data sourse

2008-04-10 Thread Aleksandar Vidakovic
To use JNDI you have to define a datasource (it seems that you haven't 
done this).

The configuration of a datasource depends on which container you use. In 
your case (Jetty) go to http://docs.codehaus.org/display/JETTY/JNDI and 
see section Configuring DataSources.

Cheers,

Aleks

[EMAIL PROTECTED] wrote:
 Hi,
We are using XE 1.2.1 and Mysql 5.0.
 
   I configured hibernate.cfg.xml using the given code but it showing
 an error when pointing the browser to
 http://localhost:8181/xwiki/bin/view/main/webhome
 
 HTTP ERROR: 500
 
 Error number 3 in 0: Could not initialize main XWiki context
 Wrapped Exception: Error number 3001 in 3: Cannot load class
 com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager
 from param xwiki.store.migration.manager.class
 Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
 Wrapped Exception: Could not parse configuration:
 file:/C:/xwiki_home/webapps/xwiki/WEB-INF/hibernate.cfg.xml
 
 RequestURI=/xwiki/bin/view/main/webhome
 
 Powered by Jetty://
 
 Can U help?
 
 Thanks.
 Regards,
 Project trainees.
 
 Aleks wrote:
 Salut project trainees,
 I use XWiki 1.3 and changed the hibernate.cfg.xml like this:

 [config]

 ?xml version='1.0' encoding='utf-8'?
 !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate
 Configuration DTD//EN

 http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;
 !-- Template for hibernate configuration. processing by maven using
 profiles.
   Replace original src/main/webapp/WEB-INF/hibernate.cfg.xml --
 hibernate-configuration
session-factory

  property name=show_sqlfalse/property
  property name=use_outer_jointrue/property

 !--
  property name=dbcp.defaultAutoCommitfalse/property
  property name=dbcp.maxActive50/property
  property name=dbcp.maxIdle5/property
  property name=dbcp.maxWait3/property
  property name=dbcp.whenExhaustedAction1/property
  property name=dbcp.ps.whenExhaustedAction1/property
  property name=dbcp.ps.maxActive20/property
  property name=dbcp.ps.maxWait12/property
  property name=dbcp.ps.maxIdle20/property
 --

  !-- Datasource configuration. --
  property name=connection.datasourcejava:jdbc/XWikiDS/property
  property
 name=dialectorg.hibernate.dialect.PostgreSQLDialect/property
  mapping resource=xwiki.hbm.xml/
  mapping resource=feeds.hbm.xml/

/session-factory
 /hibernate-configuration

 [/config]

 Hope this helps.

 Cheers,

 Aleks

 [EMAIL PROTECTED] wrote:
 Hi,

   Configure JNDI data store in application container, where you xwiki
 instance is running.
 How it should be done ? can any one help?

 Regards,
 Project trainees.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

 
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
 

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users