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 8955749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:37:22+00:00 2026-06-15T14:37:22+00:00

Platform: TomEE Web profile 1.5.0. I am trying to do a very basic thing,

  • 0

Platform: TomEE Web profile 1.5.0.

I am trying to do a very basic thing, setup a data source for MySQL. I have read the official guide (http://openejb.apache.org/configuring-datasources.html). It asks us to enter a Resource element in openejb.xml. I can not find that file anywhere in tomee-webprofile-1.5.0. I read in other places that I could use tomee.xml for the same purpose. So, I added this to my conf/tomee.xml.

<Resource id="TestDS" type="DataSource">
    JdbcDriver  com.mysql.jdbc.Driver 
    JdbcUrl jdbc:mysql://localhost/test 
    UserName    root 
    Password    some_pass 
</Resource>

I copied MySQL driver JAR to tomee/lib folder.

I wrote this code. Showing snippets here:

@Resource(name="TestDS") 
DataSource ds; 

Connection con = ds.getConnection(); 
PreparedStatement ps = con.prepareStatement("select * from UserProfile"); 

The prepareStatement() call is throwing this exception:

java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: USERPROFILE 
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source) 
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source) 

Why is the system using hsqldb driver? In fact, no matter what is use as name for @Resource, I get the same exception.

What am I doing wrong? I am starting TomEE from Eclipse, if that makes any difference.

  • 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-15T14:37:23+00:00Added an answer on June 15, 2026 at 2:37 pm

    I have tracked down the root cause. The problem happens only when I start TomEE from Eclipse. If I start it from command line, my data source definition works just fine.

    It appears that when I run TomEE from command line, it uses configuration files from /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf. To change this, I had to take these steps in Eclipse:

    1. Remove all deployed projects from the server.
    2. Open server settings and from “Server Locations” choose “Use Tomcat installation”. This section is greyed out if you have at least one project still deployed to the server. So, make sure you have done step #1.
    3. Restart the server and redeploy the application. Now, my application is finding the data source.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Platform: ASP.NET 3.5, ASP.NET Ajax intermixed I'm very green to jQuery, so have been
Platform: Flex 3 & Flex 4 Language: AS3 I have inherited a very large
PLATFORM: jQuery, PHP, mySQL WHAT I HAVE: I am using jQuery to process information
PLATFORM: PHP & mySQL For my experimentation purposes, I have tried out few of
MY PLATFORM: PHP & mySQL MY SITUATION: I am trying to implement transactions within
Platform - iOS. Language - Object c, OpenGL. I have to put 2 UIViews
I'm using platform/invoke and I'm trying to marshal floats LPSTRs and int to a
Platform: C# 2.0 WinForms I have a factory class that provides an instantiation of
Platform: C# ASP.NET 3.5 I have a ListView which builds a Rate field which
Platform: Silverlight 4 / .NET 4 Description: I have a ComboBox , a Textbox

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.