You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Manolo Gómez <mg...@gmail.com> on 2005/09/14 10:29:13 UTC

Problems Extending User

Hi,

I am having troubles when I try to extend Jetspeed user and change my
DB from HS to PostgreSQL too. I've already read a lot of posts and
also searched through J1 doc in order to do it, but I can't achieve
it. Any help would be appreciated.

My first try was only too change Jetspeed DB from HS to PostgreSQL
keeping the out-of-the-box schema and names. I achieved it by changing
Torque.properties.merge in the following way:
torque.database.default=default
torque.database.default.adapter=postgresql
torque.dsfactory.default.connection.driver = org.postgresql.Driver
torque.dsfactory.default.connection.url =
jdbc:postgresql://127.0.0.1:5432/jetspeed
torque.dsfactory.default.connection.user = jetspeed
torque.dsfactory.default.connection.password =
torque.dsfactory.default.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
[...]

After that, I create and populate a PostgreSQL using the scripts
provided with J1.6. I had to modify them in order to include a new
column ('PASSWORD_CAHNGED') in TURBINE_USER. I also changed OID type
to bytea.

Then, I add PostgreSQL JDBC driver to my dependencies (so that it was
copyed to WEB-INF/lib) and recompiled my portal with 'maven
jetspeed:deploy'. When I restarted Tomcat everything worked.

Therefore, I decided to go further and tryed to add new columns to
Jetspeed DB. I have to say that I didn't know a lot about Torque and
it features, so I just modified my SQL scripts and run them. This was
an error because the OM java classes where not OK.

So, I just realized that I shoud follow the complete proccess with
Torque. What I did it's described in J1.6 doc page:
1) Modify src/torque-schema/security-schema.xml adding columns in
TURBINE_USER table, and adding a couple of new tables. I didn't change
anything else, so every single DB, table or column had it default
name.

2) Modify project.properties to generate DDL for my particular DB:
torque.project = jetspeed
torque.database = postgresql 
torque.targetPackage = org.apache.jetspeed.om
torque.database.createUrl = jdbc:postgresql://127.0.0.1
torque.database.buildUrl = jdbc:postgresql://127.0.0.1/jetspeed
torque.database.url = jdbc:postgresql://127.0.0.1:5432/jetspeed
torque.database.driver = org.postgresql.Driver
torque.database.user = postgres 
torque.database.password =
torque.database.host = 127.0.0.1
schemaDirectory = ${maven.src.dir}/torque-schema

3) I didn't rebuild Jetspeed. I discover that if I use 'maven torque'
I had my SQL scripts and my OM java classes generated.
[I am always working from my new portal dir, not from J1.6 sources]

4) I didn't extend BaseJetspeedUser nor BaseTurbineUser because my new
BaseTurbineUser class was OK for my DB schema.


Then, I created my DB, populated it with correct values and when I
restarted Tomcat and tried to connect to my portal (as an anonymous
user) I got the following Exception:

2005-09-12 23:14:09,755 [http-8080-Processor25] ERROR
BaseProfileLocator - Could not get Anonymous user
org.apache.jetspeed.services.security.UserException: Failed
instantiate an User implementation object:
java.lang.InstantiationException
        at org.apache.jetspeed.om.security.JetspeedUserFactory.getInstance(JetspeedUserFactory.java:83)
        at org.apache.jetspeed.om.security.JetspeedUserFactory.getInstance(JetspeedUserFactory.java:49)
        at org.apache.jetspeed.om.profile.BaseProfileLocator.setAnonymous(BaseProfileLocator.java:318)
        at org.apache.jetspeed.services.profiler.JetspeedProfilerService.fallbackProfile(JetspeedProfilerService.java:785)
        at org.apache.jetspeed.services.profiler.JetspeedProfilerService.getProfile(JetspeedProfilerService.java:301)
        at org.apache.jetspeed.services.profiler.JetspeedProfilerService.getProfile(JetspeedProfilerService.java:848)
        at org.apache.jetspeed.services.Profiler.getProfile(Profiler.java:87)
        at org.apache.jetspeed.util.template.BaseJetspeedLink.initLink(BaseJetspeedLink.java:999)

[...]

2005-09-12 23:14:09,837 [http-8080-Processor25] WARN  BaseJetspeedLink
- BaseJetspeedLink: profile in rundata was null


What I am doing wrong?


Thanks for your replies. 


PS: I am using J1.6, Tomcat 5.0 and JDK 1.4.2, and I am working in a
new portal created by 'maven jetspeed:genapp' command. I haven't
compiled J1.6 sources.


-- 
Saludos,
Manolo

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org