[Gridsphere-users] Account Creation
Natarajan, Senthil
senthil at pitt.edu
Fri Dec 22 08:50:50 PST 2006
Hi Jason,
Since "ant update-database" is not adding the new column in the table
SPORTLETUSERIMPL. I was trying to do this in a separate JDBC client
program.
I am using these, got it from hibernate.properties
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.connection.url=jdbc:hsqldb:@GRIDSPHERE_DB@
If I use this, I guess it creates another instance with the name
@GRIDSPHERE_DB@
And keep complaining about the Table SPORTLETUSERIMPL does not exist.
How to access Gridsphere database instance through JDBC client to modify
the back end table schema. Please let me know.
Thanks,
Senthil
-----Original Message-----
From: gridsphere-users-bounces at gridsphere.org
[mailto:gridsphere-users-bounces at gridsphere.org] On Behalf Of Jason
Novotny
Sent: Thursday, December 21, 2006 2:30 PM
To: GridSphere Users
Subject: Re: [Gridsphere-users] Account Creation
Yeah with hsqldb, I've never had any problem adding columns, doing
ant deploy and then ant create-database, but I guess YMMV. Maybe hand
hack at your database and consult the hsqldb documentation.
Jason
Natarajan, Senthil wrote:
> Hi Jason,
> I am using the default hsqlDB. I tried "ant update-database", the
build
> was successful. When I try to login, I got the NullPointerException.
> Here is the Catalina log message. It complains about the new column
> STATUS not found in the database.
>
> I did added the column like this
> <property name="Status" type="string" column="status"/> in
> SportletUserImpl.hbm.xml
>
> Caused by: java.sql.SQLException: Column not found: STATUS in
statement
> [select sportletus0_.gsoid as gsoid, sportletus0_.userid as userid,
> sportletus0_.familyname as familyname, sportletus0_.fullname as
> fullname, sportletus0_.status as status, sportletus0_.givenname as
> givenname, sportletus0_.emailaddress as emailadd7_,
> sportletus0_.organization as organiza8_, sportletus0_.lastlogintime as
> lastlogi9_ from sportletuserimpl sportletus0_]
> at org.hsqldb.Trace.getError(Unknown Source)
> at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
> at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
> at org.hsqldb.jdbcConnection.execute(Unknown Source)
> at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
> at org.hsqldb.jdbcStatement.executeQuery(Unknown Source)
> at org.hsqldb.jdbcPreparedStatement.executeQuery(Unknown
Source)
> at
>
com.mchange.v2.sql.filter.FilterCallableStatement.executeQuery(FilterCal
> lableStatement.java:306)
> at
>
com.mchange.v2.c3p0.impl.C3P0PooledConnection$1.executeQuery(C3P0PooledC
> onnection.java:542)
> at
> net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89)
> at
net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880)
> at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273)
> at
>
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
> ader.java:138)
> at net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
> at net.sf.hibernate.loader.Loader.list(Loader.java:1054)
> at
> net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
> at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554)
> ... 29 more
> 23241 [http-9443-Processor4] (DBTask.java:257) INFO
> org.gridlab.gridsphere.core.persistence.hibernate.DBTask - Database
not
> correctly installed.
>
> 23242 [http-9443-Processor4] ERROR
> org.gridlab.gridsphere.servlets.GridSphereServlet - Check DB failed:
> The database is not correctly installed!
> at
>
org.gridlab.gridsphere.core.persistence.hibernate.DBTask.execute(DBTask.
> java:258)
> at
>
org.gridlab.gridsphere.servlets.GridSphereServlet.processRequest(GridSph
> ereServlet.java:166)
> at
>
org.gridlab.gridsphere.servlets.GridSphereServlet.doGet(GridSphereServle
> t.java:139)
> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:237)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:157)
> at
>
org.gridlab.gridsphere.filters.GridSphereFilter.doFilter(GridSphereFilte
> r.java:77)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:186)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:157)
> at
>
org.gridlab.gridsphere.filters.RequestEncodingFilter.doFilter(RequestEnc
> odingFilter.java:72)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:186)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:157)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
> e.java:214)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
> e.java:178)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :126)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
> java:107)
> at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
> 48)
> at
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
> 5)
> at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
> onnection(Http11Protocol.java:731)
> at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
> .java:526)
> at
>
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
> erWorkerThread.java:80)
> at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
> .java:684)
> at java.lang.Thread.run(Thread.java:534)
>
> -----Original Message-----
> From: gridsphere-users-bounces at gridsphere.org
> [mailto:gridsphere-users-bounces at gridsphere.org] On Behalf Of Jason
> Novotny
> Sent: Thursday, December 21, 2006 12:57 PM
> To: GridSphere Users
> Subject: Re: [Gridsphere-users] Account Creation
>
>
> Hi,
>
> With some databases like hsqlDB, the default one used, you can run
> "ant update-database" and it will add the new columns. With others
like
>
> Postgres, you might have to do it by hand...
>
> Cheers, Jason
>
> Natarajan, Senthil wrote:
>
>> Hi Jason,
>> Thanks for the info.
>>
>> Yes I updated the corresponding files.
>> ./src/org/gridlab/gridsphere/portlet/User.java
>> ./src/org/gridlab/gridsphere/portlet/impl/SportletUserImpl.java
>> ./webapps/gridsphere/WEB-INF/persistence/SportletUserImpl.hbm.xml
>> ./webapps/gridsphere/WEB-INF/classes/Portlet_en.properties
>> ./webapps/gridsphere/jsp/admin/users/doViewUserList.jsp
>> ./webapps/gridsphere/jsp/admin/users/doViewUserEdit.jsp
>> ./portlets/core/admin/users/UserManagerPortlet.java
>>
>>
>> I added this in SportletUserImpl.hbm.xml
>>
>> <property name="Status" type="string" column="status"/>
>>
>> And added corresponding getter and setter method in
>> SportletUserImpl.java
>>
>> Since it is an addition of new column in the database, I am getting
>>
> this
>
>> error
>>
>> Database Error!
>> Please verify that the
>>
>>
>
/usr/local/GridComputing/software/tomcat-5.5.4/webapps/gridsphere/WEB-IN
>
>> F/CustomPortal/hibernate.properties file is properly configured and
>>
> that
>
>> the tables have been created in your database using the ant
>> create-database command (which normally gets called when using ant
>> install)!
>>
>> So do I need to create database by calling 'ant create-database',
then
>> all the current data will be wiped out. How to take a backup of
>>
> current
>
>> data, and once the new field is added then insert the old data's.
>>
>> Is it possible to add a new column in the user table, with out
>>
> creating
>
>> the database from scratch? Could you please let me know?
>> Thanks,
>> Senthil
>>
>>
>>
>> -----Original Message-----
>> From: gridsphere-users-bounces at gridsphere.org
>> [mailto:gridsphere-users-bounces at gridsphere.org] On Behalf Of Jason
>> Novotny
>> Sent: Tuesday, December 19, 2006 2:22 PM
>> To: GridSphere Users
>> Subject: Re: [Gridsphere-users] Account Creation
>>
>>
>> Hi Senthil,
>>
>> Have a look at the UserManagerPortlet and the associated jsp files in
>> admin/users/
>> As far as persisting the info, the easiest is to use the
>> user.setAttribute(String key, String value) method. Basically the
user
>>
>
>
>> table in SportletUserImpl.hbm.xml has associated with it a collection
>>
> to
>
>> map string key value pairs.
>>
>> Jason
>>
>> Natarajan, Senthil wrote:
>>
>>
>>> Hi,
>>>
>>> I am using Gridsphere 2.1.1, I need to add one more column called
>>> "Status" in the below "User Account Manager" page. The value for the
>>> Status field has to be saved in the database. Is it possible to do?
>>>
> If
>
>>>
>>>
>>
>>
>>> so how to add this new column and where to start with (what files
>>>
>>>
>> ...).
>>
>>
>>> Could you please let me know?
>>>
>>> Thanks,
>>>
>>> Senthil
>>>
>>>
>>>
>>>
>
------------------------------------------------------------------------
>
>>
>>
>>> _______________________________________________
>>> Gridsphere-users mailing list
>>> Gridsphere-users at gridsphere.org
>>> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
>>>
>>>
>>>
>>
>>
>
>
>
--
Jason Novotny
Chief Portal Architect
BIRN-CC / UCSD
9500 Gilman Dr., La Jolla, CA
novotny at gridsphere.org
http://www.gridsphere.org
_______________________________________________
Gridsphere-users mailing list
Gridsphere-users at gridsphere.org
http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
More information about the Gridsphere-users
mailing list