Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7710499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:08:28+00:00 2026-06-01T01:08:28+00:00

I’m developing new web app with Struts2 framework, eclipse, and I’ve mapped the db

  • 0

I’m developing new web app with Struts2 framework, eclipse, and I’ve mapped the db structure with Hibernate. The problem is that when I execute my “list” action the framework returns me this error:


    Struts Problem Report

    Struts has detected an unhandled exception:

    Messages:   
    This context must be accessed through a java: URL
    Unable to lookup JNDI name [java:comp/env/jdbc/main]
    File:   org/apache/naming/SelectorContext.java
    Line number:    776

The server.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
    <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
    <Listener className="org.apache.catalina.core.JasperListener"/>
    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
    <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

    <GlobalNamingResources>
        <Resource auth="Container" defaultAutoCommit="false" driverClassName="net.sourceforge.jtds.jdbc.Driver" maxActive="200" maxIdle="100" maxWait="20000" name="jdbc/main" password="########" type="javax.sql.DataSource" url="jdbc:jtds:sqlserver://10.4.1.85/SBAGRU_DEV" username="****"/>

    </GlobalNamingResources>
    <Service name="Catalina">
        <Connector connectionTimeout="2000" executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

        <Connector SSLEnabled="true" clientAuth="false" keystoreFile="C:\jpeople.bin" keystorePass="gesbanke" keystoreType="PKCS12" maxThreads="200" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="SSL"/>

        <!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/> -->
        <Engine defaultHost="localhost" name="Catalina">
            <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false"> 
                <Context docBase="mag0" path="/mag0" reloadable="true" source="org.eclipse.jst.jee.server:mag0">
                    <ResourceLink global="jdbc/main" name="jdbc/main" type="javax.sql.DataSource" />
                </Context>
            </Host>
        </Engine>
    </Service>
</Server>

I’ve also hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
    <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
    <Listener className="org.apache.catalina.core.JasperListener"/>
    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
    <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

    <GlobalNamingResources>
        <Resource auth="Container" defaultAutoCommit="false" driverClassName="net.sourceforge.jtds.jdbc.Driver" maxActive="200" maxIdle="100" maxWait="20000" name="jdbc/main" password="########" type="javax.sql.DataSource" url="jdbc:jtds:sqlserver://10.4.1.85/SBAGRU_DEV" username="****"/>

    </GlobalNamingResources>
    <Service name="Catalina">
        <Connector connectionTimeout="2000" executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

        <Connector SSLEnabled="true" clientAuth="false" keystoreFile="C:\jpeople.bin" keystorePass="******" keystoreType="PKCS12" maxThreads="200" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="SSL"/>

        <!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/> -->
        <Engine defaultHost="localhost" name="Catalina">
            <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false"> 
                <Context docBase="mag0" path="/mag0" reloadable="true" source="org.eclipse.jst.jee.server:mag0">
                    <ResourceLink global="jdbc/main" name="jdbc/main" type="javax.sql.DataSource" />
                </Context>
            </Host>
        </Engine>
    </Service>
</Server>

Any suggestion where I can look? I’m really going crazy!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:08:29+00:00Added an answer on June 1, 2026 at 1:08 am

    I found the solution, and the real problem. I edit the server.xml in Eclipse, and I didn’t watch the real publish result. For strange reason eclipse remove the resource link in the real server.xml, but show me the link in eclipse view. So i gooogled all day long and I find that I must add in the context.xml file under WEB-INF directory this:

    <?xml version="1.0" encoding="UTF-8"?> 
    <Context antiJARLocking="true" path="">
    <ResourceLink global="jdbc/main" name="jdbc/main" type="javax.sql.DataSource" /> 
    </Context>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.