This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!

ssiva raman

Ranch Hand
+ Follow
since Jan 22, 2014
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ssiva raman

Hi Tim,

Thank you for the clarification. could you suggest me a book i can read in more detail.?

thank you

I'd like to learn RDBMS concepts. can you suggest me a book to read.?

Thanks in advance

The below configuration solved the problem. However , i want to know how the connection pool got exhausted when i've only one connection to the DB.
Any help is appreciated.



Tim Holloway wrote:That's the kind of error you get when you have too many connections opened to the database. It generally means that you are not closing connections when you are done with them.

A Connection Pool is a collection of pre-allocated Connections. When you ask the pool for a Connection, it will take one of the Connections that it owns and give it to your application.

But you have to give the connection back when you're finished with it.

Otherwise the pool will run dry and this is what you end up with.

Thank you for the reply , Tim.
If you have seen the code , you would find that i don't have too many connections to the DB and i close the session after each query.
Kindly , point out the mistake in the code.

Thanks again!!
i was following a tutorial to practice hibernate. i'm facing the exception as below. Googled it but no convincing solution. any help ?


Exception in thread "main" org.hibernate.HibernateException: The internal connection pool has reached its maximum size and no connection is currently available!
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections.poll(
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PoolState.getConnection(
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(
at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(
at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(
at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(
at org.hibernate.internal.SessionImpl.fireSave(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(
at com.sun.proxy.$ Source)
at com.hibernateexample.HibernateDao.main(

Hibernate config file:


DAO class:

thanks in advance!!

Stephan van Hulst wrote:Yes, I think this is causing your issue.

you're right, Stephan. thank you for spotting.

By default, component scanning occurs in the package of your main application class, or sub-packages. com.example.Controller is not a sub-package of com.example.demo.

The below change solved the problem. However , i'll rearrange the project hierarchy as you suggested.

You could specify the name of the package to scan for components like this:
It's better however, to instead use a more sensible package hierarchy. For instance, if com.example.demo is the base package of your project, put the main application class in com.example.demo.spring and put your controllers in com.example.demo.spring.controller. This will enable component scanning for the com.example.demo.spring package (and also its sub-packages like com.example.demo.spring.controller) while skipping it for packages that don't need it. That way you could put your business model in com.example.demo, and it won't take up any resources being scanned needlessly.

  • src/main/java/
    • com/example/demo/
      • spring/
        • controller/

Please use proper Java naming conventions. Package name elements should not be capitalized, and write out names (e.g. Controller instead of Ctrl).

sure, thank you for the suggestions.
7 months ago

Stephan van Hulst wrote:Do you have a main class annotated with @SpringBootApplication? What package is it in? What package is your controller in?

They are in different package. is it a problem?

7 months ago

Stephan van Hulst wrote:Does your application contain a context.xml file?

No, Stephan.
7 months ago
hi Stephan,

thank you for the reply.

yes , I'm using spring boot.

Please find the pom.xml.

7 months ago
I've created a simple rest api. when i tried to hit the resource , i get 404 not found error. i googled but couldn't find any help. can somebody guide me?

P.S: if you need anymore information , let me know.


2020-10-04 13:50:53.129 DEBUG 18704 --- [nio-8080-exec-2] o.a.coyote.http11.Http11InputBuffer      : Received [GET /catalog/1 HTTP/1.1
User-Agent: PostmanRuntime/7.26.5
Accept: */*
Cache-Control: no-cache
Postman-Token: 2d855b91-4ee7-408f-99f0-5d89780e7902
Host: localhost:8080
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

2020-10-04 13:50:53.129 DEBUG 18704 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header null
at$NioSocketWrapper.fillReadBuffer( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at$ ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at org.apache.coyote.http11.Http11InputBuffer.fill( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at org.apache.coyote.http11.Http11Processor.service( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at org.apache.coyote.AbstractProcessorLight.process( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at$SocketProcessor.doRun( ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$ ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$ ~[tomcat-embed-core-9.0.38.jar:9.0.38]
at java.base/ ~[na:na]

7 months ago

Campbell Ritchie wrote:

ssiva raman wrote:. . . i cant afford to use external jars . . .

What does that mean? Don't put your own text in quote tags.

that means , i don't want to use any open source jars like jsoup.jar to navigate through the page that i've connected.
All i need to know is how to head start this thing.

do you think you can help with that?

thank you
4 years ago
Hi ,

Actually , i encountered a requirement that i should have a java application to connect and navigate to report files as xml/jason in jenkins.

my problem is,

which technique i should choose in java for this?

can i do it purely by core java?

i tried it using UrlConnect object and read it , and was successfull. but i find it hard for deeper navigation for embedded links in the connected portal.

i cant afford to use external jars

thank you
4 years ago
hi tim,

thanks for the reply.

that helped.but i want to do that ,unlike NameCaller , without changing the original source code.

do you have anyother idea?
4 years ago