`

Attempt to refer to a unregistered pool by its alias[转]

阅读更多

出现这个问题,是poolxml的连接名或连接参数有误~检查下~以下是转摘:

=====================================================

这两天弄连接池,遇到了Attempt to refer to a unregistered pool by its alias 'test'这个问题,搞了我N久,都要疯掉了,网上也有好多人现到了同样的问题,大家在配置连接池的时候都是按正常步骤做的,服务器启动的时候也看到了自己在proxool.xml中配置的连接池加载成功,可用的时候就是会出现上面找不到连接池的问题,我也一样,郁闷得要死,我在用连接池的时候是在自己写的java文件中调用出现的问题,就是写了一个main方法,然后用"java Application"运行,就会报Attempt to refer to a unregistered pool by its alias ‘test’ ,但是在JSP页面里并不会报错,其实问题的关键就是在这里,连接池的应用本来就是要通过服务器调用的,如果你在java文件中调用,就没有涉及到服务器,这样就会报错了!

        如果你在java文件中用下面这种方式加载连接池是可用的:

Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");

Connection conn  
= DriverManager.getConnection("proxool.别名:driver:url","用户名","密码");//别名可以随便取,但一定要写

       但是这种方式会每次运行的时候加载连接池,用完就会释放。所以大家用连接池的时候,不要在java文件中去测试连接池是否可用,应该写一个jsp页面,问题就此解决!

 

 

今天在使用MyExcelipse开发时,总是出现错误提示“Attempt to refer to a unregistered pool by its alias 'MyTest'”,浪费了一点时间最后还是发现,数据库连接类“DataBaseConn.java”里面的

public static Connection getConn() throws SQLException{
  
   DriverManager.registerDriver(new ProxoolDriver());
   connection = DriverManager.getConnection("proxool.*");
   return connection;
}

的“*”处,写的是“MyTest”,而proxool.properties 文件的 属性“jdbc-0.proxool.alias=AuditAppDb”   感觉很可笑了,拷贝别人的东西,真不太熟悉啊,呵呵

 

分享到:
评论

相关推荐

    Recover4all Professional

    If You are a company or other form of organization, and You wish to authorize the Registered Software to be used by more than one (1) individual, You must purchase an additional license for each such...

    Introduction.To.Algorithms,.Second.Edition

    Algorithms are described in English and in a "pseudocode" designed to be readable by anyone who has done a little programming. The book contains over 230 figures illustrating how the algorithms work. ...

    微软内部资料-SQL性能优化2

    If you attempt to access a reserved address that has not yet been committed (backed by memory or disk) you will cause an access violation. Committed Memory Committed pages are those pages that when ...

    How to be a Programmer

    In this essay the term boss is used to refer to whomever gives you projects to do. I use the words business, company, and tribe, synonymously except that business connotes moneymaking, company ...

    A Practical Guide to Designing with Data.pdf

    new ʻvisualizationsʼ are an attempt to explain the underlying information with a powerful visual impact. They take complex ideas and distil them into beautiful graphics revealing the ...

    Programmable Logic Controllers A Practical Approach TO IEC 61131-3 Using CoDeSys

    This development was the natural result of the attempt by the producers to make themselves stand out among increasing competition by developing the most user friendlylanguages and tools.

    Electronics A Systems Approach 6th Edition by Neil Storey- 2017

    The first edition of Electronics: A Systems Approach pioneered a new approach to the teaching of electronics by explaining the uses and required characteristics of circuits before embarking on ...

    Practical C++ Design_ from programming to architecture-Apress (2018)

    Throughout my career, I have mentored both students and fellow ... In this book, I instead attempt to ground the reader’s theoretical knowledge of design through practice using a single case study.

    Universal-USB-Installer

    notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the ...

    快速RFID分组协议

    In RFID systems, the grouping problem is to efficiently group all tags according to a given partition such that tags in the same group will have the same group ID. Unlike previous research on the ...

    WizFlow网页编辑

    all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring...

    hibernate-shards.jar

    all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring...

    [Mining.the.Social.Web(2nd,2013.10)].Matthew.A.Russell.文字版.pdf

    a particular target audience, and in order to avoid any unnecessary confusion about its scope or purpose by way of disgruntled emails, bad book reviews, or other misunder‐ standings that can come up,...

    计算机网络第六版答案

    An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...

    2009 达内Unix学习笔记

    [] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后...

    firefox setup stub 41.0.1

    Firefox is an open-source not-for-profit enterprise, built by its users, and available for anyone to use. The browser was built not to make a profit, but because its programmers thought that they ...

    Advanced R 原版PDF by Wickham

    luxury of being able to spend a lot of time trying to figure out and understand how the language works. This book is my attempt to pass on what I’ve learned so that you can quickly become an ...

    HP pc server ML370 硬件更换加错误定位

    CAUTION: Do not attempt to remove and replace a power supply as a hot-plug procedure unless both bays are populated with power supplies. To remove the component: 1. Remove the two screws with the ...

    C in a Nutshell, Second Edition

    Its purpose is to serve as a convenient, reliable companion in your day-to-day work as a C programmer. "C in a Nutshell" covers virtually everything you need to program in C, describing all the ...

Global site tag (gtag.js) - Google Analytics