[JBossWS] - Best Practices for Dates
by awhitford
I have a web service that returns Dates. Imagine something simple like:
| @WebMethod
| Date getCurrentBusinessDate()
|
In this case, I am only interested in a Date (not a Time or Date Time). This is by design because otherwise one might go down the road of considering Time Zones, etc. -- and that is not necessary for this case.
When running something like this, we see a full date/time appear in the SOAP result. Sure, the time is zero/midnight, but it also mentions a time zone (which really shouldn't be there, but seems to be impossible to get rid of).
By rights, I really only want to see a Date transmitted (like YYYY-MM-DD). In JPA, for example, I use a Date type but qualify it with a @Temporal annotation to clarify the TemporalType (Date, Time, DateTime). I see that JAXB has similar distinctions (xsd:date, xsd:time, xsd:dateTime).
Is there a way to annotate the web method so the return value is clarified to be an xsd:date?
Secondly... Is there a material difference between using java.util.Date vs. java.util.Calendar? (Is one really preferred over the other?) If I am writing Java-first Web Services, should I be using Date or Calendar to represent dates?
Thanks for your help!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191502#4191502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191502
17 years, 7 months
[Installation, Configuration & DEPLOYMENT] - Can not establish the connection with MSSQL [seam project]
by mariuszt
Hello everyone,
I don't have much experiance with jboss... so please be patient :)
I'm trying to deploy seam project.
My seam project depend on MSSQL database, I have used with my project the sqljdbc4.jar driver.
When I'm trying to depoly the project I recieve this warning message:
2008-11-22 20:41:04,283 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Please use the JDBC 4 driver (sqljdbc4.jar) instead.)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:190)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:264)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:575)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:347)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:402)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
....
And I can not establish the connection.
JBoss version: jboss-4.2.3.GA
Java version: jdk1.6.0_10
I was trying to run JBoss in JRE 5 environment but I recived a long list of exception.
Do You have any idea?
I should try to run jboss on JRE 5 enviorment?
Is JDBC driver for MSSQL database compatible with JRE 6? I found some information that it is compatible with JRE 1.4 and higher...
Can You give me some advice?
Regards
Mariusz
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191499#4191499
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191499
17 years, 7 months