You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Mohamad, HKB (Hammad)" <sb...@rl.ac.uk> on 2008/08/22 14:56:33 UTC
Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the datasource NullPointerException
Hi
I have tried to run my application with
1. Cocoon 2.0.4
2. Tomcat 5.x
3. Jdk 1.5
4. Oracle 10.g
(even I used Cocoon with Tomcat 5.x, 6.x and jdk 1.4 but no use same
error)
All the time I am getting an error message as: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not
get the datasource NullPointerException.
I have added ojdbc14.jar file to my project file, then to tomcat lib
directory.
In cocoon.xconf:
<target-language name="java">
<parameter name="core-logicsheet"
value="resource://org/apache/cocoon/components/language/markup/sitemap/j
ava/sitemap.xsl"/>
</target-language>
</sitemap-language>
</markup-languages>
<!-- Datasources: -->
<datasources>
<j2ee name="epub"><dbname>epubds</dbname></j2ee>
</datasources>
In web.xml file:
<servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
And driver:
<init-param>
<param-name>load-class</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
Please help me out, I am really tired from past 2 days with same error
message. It is very urgent also.
Error message:
Original exception : java.lang.RuntimeException: Could not get the
datasource java.lang.NullPointerException
at
org.apache.cocoon.www.xsp.index_xsp.generate(C:\programs\Tomcat-5.0\work
\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www/xsp\index_xs
p.java:350)
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerator.java:258)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cachi
ngEventPipeline.java:250)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(Cach
ingStreamPipeline.java:395)
at
org.apache.cocoon.www.sitemap_xmap.resource_serialize_html(C:\programs\T
omcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/ww
w\sitemap_xmap.java:1119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.cocoon.sitemap.AbstractSitemap.invokeMethod(AbstractSitemap.j
ava:488)
at
org.apache.cocoon.www.sitemap_xmap.matchN1018C(C:\programs\Tomcat-5.0\wo
rk\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xm
ap.java:2192)
at
org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\C
atalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.j
ava:1384)
at
org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\C
atalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.j
ava:1294)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:227)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:173)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:152
)
at org.apache
Thank you very much,
Kasim
Re: Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException:
Could not get the datasource NullPointerException
Posted by Jeroen Reijn <j....@onehippo.com>.
Hi Kasim,
I do not have a lot of experience with xsp, but the problem appears to
be in your xsp file.
index_xsp.java:350
Could you perhaps paste the line here on the list, so we can have a
look, or attach your xsp file if it's not too big.
Regards,
Jeroen Reijn
Mohamad, HKB (Hammad) wrote:
> Hi
>
> I have tried to run my application with
>
> 1. Cocoon 2.0.4
>
> 2. Tomcat 5.x
>
> 3. Jdk 1.5
>
> 4. Oracle 10.g
>
> (even I used Cocoon with Tomcat 5.x, 6.x and jdk 1.4 but no use same error)
>
> All the time I am getting an error message as: Exception in
> ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not
> get the datasource NullPointerException.
>
> I have added ojdbc14.jar file to my project file, then to tomcat lib
> directory.
>
> In cocoon.xconf:
>
> <target-language name="java">
>
> <parameter name="core-logicsheet"
> value="resource://org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl"/>
>
> </target-language>
>
> </sitemap-language>
>
> </markup-languages>
>
> <!-- Datasources: -->
>
> <datasources>
>
> <j2ee name="epub"><dbname>epubds</dbname></j2ee>
>
> </datasources>
>
> In web.xml file:
>
> <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
>
> And driver:
>
> <init-param>
>
> <param-name>load-class</param-name>
>
> <param-value>oracle.jdbc.driver.OracleDriver</param-value>
>
> </init-param>
>
> Please help me out, I am really tired from past 2 days with same error
> message. It is very urgent also.
>
> Error message:
>
> Original exception : java.lang.RuntimeException: Could not get the
> datasource java.lang.NullPointerException
> at
> org.apache.cocoon.www.xsp.index_xsp.generate(C:\programs\Tomcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www/xsp\index_xsp.java:350)
> at
> org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:258)
> at
> org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:250)
> at
> org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:395)
> at
> org.apache.cocoon.www.sitemap_xmap.resource_serialize_html(C:\programs\Tomcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.apache.cocoon.sitemap.AbstractSitemap.invokeMethod(AbstractSitemap.java:488)
> at
> org.apache.cocoon.www.sitemap_xmap.matchN1018C(C:\programs\Tomcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:2192)
> at
> org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1384)
> at
> org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1294)
> at org.apache.cocoon.sitemap.Handler.process(Handler.java:227)
> at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:173)
> at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:152)
> at org.apache
>
> Thank you very much,
>
> Kasim
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the datasource NullPointerException
Posted by "Mohamad, HKB (Hammad)" <sb...@rl.ac.uk>.
I got solution to this:
Problem was with server/context.xml file. Declaration of resource should
be like:
<Resource name="jdbc/e_ds" auth="Container"
type="javax.sql.DataSource" username="e_app"
password="database"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@XX:1521:AA9"
maxActive="8" maxIdle="4"/>
earlier config was different. Now it is working fine
-cheers
Kasim
_____________________________________________
From: Mohamad, HKB (Hammad)
Sent: 26 August 2008 09:33
To: 'users@cocoon.apache.org'
Subject: Exception in ServerPagesGenerator.generate():
java.lang.RuntimeException: Could not get the datasource
NullPointerException
Hi
I have tried to run my application with
1. Cocoon 2.0.4
2. Tomcat 5.x
3. Jdk 1.5
4. Oracle 10.g
(even I used Cocoon with Tomcat 5.x, 6.x and jdk 1.4 but no use same
error)
All the time I am getting an error message as: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not
get the datasource NullPointerException.
I have added ojdbc14.jar file to my project file, then to tomcat lib
directory.
In cocoon.xconf:
<target-language name="java">
<parameter name="core-logicsheet"
value="resource://org/apache/cocoon/components/language/markup/sitemap/j
ava/sitemap.xsl"/>
</target-language>
</sitemap-language>
</markup-languages>
<!-- Datasources: -->
<datasources>
<j2ee name="epub"><dbname>epubds</dbname></j2ee>
</datasources>
In web.xml file:
<servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
And driver:
<init-param>
<param-name>load-class</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
Please help me out, I am really tired from past 2 days with same error
message. It is very urgent also.
Error message:
Original exception : java.lang.RuntimeException: Could not get the
datasource java.lang.NullPointerException
at
org.apache.cocoon.www.xsp.index_xsp.generate(C:\programs\Tomcat-5.0\work
\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www/xsp\index_xs
p.java:350)
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerator.java:258)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cachi
ngEventPipeline.java:250)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(Cach
ingStreamPipeline.java:395)
at
org.apache.cocoon.www.sitemap_xmap.resource_serialize_html(C:\programs\T
omcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/ww
w\sitemap_xmap.java:1119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.cocoon.sitemap.AbstractSitemap.invokeMethod(AbstractSitemap.j
ava:488)
at
org.apache.cocoon.www.sitemap_xmap.matchN1018C(C:\programs\Tomcat-5.0\wo
rk\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xm
ap.java:2192)
at
org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\C
atalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.j
ava:1384)
at
org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\C
atalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.j
ava:1294)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:227)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:173)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:152
)
at org.apache
Sitemap_xmap.java file:
try {
_esql_connection.datasource = (DataSourceComponent)
_esql_get_selector().select(String.valueOf("epub"));
_esql_connection.connection =
_esql_connection.datasource.getConnection();
} catch (Exception _esql_exception_N10024) {
getLogger().error("Could not get the
datasource",_esql_exception_N10024);
throw new RuntimeException("Could not get the datasource
"+_esql_exception_N10024);
}
In the tomcat server.xml file, I have configured data source as:
<ResourceLink name="jdbc/epubds" global="jdbc/globalepubds"
type="javax.sql.DataSource"/>
Thank you very much,
Kasim
Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the datasource NullPointerException
Posted by "Mohamad, HKB (Hammad)" <sb...@rl.ac.uk>.
Hi
I have tried to run my application with
1. Cocoon 2.0.4
2. Tomcat 5.x
3. Jdk 1.5
4. Oracle 10.g
(even I used Cocoon with Tomcat 5.x, 6.x and jdk 1.4 but no use same
error)
All the time I am getting an error message as: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not
get the datasource NullPointerException.
I have added ojdbc14.jar file to my project file, then to tomcat lib
directory.
In cocoon.xconf:
<target-language name="java">
<parameter name="core-logicsheet"
value="resource://org/apache/cocoon/components/language/markup/sitemap/j
ava/sitemap.xsl"/>
</target-language>
</sitemap-language>
</markup-languages>
<!-- Datasources: -->
<datasources>
<j2ee name="epub"><dbname>epubds</dbname></j2ee>
</datasources>
In web.xml file:
<servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
And driver:
<init-param>
<param-name>load-class</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
Please help me out, I am really tired from past 2 days with same error
message. It is very urgent also.
Error message:
Original exception : java.lang.RuntimeException: Could not get the
datasource java.lang.NullPointerException
at
org.apache.cocoon.www.xsp.index_xsp.generate(C:\programs\Tomcat-5.0\work
\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www/xsp\index_xs
p.java:350)
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerator.java:258)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cachi
ngEventPipeline.java:250)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(Cach
ingStreamPipeline.java:395)
at
org.apache.cocoon.www.sitemap_xmap.resource_serialize_html(C:\programs\T
omcat-5.0\work\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/ww
w\sitemap_xmap.java:1119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.cocoon.sitemap.AbstractSitemap.invokeMethod(AbstractSitemap.j
ava:488)
at
org.apache.cocoon.www.sitemap_xmap.matchN1018C(C:\programs\Tomcat-5.0\wo
rk\Catalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xm
ap.java:2192)
at
org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\C
atalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.j
ava:1384)
at
org.apache.cocoon.www.sitemap_xmap.process(C:\programs\Tomcat-5.0\work\C
atalina\localhost\epub\cocoon-files\org/apache/cocoon/www\sitemap_xmap.j
ava:1294)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:227)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:173)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:152
)
at org.apache
Sitemap_xmap.java file:
try {
_esql_connection.datasource = (DataSourceComponent)
_esql_get_selector().select(String.valueOf("epub"));
_esql_connection.connection =
_esql_connection.datasource.getConnection();
} catch (Exception _esql_exception_N10024) {
getLogger().error("Could not get the
datasource",_esql_exception_N10024);
throw new RuntimeException("Could not get the datasource
"+_esql_exception_N10024);
}
In the tomcat server.xml file, I have configured data source as:
<ResourceLink name="jdbc/epubds" global="jdbc/globalepubds"
type="javax.sql.DataSource"/>
Thank you very much,
Kasim