Steve Deadsea

Ranch Hand
+ Follow
since Dec 03, 2001
Merit badge: grant badges
For More
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 Steve Deadsea

Finally figured it out.

The problem is c.buildSessionFactory(new ServiceRegistryBuilder().buildServiceRegistry());

c.buildSessionFactory() is the way to go, even though it has been deprecated in hibernate 4.0.0.
Looking into what it does, it creates a serviceregistry and then copies the properties from the configuration over into the serviceregistry. It is not enough to use an empty service registry. It appears that the intent was to deprecate the entire Configuration class in hibernate 4.0.0. I have not found a hibernate configuration example that only uses the service registry and does not use configuration yet.

I chalk this up to the unhelpful deprecation documentation on c.buildSessionFactory().
I've been beating my head against this issue with hibernate all day. It appears to me that hibernate is not finding the properties that I'm setting and its complaining about 'hibernate.dialect' not being set. But its also complaining about 'no appropriate connection provider', so I'm not sure what the root issue is. In any case, I've boiled it down to a small test case the demonstrates the problem:

$ ls -1 lib

$java test.HibernateConfig
Jan 11, 2012 10:28:35 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Jan 11, 2012 10:28:35 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.0.0.Final}
Jan 11, 2012 10:28:35 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: not found
Jan 11, 2012 10:28:35 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Jan 11, 2012 10:28:35 PM org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator initiateService
WARN: HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
Exception in thread "main" org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(
at org.hibernate.cfg.SettingsFactory.buildSettings(
at org.hibernate.cfg.Configuration.buildSettingsInternal(
at org.hibernate.cfg.Configuration.buildSettings(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at test.HibernateConfig.getHibernateSessionFactory(
at test.HibernateConfig.main(

All the jar files that I listed in the lib directory are in my classpath. Maybe I'm missing something. Maybe I don't have the syntax for the configuration correct. I can't figure it out at this point. Can anybody help?
I thought that maven worked at the jar level, not at the class level. No?
13 years ago
A few years ago I could have sworn that I read about a jar creation tool that would automatically discover what class files would be needed for a application and build a jar file with just those class files. I believe that you provided it with the name of the class or classes that had entry points (main methods) and it would see what they depended on usiing static analysis. It would look at both things that were compiled as dependencies and things that might be dependencies because of strings that looked like class names to load via reflection.

Such a tool would be really useful to me now, but I can't seem to find it on Google right now. Is anybody familiar with it?
13 years ago
I would agree that the geographical coverage in peru isn't all that great. There is a development team that is working on getting more complete geography for the less traveled places in the world.
16 years ago
TripAdvisor has a travel map that have have marked with all the places in the world that I visited:

Where have you traveled? Sign in and create your own travel map and link to your profile URL here.

I work for TripAdvisor and we just rolled out the travel map and I thought I would share it with everybody here.
16 years ago
I'd say that multiplex most closely means "handle multiple" or "deal with multiple" in this instance.

It used to be that you would get stuck on any single stream because you would try to read from it and wait minutes for data to come in on that stream. In the meantime data would come in on your other streams and your single threaded program would appear to be hung and unresponsive.
18 years ago
Switch to Linux. Unlike Windows, Linux doesn't put silly restrictions like that on files. Multiple programs can have a file open and one program can delete a file even when another is using it (it won't actually go away until the other program is done with it)
18 years ago
I recently wrote an article that explains how to convert an outputstream to an inputstream using any one of three methods: byte arrays, piped streams, or circular buffers.
18 years ago
I'd get out a packet sniffer and see exactly what the headers are as they are being sent across.

For firefox, this is easy to do with the live headers plugin, but for ie, you will need a packet sniffer.
18 years ago
Use the append parameter to the FileWriter constructor:
new FileWriter(path + "\\"+ navbarindex, true)
18 years ago
If you are using a hashtable for each record, that might be some part of the problem. I don't know how big the default size for a hash table is, but it could have hundreds or thousands of entries when you are using only four. You can specify the size of the hashtable you want when you create it. Alternatly, I might suggest creating a new object type called Record that implements the Comparable interface and has a field for each of name, address, etc.
20 years ago
Why a makefile? They are not suited to the task that you propose. Make does not pass command line arguments to tasks, so you would not be able to specify how many times you wanted to run the task.
Make is designed to build files when another file it depends on changes.
The only way I see this working is if you had some number in one file, say in.txt and you always wanted the number in some othe file, say out.txt to be 10 greater. In that case you might set up a makefile like this: ([tab] means a tab character goes there)
out.txt: in.txt
[tab]cat in.txt | java add 10 > out.txt
Any time that in.txt changed, you could type make and out.txt would be updated.
To add in the number of times that you wanted this to execute, I would think that have to write a wrapper script. Make has no concepts of loops or branches.
[ November 05, 2002: Message edited by: Steve Deadsea ]
20 years ago