Not trying to be difficult...
I have a postgres-ds.xml file that I created from the examples...
It looks like this:
<local-tx-datasource>
<jndi-name>RateVegas</jndi-name>
<connection-url>jdbc:postgresql:ratevegas</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>password</password>
</local-tx-datasource>
JNDIView shows this is bound.
Here's the complete stack trace:
2002-09-17 19:55:51,819 ERROR [org.jboss.ejb.plugins.LogInterceptor]
TransactionRolledbackLocalException, causedBy:
java.lang.NullPointerException
at
com.jacobstern.ejb.session.SequenceGeneratorBean.getNextVal(Unknown Source)
at
com.jacobstern.ejb.session.SequenceGeneratorBean.getInteger(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles
sSessionContainer.java:606)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cach
edConnectionInterceptor.java:186)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe
ssionInstanceInterceptor.java:77)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:108)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:184)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:66)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:13
0)
at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinde
rInterceptor.java:154)
at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav
a:303)
at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFacto
ry.java:351)
at
org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionPro
xy.java:81)
at $Proxy827.getInteger(Unknown Source)
at com.jacobstern.ejb.session.UserManagerBean.createUser(Unknown
Source)
at java.lang.reflect.Method.invoke(Native Method)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles
sSessionContainer.java:606)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cach
edConnectionInterceptor.java:186)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe
ssionInstanceInterceptor.java:77)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:108)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:184)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:66)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:13
0)
at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinde
rInterceptor.java:154)
at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav
a:303)
at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFacto
ry.java:351)
at
org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionPro
xy.java:81)
at $Proxy824.createUser(Unknown Source)
at userController.commitNewUser(Unknown Source)
at userController.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:362)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandl
er.java:284)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:565)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext
.java:544)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1614)
at org.mortbay.http.HttpServer.service(HttpServer.java:875)
at org.jboss.jetty.Jetty.service(Jetty.java:531)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:785)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:935)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:802)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:200)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:294)
at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
at java.lang.Thread.run(Thread.java:491)
> From: David Jencks <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 17 Sep 2002 23:24:30 -0400
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] A JBossCX Change in 3.2 That I Don't Fully
> Understand...
>
> gimme a break, this is not a guessing game, at least show what line of this
> code and give a stack trace.
>
> david jencks
>
> On 2002.09.17 23:15:43 -0400 Hunter Hillegas wrote:
>> I know a lot has changed in JBossCX since 3.0, but I don't have a
>> CHANGELOG
>> yet. I looked at the source, but my code below is now throwing null
>> pointer
>> exceptions...
>>
>> Any ideas?
>>
>> Hunter
>>
>> private int getNextVal(String seqName) throws SQLException {
>> int nextVal = -1;
>> Connection myConnection = null;
>> DataSource datasource = null;
>>
>> try {
>> InitialContext jndiContext = new InitialContext();
>>
>> datasource = (DataSource)jndiContext.lookup("java:/RateVegas");
>>
>> myConnection = datasource.getConnection("postgres","whatever");
>>
>> ResultSet rs;
>> PreparedStatement pstmt;
>> String query = "";
>>
>> query = "SELECT NEXTVAL(?)";
>>
>> pstmt = myConnection.prepareStatement(query);
>> pstmt.setString(1,seqName);
>> rs = pstmt.executeQuery();
>> while (rs.next()) {
>> nextVal = rs.getInt(1);
>> }
>> rs.close();
>> }
>> catch (SQLException ex) {
>> throw ex;
>> }
>> catch (Exception e) {
>> System.out.println(e.toString());
>> }
>> finally {
>> myConnection.close();
>> }
>> return nextVal;
>> }
>>
>>
>>
>> -------------------------------------------------------
>> This SF.NET email is sponsored by: AMD - Your access to the experts
>> on Hammer Technology! Open Source & Linux Developers, register now
>> for the AMD Developer Symposium. Code: EX8664
>> http://www.developwithamd.com/developerlab
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>>
>>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: AMD - Your access to the experts
> on Hammer Technology! Open Source & Linux Developers, register now
> for the AMD Developer Symposium. Code: EX8664
> http://www.developwithamd.com/developerlab
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user