Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » JDBC Realm
JDBC Realm [message #192434] Sun, 13 May 2007 09:27 Go to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
Hi,
Using eclipse 3.3 and WTP 2.0 (milestones).
I use WTP with tomcat 5.5. . I am trying to configure tomcat to authenticate
users using a JDBC realm. I have changed the server.xml file in
\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\se rver.xml, and
added this line:

<Realm className="org.apache.catalina.realm.JDBCRealm" connectionName="myDB"
connectionPassword="passy"
connectionURL="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DB1;SelectMethod=cursor"
driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver" roleNameCol="Role"
userCredCol="Password" userNameCol="Username" userRoleTable="UserRoles"
userTable="Users"/>


and then place the JDBC driver jar in
\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\common\ lib

This used to work before, but now (I think it is since I changed to eclipse
3.3 / WTP 2.0) I get this:
SEVERE: Exception opening database connection
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:689)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:766 )
at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1005)
at org.apache.catalina.core.StandardEngine.start(StandardEngine .java:442)
at org.apache.catalina.core.StandardService.start(StandardServi ce.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer .java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551 )
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2 94)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:43 2)

Any idea...?
Re: JDBC Realm [message #192455 is a reply to message #192434] Mon, 14 May 2007 13:19 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
The server.xml to change is the one under the Servers project in your
workspace. It will overwrite the one under ".metadata" directory when
the server is published. The jar will need to go in the common/lib of
your installation, unless you have modified the "common.loader" property
in the catalina.properties file (also under the Servers project). To
appear in the common classloader, the jar would need to be located where
it will be included by one of the path definitions in the
"common.loader" setting. These path definitions typically derive from
catalina.home (the installation) rather than catalina.base.

Cheers,
Larry

Zohar wrote:
> Hi,
> Using eclipse 3.3 and WTP 2.0 (milestones).
> I use WTP with tomcat 5.5. . I am trying to configure tomcat to
> authenticate users using a JDBC realm. I have changed the server.xml
> file in
> \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\se rver.xml,
> and added this line:
>
> <Realm className="org.apache.catalina.realm.JDBCRealm"
> connectionName="myDB" connectionPassword="passy"
> connectionURL="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DB1;SelectMethod=cursor"
> driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
> roleNameCol="Role" userCredCol="Password" userNameCol="Username"
> userRoleTable="UserRoles" userTable="Users"/>
>
>
> and then place the JDBC driver jar in
> \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\common\ lib
>
> This used to work before, but now (I think it is since I changed to
> eclipse 3.3 / WTP 2.0) I get this:
> SEVERE: Exception opening database connection
> java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
> at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:689)
> at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:766 )
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1005)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:442)
> at
> org.apache.catalina.core.StandardService.start(StandardServi ce.java:450)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer .java:709)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:551 )
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2 94)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:43 2)
>
> Any idea...?
Re: JDBC Realm [message #193261 is a reply to message #192455] Sun, 27 May 2007 10:41 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
Thanks Larry.
What is the difference between catalina.home and catalin.base? where are
they set?

"Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
news:f29nkv$oca$1@build.eclipse.org...
> The server.xml to change is the one under the Servers project in your
> workspace. It will overwrite the one under ".metadata" directory when the
> server is published. The jar will need to go in the common/lib of your
> installation, unless you have modified the "common.loader" property in the
> catalina.properties file (also under the Servers project). To appear in
> the common classloader, the jar would need to be located where it will be
> included by one of the path definitions in the "common.loader" setting.
> These path definitions typically derive from catalina.home (the
> installation) rather than catalina.base.
>
> Cheers,
> Larry
>
> Zohar wrote:
>> Hi,
>> Using eclipse 3.3 and WTP 2.0 (milestones).
>> I use WTP with tomcat 5.5. . I am trying to configure tomcat to
>> authenticate users using a JDBC realm. I have changed the server.xml file
>> in \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\se rver.xml,
>> and added this line:
>>
>> <Realm className="org.apache.catalina.realm.JDBCRealm"
>> connectionName="myDB" connectionPassword="passy"
>> connectionURL="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DB1;SelectMethod=cursor"
>> driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
>> roleNameCol="Role" userCredCol="Password" userNameCol="Username"
>> userRoleTable="UserRoles" userTable="Users"/>
>>
>>
>> and then place the JDBC driver jar in
>> \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\common\ lib
>>
>> This used to work before, but now (I think it is since I changed to
>> eclipse 3.3 / WTP 2.0) I get this:
>> SEVERE: Exception opening database connection
>> java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:689)
>> at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:766 )
>> at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1005)
>> at
>> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:442)
>> at
>> org.apache.catalina.core.StandardService.start(StandardServi ce.java:450)
>> at
>> org.apache.catalina.core.StandardServer.start(StandardServer .java:709)
>> at org.apache.catalina.startup.Catalina.start(Catalina.java:551 )
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2 94)
>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:43 2)
>>
>> Any idea...?
Re: JDBC Realm [message #193471 is a reply to message #193261] Tue, 29 May 2007 12:59 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Zohar wrote:
> Thanks Larry.
> What is the difference between catalina.home and catalin.base?

See:
http://www.eclipse.org/webtools/faq/TomcatServerFAQ.php#gett ing_started_2

where are
> they set?

catalina.home is tied to the Tomcat runtime the server is associated
with. Since you are using WTP 2.0, catalina.base can be controlled
using the server editor and the new section shown at the bottom of:

http://www.eclipse.org/webtools/development/news/2.0M6/serve r.php

Cheers,
Larry

>
> "Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
> news:f29nkv$oca$1@build.eclipse.org...
>> The server.xml to change is the one under the Servers project in your
>> workspace. It will overwrite the one under ".metadata" directory when
>> the server is published. The jar will need to go in the common/lib of
>> your installation, unless you have modified the "common.loader"
>> property in the catalina.properties file (also under the Servers
>> project). To appear in the common classloader, the jar would need to
>> be located where it will be included by one of the path definitions in
>> the "common.loader" setting. These path definitions typically derive
>> from catalina.home (the installation) rather than catalina.base.
>>
>> Cheers,
>> Larry
>>
>> Zohar wrote:
>>> Hi,
>>> Using eclipse 3.3 and WTP 2.0 (milestones).
>>> I use WTP with tomcat 5.5. . I am trying to configure tomcat to
>>> authenticate users using a JDBC realm. I have changed the server.xml
>>> file in
>>> \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\se rver.xml,
>>> and added this line:
>>>
>>> <Realm className="org.apache.catalina.realm.JDBCRealm"
>>> connectionName="myDB" connectionPassword="passy"
>>> connectionURL="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DB1;SelectMethod=cursor"
>>> driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
>>> roleNameCol="Role" userCredCol="Password" userNameCol="Username"
>>> userRoleTable="UserRoles" userTable="Users"/>
>>>
>>>
>>> and then place the JDBC driver jar in
>>> \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\common\ lib
>>>
>>> This used to work before, but now (I think it is since I changed to
>>> eclipse 3.3 / WTP 2.0) I get this:
>>> SEVERE: Exception opening database connection
>>> java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:689)
>>> at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:766 )
>>> at
>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1005)
>>> at
>>> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:442)
>>> at
>>> org.apache.catalina.core.StandardService.start(StandardServi ce.java:450)
>>> at
>>> org.apache.catalina.core.StandardServer.start(StandardServer .java:709)
>>> at org.apache.catalina.startup.Catalina.start(Catalina.java:551 )
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2 94)
>>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:43 2)
>>>
>>> Any idea...?
>
Previous Topic:RC0 download links does not work
Next Topic:running tomcat from eclipse 3.2 on linux
Goto Forum:
  


Current Time: Thu Apr 25 22:59:12 GMT 2024

Powered by FUDForum. Page generated in 0.03564 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top