Vikki Fiawoo

Greenhorn
+ Follow
since Oct 22, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vikki Fiawoo

Hi Henry,

Thank you for your explanation. It really helped me.

Could you please elaborate a little further on the this part of the code?

12 years ago
Good Evening,

Below is a sample code using StringBuffer and char [] cbuf.

I am trying to understand the purpose of using the char [] cbuf in the code. I have included comments as to how I have decipher the code.
If you can please provide feedback, by removing or editing any part of the comments that I have included that is not true or does not apply, so that I can better understand this piece of code. I have worked with BufferedReader before but not really StringBuffer, so I am lost here.

12 years ago

Tim Holloway wrote:We very definitely do have a Hibernate forum: Object Relational Mapping

However, before tossing this thread over there (there's nothing JSF-specific about Hibernate or vice versa), I have 2 questions:

1. Is this legacy Hibernate or is it JPA? It appears to be JPA.

2. What are you using to initialize the Hibernate environment? Spring Framework or user code?




This is JPA and I am using user code to initialize the Hibernate environment. Please see the code that I tested and it was able to persist without the Dynamic Web Project...





12 years ago
JSF
Good Morning,

I have been trying to get my JSF/JPA project to persist into my Oracle database but I am getting the following stack trace each time:

1218 [http-bio-1979-exec-7] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
1328 [http-bio-1979-exec-7] INFO org.hibernate.cfg.Environment - Hibernate 3.6.4.Final
1343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.Environment - hibernate.properties not found
1422 [http-bio-1979-exec-7] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
1468 [http-bio-1979-exec-7] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
3281 [http-bio-1979-exec-7] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.4.0.GA
4328 [http-bio-1979-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.thebinaryheap.model.entity.BhUser
4547 [http-bio-1979-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.thebinaryheap.model.entity.BhUser on table BH_USER
4750 [http-bio-1979-exec-7] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
4843 [http-bio-1979-exec-7] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
4859 [http-bio-1979-exec-7] WARN org.hibernate.connection.UserSuppliedConnectionProvider - No connection properties specified - the user must supply JDBC connections
5109 [http-bio-1979-exec-7] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle10gDialect
5203 [http-bio-1979-exec-7] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as connection was null
5203 [http-bio-1979-exec-7] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
5250 [http-bio-1979-exec-7] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
5250 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
5250 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: disabled
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
5265 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
5343 [http-bio-1979-exec-7] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: enabled
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
5343 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
5359 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
5359 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
5359 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
5359 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
5359 [http-bio-1979-exec-7] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
5547 [http-bio-1979-exec-7] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@9801f4
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [clob] overrides previous : org.hibernate.type.ClobType@1a86488
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@1a86488
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@605b1e
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@1fe1e26
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@6d75b6
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [blob] overrides previous : org.hibernate.type.BlobType@4b3f8b
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@4b3f8b
5578 [http-bio-1979-exec-7] INFO org.hibernate.type.BasicTypeRegistry - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@38fb59
6031 [http-bio-1979-exec-7] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
Jul 12, 2012 10:04:16 AM com.sun.faces.lifecycle.InvokeApplicationPhase execute
WARNING: #{login.doLogin}: java.lang.UnsupportedOperationException: The user must supply a JDBC connection
javax.faces.FacesException: #{login.doLogin}: java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Here is my persistence.xml




I have two projects setup. A JPA project and Dynamic Web Project. I use the JPA Project and added it to the Deployment Assembly of the Dynamic Web Project. When I test the JPA Project by itself, I am able to get the data to persist. However, when I use the JSF, it keeps giving me this error message of The user must supply a JDBC connection.


Is there something wrong with my persistence.xml file?
Is there something missing from my build path?
Do I need a hibernate.cfg.xml file?


Please advise.


Thanks
12 years ago
JSF
Good Afternoon,

I have a pretty strange problem I am facing. On December 2, I was able to successfully deploy a project that is bundled as a jar file. I used the Glassfish Administration Console to deploy the jar file and I encountered no problems. Then today, I tried to work on the same project and it would not work. So I decided to re-deploy the jar file and now I am getting the following error message:

Exception Occurred :Error occurred during deployment: There is no installed container capable of handling this application jwsur_code. Please see server.log for more details.

I do not know why this is happening.

Another option I tried was to auto-deploy the jar file in the autodeploy folder in Glassfish. Can someone please help me understand why this is not working now? What could possible be wrong,? Is there any solution to this?




P.S. I am using Glassfish 3.x/J2ee 1.6.

Thanks in advance for your help
13 years ago
I have a simple question that has been driving me crazy for a few hours. I have researched all of over the web and cannot still seem to figure it out.

I have variable that I have set to a BigInteger. For example,



The this value is stored in the database as a tinyint.



I want to retrieve the data from the database using a resultset. I have tried several different datatypes and none of them are working. I am keep getting an error when I try to build my code. Here are some examples that I have tried to use:



I was also thinking that I need to explicitly convert the result set into a BigInteger.
Can someone please help with the mapping of my java BigInteger datatype and the correct sql datatype to use in my resultset. An example of this mapping would be extremely helpful


Good Morning,

I am trying to run a simple jsp that will Sql Server 2008 connection using JBOSS 5.1 (Enterprise Application). Please find below the tutorial. It is under the section
Configuring a datasource for Microsoft SQL Server 200x
http://docs.jboss.org/jbossas/docs/Installation_And_Getting_Started_Guide/5/html/Using_other_Databases.html

1.)

Here is how I modified the mssql-ds.xml file:



I placed this file in the C:\Program Files\EnterprisePlatform-5.1.0\jboss-eap-5.1\jboss-as\server\default\deploy folder.


2.) I copied the sqljdbc4.jar file in the C:\Program Files\EnterprisePlatform-5.1.0\jboss-eap-5.1\jboss-as\server\default\lib folder

3.) I created a WAR folder jdbcclient.war in the C:\Program Files\EnterprisePlatform-5.1.0\jboss-eap-5.1\jboss-as\server\default\deploy folder.

4.) I created a jsp called client.jsp and saved it in the jbdcclient.war folder. Here is the client.jsp code:



5. I tried to test if the connectioni using the following url

http://localhost:8080/jdbcclient/client.jsp


There are a few things I would like to mention. After reading some of the many posts in this forum on this topic, I have noticed that do not have sqljdbc_auth.dll file copied anywhere in JBOSS. So I only copied the path tot the sqljdbc_auth.dll to the Systems Variables PATH. Should this file be copied anywhere else? If so, where specifically where I copy the file.

Also, I am using a Window Authenciation to access the Sql Server database. I feel very strongly that my mssql-ds.xml file is not configured properly. I have tried modified this file several different ways and have read numerous documentation and still can not get this client.jsp to work.

I am just trying to test my connectivity from Sql Server to JBoss and this seems to be so difficult to do.

Please provide me with assistances on how to modified my files and/or where to copy any necessary jars. I have been on this for 12 hours and at this point I do not now what to do. I have also attached the error message I am receiving.
I got it working!! I took out the "." and ";" and restarted my computer.

Complied the java file within the packages (directories) and it works fine.
14 years ago
I do not know what went wrong. Everything was working fine, until I made changes to my CLASSPATH in the Enviroment Variables. I do not know exactly what I changed because I kept revising it. Currently in only contains the following:



I am using Tomcat 6 with jdk 1.6.0_21. If you notice the above code, I do not have a "." or a ";" in the beginning of the value.

Any ideas? It's driving me insane because it was working on Thursday.

Thanks in advance for your help.
14 years ago
What type of files can I attached. I tried attaching .txt, .doc, and .java with no such luck. So I just give up.

Here is how listed the jar files in the CLASSPATH



Here are snippets of the web.xml file saved in C:\tomcat\conf









Here is the original web.xml file saved in C:\tomcat\webapps\ROOT\WEB-INF

14 years ago
Good Afternoon;

I am a newbie trying to figure out how to simply get my first servlet to run. The servlet is name "HelloServlet."

The first initial test that I am running is a "Servlet That Does Not Use Packages." When I compile the file for the command prompt and use the URL localhost:1979/servlet/HelloServlet, I get an error message of stating that the requested resource (/servlet/HelloServlet) is not available.

I have checked my CLASSPATH, but I am not sure it setup correctly. All of my HTML and JSP files are working with my server except for the one servlet. I have been working on this since 7:00 a.m. this morning and now is 1:00 p.m. I am exhausted and hoping that someone has an answer as to what I am doing wrong in setting up my environment.

In addition, I keeping thinking that my web.xml file in the C:\tomcat\webapps\ROOT\WEB-INF needs to be modified. I have already followed the installation instructions and have uncommented the web.xml located in C:\tomcat\conf and made to servlet and servlet mapping.


I have attached the text file with my existing CLASSPATH, screenshot of where my jar files are saved, and where the location of where I am saving my files to compile.

Thank you in advance for all of your help.
14 years ago