OC4J 10.1.3.2, JPA and Hibernate 3.2 Exception on Deployment

I can't get my simple web application to deploy in my standalone oc4j container. The European organization that I working for wants to use the new technologies out there. Part of the testing is getting oc4j working with hibernate. My web application works just fine with Toplink, but not with Hibernate3. The same web application in Tomcat works for both. The error that oc4j generates is shown below and really doesn't say much that I can do. I followed this blog instructions.
http://debupanda.blogspot.com/2007/01/using-hibernate-as-pluggable-ejb-3-jpa.html
2007-04-23 11:48:57.477 NOTIFICATION Starting application : TestJPA
2007-04-23 11:48:57.477 NOTIFICATION Initializing ClassLoader(s)
2007-04-23 11:48:57.477 NOTIFICATION Initializing EJB container
2007-04-23 11:48:57.477 NOTIFICATION Loading connector(s)
2007-04-23 11:48:57.524 NOTIFICATION Starting up resource adapters
2007-04-23 11:48:57.524 NOTIFICATION Initializing EJB sessions
2007-04-23 11:48:57.524 NOTIFICATION Committing ClassLoader(s)
2007-04-23 11:48:57.524 NOTIFICATION Initialize TestJPA begins...
2007-04-23 11:48:57.539 NOTIFICATION Initialize TestJPA ends...
2007-04-23 11:48:57.539 NOTIFICATION Started application : TestJPA
2007-04-23 11:48:57.555 NOTIFICATION Binding web application(s) to site default-
web-site begins...
2007-04-23 11:48:57.571 NOTIFICATION Binding TestJPA web-module for application
TestJPA to site default-web-site under context root jpa
07/04/23 11:48:57 oracle.oc4j.admin.internal.DeployerException: [TestJPA:TestJPA
] - Exception creating EntityManagerFactory using PersistenceProvider class org.
hibernate.ejb.HibernatePersistence for persistence unit TestPU.
07/04/23 11:48:57 at com.evermind.server.ejb.exception.DeploymentException
.exceptionCreatingEntityManagerFactory(DeploymentException.java:130)
07/04/23 11:48:57 at com.evermind.server.ejb.persistence.PersistenceUnitMa
nagerImpl.createContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:19
7)
07/04/23 11:48:57 at com.evermind.server.ejb.persistence.PersistenceUnitMa
nagerImpl.initializePersistenceUnit(PersistenceUnitManagerImpl.java:159)
07/04/23 11:48:57 at com.evermind.server.ejb.persistence.PersistenceUnitMa
nagerImpl.initialize(PersistenceUnitManagerImpl.java:86)
07/04/23 11:48:57 at com.evermind.server.http.HttpApplication.<init>(HttpA
pplication.java:733)
07/04/23 11:48:57 at com.evermind.server.ApplicationStateRunning.getHttpAp
plication(ApplicationStateRunning.java:414)
07/04/23 11:48:57 at com.evermind.server.Application.getHttpApplication(Ap
plication.java:571)
07/04/23 11:48:57 at com.evermind.server.http.HttpSite$HttpApplicationRunT
imeReference.createHttpApplicationFromReference(HttpSite.java:1990)
07/04/23 11:48:57 at com.evermind.server.http.HttpSite$HttpApplicationRunT
imeReference.<init>(HttpSite.java:1909)
07/04/23 11:48:57 at com.evermind.server.http.HttpSite.addHttpApplication(
HttpSite.java:1606)
07/04/23 11:48:57 at oracle.oc4j.admin.internal.WebApplicationBinder.bindW
ebApp(WebApplicationBinder.java:238)
07/04/23 11:48:57 at oracle.oc4j.admin.internal.WebApplicationBinder.bindW
ebApp(WebApplicationBinder.java:99)
07/04/23 11:48:57 at oracle.oc4j.admin.internal.ApplicationDeployer.bindWe
bApp(ApplicationDeployer.java:547)
07/04/23 11:48:57 at oracle.oc4j.admin.internal.ApplicationDeployer.doDepl
oy(ApplicationDeployer.java:202)
07/04/23 11:48:57 at oracle.oc4j.admin.internal.DeployerBase.execute(Deplo
yerBase.java:93)
07/04/23 11:48:57 at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeploy
erRunnable.doRun(OC4JDeployerRunnable.java:52)
07/04/23 11:48:57 at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRu
nnable.run(DeployerRunnable.java:81)
07/04/23 11:48:57 at com.evermind.util.ReleasableResourcePooledExecutor$My
Worker.run(ReleasableResourcePooledExecutor.java:298)
07/04/23 11:48:57 at java.lang.Thread.run(Unknown Source)
2007-04-23 11:48:57.726 NOTIFICATION Application Deployer for TestJPA FAILED.
2007-04-23 11:48:57.726 NOTIFICATION Application UnDeployer for TestJPA STARTS.
2007-04-23 11:48:57.742 NOTIFICATION Removing all web binding(s) for application
TestJPA from all web site(s)
07/04/23 11:48:57 SEVERE: ProgressObjectImpl.reportError [TestJPA:TestJPA] - Exc
eption creating EntityManagerFactory using PersistenceProvider class org.hiberna
te.ejb.HibernatePersistence for persistence unit TestPU.oracle.oc4j.admin.jmx.sh
ared.exceptions.InternalException: [TestJPA:TestJPA] - Exception creating Entity
ManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersis
tence for persistence unit TestPU.
at oracle.oc4j.admin.jmx.shared.deploy.NotificationUserData.<init>(Notif
icationUserData.java:107)
at oracle.oc4j.admin.internal.Notifier.reportError(Notifier.java:429)
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:123
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun
(OC4JDeployerRunnable.java:52)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(Deplo
yerRunnable.java:81)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
sableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Unknown Source)
Caused by: oracle.oc4j.admin.internal.DeployerException: [TestJPA:TestJPA] - Exc
eption creating EntityManagerFactory using PersistenceProvider class org.hiberna
te.ejb.HibernatePersistence for persistence unit TestPU.
at com.evermind.server.ejb.exception.DeploymentException.exceptionCreati
ngEntityManagerFactory(DeploymentException.java:130)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.create
ContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:197)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initia
lizePersistenceUnit(PersistenceUnitManagerImpl.java:159)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initia
lize(PersistenceUnitManagerImpl.java:86)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:
733)
at com.evermind.server.ApplicationStateRunning.getHttpApplication(Applic
ationStateRunning.java:414)
at com.evermind.server.Application.getHttpApplication(Application.java:5
71)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.cre
ateHttpApplicationFromReference(HttpSite.java:1990)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<in
it>(HttpSite.java:1909)
at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:16
06)
at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplica
tionBinder.java:238)
at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplica
tionBinder.java:99)
at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(Application
Deployer.java:547)
at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDe
ployer.java:202)
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
... 4 more
2007-04-23 11:48:58.225 NOTIFICATION Application UnDeployer for TestJPA COMPLETE
S.
07/04/23 11:48:58 WARNING: DeployerRunnable.run [TestJPA:TestJPA] - Exception cr
eating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.Hi
bernatePersistence for persistence unit TestPU.oracle.oc4j.admin.internal.Deploy
erException: [TestJPA:TestJPA] - Exception creating EntityManagerFactory using P
ersistenceProvider class org.hibernate.ejb.HibernatePersistence for persistence
unit TestPU.
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun
(OC4JDeployerRunnable.java:52)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(Deplo
yerRunnable.java:81)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
sableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Unknown Source)

I am not using JDeveloper, the project was created in Netbeans 5.5. I only use the WAR created and Deploy it using the web administration of Oracle 10.1.3.2

Similar Messages

  • [NewBie] Not able to connect JPA and Hibernate ?

    Hi,
    In last few days I have read some tutorial and started doing JPA and Hibernate tutorials. But I am not able to make it work. Can some one please point out what is that I am doing wrong? Here are the details of what I am doing
    I am using
    IDE : Eclipse EE Indigo
    Following jars
    antlr-2.7.6.jar
    commons-collections-3.2.jar
    dom4j-1.6.1.jar
    hibernate-annotations-3.4.0.GA.jar
    hibernate-commons-annotations-3.1.0.GA.jar
    hibernate-entitymanager-3.4.0.GA.jar
    hibernate-jpa-2.0-api.jar
    hibernate3-3.3.2.GA.jar
    javaee-api-5.0-3.jar
    javassist-3.9.0.GA.jar
    junit-4.8.2.jar
    log4j-1.2.12.jar
    slf4j-api-1.6.1.jar
    slf4j-simple-1.6.1.jar
    sqljdbc.jar => For connecting to MS SQL Server database
    junit-4.8.2 => For testing the application
    The target runtime is set as JBoss 5.0 with jars of JBoss 6.0
    Here is my persistence.xml. This file is under "src\META-INF"
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
         <persistence-unit name="JH1" transaction-type="RESOURCE_LOCAL">
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <class>entity.Users</class>
              <exclude-unlisted-classes>false</exclude-unlisted-classes>
              <properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
                   <property name="hibernate.show_sql" value="true"/>
                   <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost:1433;databaseName=TempEPMUser"/>
                   <property name="javax.persistence.jdbc.user" value="user"/>
                   <property name="javax.persistence.jdbc.password" value="password"/>
                   <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
                   <property name="javax.persistence.transactionType" value="RESOURCE_LOCAL"/>
              </properties>
         </persistence-unit>
    </persistence>
    Here is the Users.java code. This is the entity class created using the context menu item JPA Entities from tables
    package entity;
    import java.io.Serializable;
    import javax.persistence.*;
    import java.sql.Timestamp;
    import java.math.BigDecimal;
    * The persistent class for the Users database table.
    @Entity
    public class Users implements Serializable { 
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="Usr_UserID")
    private long usr_UserID;
    @Column(name="Usr_DeptId")
    private BigDecimal usr_DeptId;
    public Users() { 
    public long getUsr_UserID() { 
    return this.usr_UserID;
    public void setUsr_UserID(long usr_UserID) { 
    this.usr_UserID = usr_UserID;
    Here is the testing code TestUser.java
    package testentity;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.PersistenceException;
    import org.apache.log4j.BasicConfigurator;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import entity.Users;
    public class TestUser {
         private EntityManagerFactory emf;
         private EntityManager em;
         @Before
         public void initEmfAndEm(){
              BasicConfigurator.configure();
              try {
                   emf = Persistence.createEntityManagerFactory("JH1");
              } catch (PersistenceException pe) {
                   System.out.println(pe.getMessage());
              em = emf.createEntityManager();
         @After
         public void cleanup() {
              em.close();
         @Test
         public void emptyTest() {
              EntityTransaction et = em.getTransaction();
              et.begin();
              @SuppressWarnings("unchecked")
              final List<Users> listUser = em.createQuery("select usr_DeptID from Users").getResultList();
              et.commit();
              for (Users usr: listUser){
                   int depid = usr.getUsr_DeptId().intValue();
                   System.out.println("User Department id is "+depid);
    When I execute the code I get following error message
    java.lang.UnsupportedOperationException: The user must supply a JDBC connection
    at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:54)
    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
    at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
    at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
    at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)
    at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
    at testentity.TestUser.emptyTest(TestUser.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

    Hi,
    Try following the JPA tutorials for WebLogic, JPA using EclipseLink or Hibernate will be the same if you stick to the specification. WebLogic 10.3.4.0 ships with a Java EE 6 compliant JPA 2.0 implementation in EclipseLink - you may want to give that a try.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial
    http://wiki.eclipse.org/EclipseLink/Examples/Distributed
    I also have a JBoss 6 tutorial for getting JPA working as well.
    BTW, your persistence unit is currently application managed - try switching to container managed - then most of your jar dependencies will go away as everything is already setup for you to do dependency injection via the container.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial
    thank you
    Michael O'Brien
    http://www.eclipselink.org

  • What are the relation between JPA and Hibernate, JPA and TopLink?

    What are the relation between JPA and Hibernate, JPA and TopLink?
    Can JPA instead of Hibernate and TopLink?

    The Java Persistence API (JPA) is the object relational mapping persistence
    standard for Java. Hibernate and TopLink provide an Open source Object-relational mapping framework for Java.
    They provide an implementation for the Java Persistence API. In my opinion, both Hibernate and TopLink provide support to JPA
    and they can also be regarded as the complementary to JPA.
    Let's wait to see other person's opinions.

  • JPA AND HIBERNATE (createquery PB)

    Hi,
    I have an issue in jpa-hibernate program :
    try{
    List dmvs = em.createQuery("select c from Dmv as c order by c.num ASC").getResultList();
    System.err.println("found finsh");
    if (dmvs==null ||dmvs.size() == 0) {
         return -1;
    for (Iterator iter = dmvs.iterator(); iter.hasNext();) {
    Dmv element1 = (Dmv) iter.next();***
    }catch(Exception x){
    x.printStackTrace();
    }the problem is that the em.creatyQueury after 1 or 2 days is blocked and don't return data or exception error !!
    Edited by: user12936212 on 15 juin 2012 03:36
    Edited by: user12936212 on 15 juin 2012 03:45

    Hello,
    You will need to debug your application and obtain a java thread dump when the problem occurs, and possibly check out the locks in the database to see what might be causing the issue. As you are using Hibernate, you might want to post your product specific questions on the particular product forum - or try using TopLink/EclipseLink as the JPA provider and see if you get the same issue.
    Best Regards,
    Chris

  • JPA and Hibernate

    Is the Java Persistence API the same as Hibernate or is it a generic Java interface to Hibernate implementations? It appears to have several similarities with Hibernate.

    Adhir_Mehta wrote:
    ADJavaUser wrote:
    Is the Java Persistence API the same as Hibernate These two belong to two different parties however purpose of both are same (Object relational Mapping). JPA (earlier known as entity beans) is part of J2EE specification however hibernate is thrid party API provides the OR Mapping.
    Wrong. Hibernate is a product implementing JPA, that's all.
    JPA != Entity Beans.
    JPA != part of J2EE.
    or is it a generic Java interface to Hibernate implementations? No.
    Wrong. Hibernate implements JPA, therefore JPA is an interface to Hibernate.
    It's not an interface to the full functionality of Hibernate though.
    It appears to have several similarities with Hibernate.Yes.Wrong.
    JPA isn't similar to Hibernate. Hibernate is a product, JPA a specification. Completely different beasts.

  • JPA and Database View.

    Hi people...
    I working with JPA and Hibernate and i have a View in my Database and i need to map this View. It's this possible? Some have an example to show me?.
    Thanks!

    I hope this link help you
    http://forums.java.net/jive/message.jspa?messageID=244187
    I�m having a similar problem, I�m developing using JPA and now I need to bring values from some views on database but I still don�t know how.I�m still Java jr and I didn�t understand clearly but I guess that the link can help you, and if it�s true please explain me.

  • Deployement problem in oc4j with hibernate + JPA and Spring

    Dear All,
    From last 2 days I am facing a problem in deployment of our application in oc4j client of oracle app server.
    I am getting the following exception
    Operation failed with error: [mkclsets:mkclsets] - Exception creating EntityManagerFactory using PersistenceProvider class oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider for persistence unit mkclsetsPersistenceUnit.When I am deploying the same application in tomcat app server its working fine. But I am unable to deploy the same in oc4j.
    I am using the following technologies
    Spring 2.0
    Struts 2.0
    Hibernate 3.3
    JPA 1.0
    OC4J 10.1.3.3.0
    IDE : my eclipse 6.0
    My persistence.xml
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
        version="1.0">
         <persistence-unit name="mkclsetsPersistenceUnit" transaction-type="RESOURCE_LOCAL">
              <!-- jta-data-source>mkclDS</jta-data-source-->
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <!-- properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
                   <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.OC4JTransactionManager"/>
              </properties-->
         </persistence-unit>
    </persistence>Datasource-context.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
         <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" lazy-init="true"/>
         <!--  following code is for using oracle -->
            <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
              <property name="driverClassName">
                   <value>oracle.jdbc.driver.OracleDriver</value>
              </property>
              <property name="url">
                   <value>jdbc:oracle:thin:@//xxxx.xxxx.xxxx.xxxx:1521/mydb</value>
              </property>
              <property name="username">
                   <value>tpsadmin</value>
              </property>
              <property name="password">
                   <value>tpsadmin</value>
              </property>
         </bean>
         <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" lazy-init="true">
              <property name="persistenceUnitName" value="mkclsetsPersistenceUnit"/>
              <property name="dataSource" ref="dataSource"/>
              <property name="jpaVendorAdapter">
                   <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" lazy-init="true">
                        <property name="database" value="ORACLE"/>               
                        <property name="showSql" value="true"/>
                   </bean>
              </property>
         </bean>
         <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" lazy-init="true">
              <property name="entityManagerFactory" ref="entityManagerFactory"></property>
         </bean>
         <tx:annotation-driven transaction-manager="transactionManager"/>     
    </beans>Server.xml (oc4j/j2ee/home/config)
    <?xml version="1.0"?>
    <application-server  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/application-server-10_1.xsd"  application-directory="../applications"
    check-for-updates="adminClientOnly"
    deployment-directory="../application-deployments"
    connector-directory="../connectors"
    schema-major-version="10" schema-minor-version="0" >
         <shared-library name="global.libraries" version="1.0" library-compatible="true">
              <code-source path="../applib"/>
         </shared-library>
         <shared-library name="global.tag.libraries" version="1.0" library-compatible="true">
              <code-source path="../../home/jsp/lib/taglib/"/>
              <code-source path="../../../j2ee/home/jsp/lib/taglib/"/>
              <code-source path="../../../lib/dsv2.jar"/>
              <import-shared-library name="oracle.xml"/>
              <import-shared-library name="oracle.jdbc"/>
              <import-shared-library name="oracle.cache"/>
              <import-shared-library name="soap"/>
         </shared-library>
         <shared-library name="oracle.persistence" version="1.0" library-compatible="true">
              <code-source path="../../../toplink/jlib/toplink-essentials.jar"/>
              <import-shared-library name="oracle.jdbc"/>
         </shared-library>
         <shared-library name="hibernatejpa" version="1.0">
              <code-source path="ejb3-persistence.jar"/>
              <code-source path="hibernate3.jar"/>
              <code-source path="hibernate-annotations.jar"/>
              <code-source path="hibernate-commons-annotations.jar"/>
              <code-source path="hibernate-entitymanager.jar"/>
              <code-source path="jboss-archive-browsing.jar"/>
              <code-source path="jta.jar"/>
         </shared-library>
         <shared-library name="db" version="1.0">
              <code-source path="ojdbc14.jar"/>
         </shared-library>
         <shared-library name="displaytab" version="1.0">
              <code-source path="commons-beanutils-1.7.0.jar"/>
              <code-source path="commons-lang-2.3.jar"/>
              <code-source path="displaytag-1.1.1.jar"/>
         </shared-library>
         <shared-library name="ehCache" version="1.0">
              <code-source path="backport-util-concurrent.jar"/>
              <code-source path="ehcache-1.4.0-beta2.jar"/>
              <code-source path="jsr107cache-1.0.jar"/>
         </shared-library>
         <shared-library name="json" version="1.0">
              <code-source path="ezmorph-1.0.4.jar"/>
              <code-source path="json.jar"/>
         </shared-library>
         <shared-library name="other_sets" version="1.0">
              <code-source path="commons-fileupload-1.1.jar"/>
              <code-source path="dom4j-1.6.1.jar"/>
              <code-source path="dwr.jar"/>
              <code-source path="javassist.jar"/>
              <code-source path="log4j-1.2.13.jar"/>
         </shared-library>
         <shared-library name="spring2" version="1.0">
              <code-source path="aspectjrt.jar"/>
              <code-source path="aspectjweaver.jar"/>
              <code-source path="cglib-nodep-2.1_3.jar"/>
              <code-source path="spring.jar"/>
         </shared-library>
         <shared-library name="struts2" version="1.0">
              <code-source path="antlr-2.7.2.jar"/>
              <code-source path="commons-collections.jar"/>
              <code-source path="commons-io-1.1.jar"/>
              <code-source path="commons-logging-1.0.4.jar"/>
              <code-source path="freemarker-2.3.8.jar"/>
              <code-source path="ognl-2.6.11.jar"/>
              <code-source path="struts2-core-2.0.9.jar"/>
              <code-source path="struts2-spring-plugin-2.0.9.jar"/>
              <code-source path="xwork-2.0.4.jar"/>
         </shared-library>
         <rmi-config path="./rmi.xml" />
         <jms-config path="./jms.xml" />
         <javacache-config path="../../../javacache/admin/javacache.xml" />
         <j2ee-logging-config path="./j2ee-logging.xml" />
         <log>
              <file path="../log/server.log" />
         </log>
         <java-compiler name="javac" in-process="false" options="-J-Xmx1024m -encoding UTF8" extdirs="C:\Program Files\Java\jdk1.5.0_07\jre\lib\ext" />
         <global-application name="default" path="application.xml" parent="system" start="true" />
         <application name="javasso" path="../../home/applications/javasso.ear" parent="default" start="false" />
         <application name="ascontrol" path="../../home/applications/ascontrol.ear" parent="system" start="true" />
         <application name="Test" path="../applications\Test.ear" parent="default" start="true" />
         <application name="OraTest" path="../applications\OraTest.ear" parent="default" start="true" />
         <global-web-app-config path="global-web-application.xml" />
         <transaction-manager-config path="transaction-manager.xml" />
         <web-site default="true" path="./default-web-site.xml" />
         <cluster  id="6745699755968" />
    </application-server>Orion-application.xml (oc4j/j2ee/home/config)
    <?xml version="1.0"?>
    <orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd" deployment-version="10.1.3.1.0" default-data-source="jdbc/OracleDS" component-classification="external"
    schema-major-version="10" schema-minor-version="0" >
    <imported-shared-libraries>
         <import-shared-library name="hibernatejpa"/>
         <import-shared-library name="db"/>
         <import-shared-library name="displaytab"/>
         <import-shared-library name="ehCache"/>
         <import-shared-library name="json"/>
         <import-shared-library name="other_sets"/>
         <import-shared-library name="spring2"/>
         <import-shared-library name="struts2"/>
    </imported-shared-libraries>
    </orion-application>Please help to deploy my application, I created one application with struts2 and spring2 and that is working fine, but when I try to add JPA with hibernate 3.3 I am unable to deploy it.
    Thanks a lot in advance.
    With best regards,
    Ishaan

    Hi,
    Thank you very much for your reply. the previous Exception has gone but now I get the following one.
    Exception: NoClassDefFoundError: Missing class: org.dom4j.DocumentException Dependent class: org.hibernate.ejb.HibernatePersistence Loader: hibernatejpa:1.0 Code-Source: /C:/oracle123/j2ee/home/shared-lib/hibernatejpa/1.0/hibernate-entitymanager.jar Configuration: in /C:/oracle123/j2ee/home/config/server.xml The missing class is available from the following locations: 1. Code-Source: /C:/oracle123/j2ee/home/shared-lib/other_sets/1.0/dom4j-1.6.1.jar (from in /C:/oracle123/j2ee/home/config/server.xml) This code-source is available in loader other_sets:1.0.
    [Jun 2, 2008 10:57:17 AM] Operation failed with error: Missing class: org.dom4j.DocumentException Dependent class: org.hibernate.ejb.HibernatePersistence Loader: hibernatejpa:1.0 Code-Source: /C:/oracle123/j2ee/home/shared-lib/hibernatejpa/1.0/hibernate-entitymanager.jar Configuration: in /C:/oracle123/j2ee/home/config/server.xml The missing class is available from the following locations: 1. Code-Source: /C:/oracle123/j2ee/home/shared-lib/other_sets/1.0/dom4j-1.6.1.jar (from in /C:/oracle123/j2ee/home/config/server.xml) This code-source is available in loader other_sets:1.0. with bset regards,
    ishaan

  • JDeveloper 10.1.3  preview and Hibernate 3.0

    I'm testing JDeveloper Preview 10.1.3.0.2.223 and find some problems when using hibernate 3.0
    When I'm using with OC4J, some packages conflicts and Hibernate don't work.
    I hava to rename <jdevhome1013>\webservices\lib to <jdevhome1013>\webservices\libold
    and replace the file <jdevhome1013>\j2ee\home\lib\asm.jar from file asm.jar that folloies Hibernate 3.0
    So, I'd like to know if it's a know bug, a unknow bug or JDeveloper/OC4J won't support applications with Hibernate?
    Thanks.

    Jim, you are my Idol!!!!
    I'm evaluating JDeveloper (for the first time, not migrating from a previous version), so I'm realy brand new with this environment.
    Now that I see that you (maybe) go in the same direction I go, please, give me your opinion about one point.
    I can see JDeveloper gives the developer a lot of code-generating advantages if you accept using ADF and the rest of the whole Oracle proposed environment. Specifically, the amazing speed you can get on binding the three tiers: database (with connections and drag-and-drops for tables), Business Objects and logic (with middle tier wizards) and presentation tier (with that great drag-and-drop jsp creation tool). I think all this tools can really make a speed-difference…
    But… I don’t like “proprietary solutions”, I like open-source-standards, so… I prefer Hibernate (3.0.5), any structural-framework, like Struts or whichever, and for example JSF for the presentation tier (still evaluating this point)
    I’ve seen that tutorial about using Hibernate + JSF with JDeveloper (http://www.oracle.com/technology/pub/articles/vohra_hibernate.html) but it didn’t satisfied me too much: It’s written for Hibernate 2.1.8 and migrating to Hibernate 3.0 is not possible without a headache…
    So finally, I decided to import a “neutrally” built Struts + Hibernate 3.0 project and try to “speed it up” using JDeveloper. And then it was when I hit my head against this problem you’ve just solved! Jiiiimy, Jiiiiimy!!!! :-))))))
    So, finally, my questions:
    1)     Would you say that if I’m developing this within this kind of tools, then JDeveloper still gives me much of the speed It gives in the first case? Can I drag-and-speedy-drop from database to model tier, or from model to control or to presentation tiers without introducing any Oracle libraries in my project? How? Do you have any example?
    2)     In your opinion, which is the best environment for speeding up this whole development process: JDeveloper, Eclipse + Exadel or any other plug-in environment? Any other you may prefer?
    Hey, again, thanks a lot!! Oracle should take note of the bug you detected (and maybe pay you some bucks for it :-))
    Fer

  • Sleep and Hibernate does not work after BIOS update X1 Carbon 20A8

    As subject title, did a recent Lenovo "System Update" on BIOS and other drivers, and since then sleep and hibernate no longer works, when i close the lid, it turns on by itself after 2 seconds.
    When i select Sleep or Hibernate in Windows 8.1 with lid open, it just behaves like a Restart command.
    Need this fixed! Any ideas?

    Try downgrading to your older BIOS and see if it works again.
    W520: i7-2720QM, Q2000M at 1080/688/1376, 21GB RAM, 500GB + 750GB HDD, FHD screen
    X61T: L7500, 3GB RAM, 500GB HDD, XGA screen, Ultrabase
    Y3P: 5Y70, 8GB RAM, 256GB SSD, QHD+ screen

  • How to store an image into MySQL db using BlazeDS and Hibernate?

    Hi!
    I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
    thanks in advance.
    Here the Code:
    VisitorEntryForm.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:vo="com.visitor.vo.*"
              width="600"
              height="300"
              defaultButton="{submitButton}"
              showCloseButton="true"
              creationComplete="creationCompleteHandler();"
              close="PopUpManager.removePopUp(this);"
              title="Visitor Entry Form" xmlns:text="flash.text.*">
              <mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
              <vo:Visitor id="visitor"
                                               vType="{vTypeField.text}"
                                               vPurpose="{vPurposeField.text}"
                                               vName="{vNameField.text}"
                                               vAddress="{vAddressField.text}"
                                               cPerson="{cPersonField.text}"
                                               cAddress="{cAddressField.text}"
                                     />
                        <mx:Script>
                        <![CDATA[
                        import mx.managers.PopUpManager;
                        import flash.media.Camera;
                        import com.visitor.vo.WebCam;
                        import com.visitor.vo.Base64;
                        import mx.core.UIComponent;
                        import mx.graphics.codec.JPEGEncoder;
                        import mx.controls.Alert;
                        import mx.containers.Canvas;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.events.ValidationResultEvent;
                        import mx.validators.Validator;
                                  [Bindable]
                                  private var webCam: com.visitor.vo.WebCam;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var formIsValid:Boolean = false;
                                  [Bindable]
                                  public var formIsEmpty:Boolean;
                                  private var focussedFormControl:DisplayObject;
                                  private function handleSaveResult(ev:ResultEvent):void {
                                            clearFormHandler();
                                            validateForm(ev);
                                            Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            // Reload the list.
                                            parentApplication.listConsultants.loaderService.getConsultants();
                                            PopUpManager.removePopUp(this);
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: " + ev.fault.faultCode + " \n "
                                                      + "Detail: " + ev.fault.faultDetail + " \n "
                                                      + "Message: " + ev.fault.faultString;
                                  public function saveVisitor():void {
                                            saveService.addUpdateVisitor(visitor);
                                  private function creationCompleteHandler():void {
                                            init();
                                            PopUpManager.centerPopUp(this);
                                            resetFocus();
                                  private function resetFocus():void {
                                            focusManager.setFocus(vTypeField);
                                  public function validateForm(event:Event):void  {
                                            focussedFormControl = event.target as DisplayObject;   
                                            formIsValid = true;
                                            // Check if form is empty
                                            formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
                                            validate(vTypeValidator);               
                                            validate(vPurposeValidator);
                                            validate(vNameValidator);
                                            validate(vAddressValidator);
                                            validate(cPersonValidator);
                                            validate(cAddressValidator);
                                  private function validate(validator:Validator):Boolean {
                                            var validatorSource:DisplayObject = validator.source as DisplayObject;
                                            var suppressEvents:Boolean = (validatorSource != focussedFormControl);
                                            var event:ValidationResultEvent = validator.validate(null, suppressEvents);
                                            var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
                                            formIsValid = formIsValid && currentControlIsValid;
                                            return currentControlIsValid;
                                  private function clearFormHandler():void {
                                            // Clear all input fields.
                                            vTypeField.text = "";
                                            vPurposeField.text = "";
                                            vNameField.text = "";
                                            vAddressField.text = "";
                                            cPersonField.text = "";
                                            cAddressField.text = "";
                                            message = "";
                                            // Clear validation error messages.
                                            vTypeField.errorString = "";
                                            vPurposeField.errorString = "";
                                            vNameField.errorString = "";
                                            vAddressField.errorString = "";
                                            cPersonField.errorString = "";
                                            cAddressField.errorString = "";
                                            formIsEmpty = true;
                                            formIsValid = false;
                                            resetFocus();
                                  private function init():void {
                                  webCam = new WebCam(97,97);
                                  var ref:UIComponent = new UIComponent();
                                  preview.removeAllChildren();
                                  preview.addChild(ref);
                                  ref.addChild(webCam);
                                  private function takeSnapshot():void {
                                  imageViewer.visible = true;
                                  imageViewer.width = preview.width;
                                  imageViewer.height = preview.height;
                                  var uiComponent : UIComponent = new UIComponent();
                                  uiComponent.width = webCam.width;
                                  uiComponent.height = webCam.height;
                                  var photoData:Bitmap = webCam.getSnapshot();
                                  var photoBitmap:BitmapData = photoData.bitmapData;
                                  uiComponent.addChild(photoData);
                                  imageViewer.removeAllChildren();
                                  imageViewer.addChild(uiComponent);
                                  private function uploadSnapshot():void
                                            if (imageViewer.getChildren().length > 0)
                                                      var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
                                                      var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
                                                      var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
                                                      var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
                                  private function deleteSnapshot():void
                                            imageViewer.removeAllChildren();
                        ]]>
                        </mx:Script>
              <mx:StringValidator id="vTypeValidator"          source="{vTypeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vPurposeValidator" source="{vPurposeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vNameValidator"          source="{vNameField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vAddressValidator"          source="{vAddressField}"          property="text" minLength="5" required="true" />
              <mx:StringValidator id="cPersonValidator" source="{cPersonField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="cAddressValidator"          source="{cAddressField}"          property="text" minLength="5" required="true" />
              <mx:Grid width="575" height="211">
                        <mx:GridRow width="575" height="211">
                                  <mx:GridItem width="301" height="235">
                                            <mx:Form width="301" height="208">
                                                      <mx:FormItem label="Visitor's Type">
                                                                <mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Contractor</mx:String>
                                                                                    <mx:String>Supplier</mx:String>
                                                                                    <mx:String>Transporter</mx:String>
                                                                                    <mx:String>Plant</mx:String>
                                                                                    <mx:String>Non-Plant</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visit Purpose">
                                                                <mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Official</mx:String>
                                                                                    <mx:String>Personal</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visitor's Name">
                                                                <mx:TextInput id="vNameField"  text="{visitor.vName}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="vAddressField"   text="{visitor.vAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Contact Person">
                                                                <mx:TextInput id="cPersonField"  text="{visitor.cPerson}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="cAddressField"  text="{visitor.cAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      </mx:Form>
                                  </mx:GridItem>
                                  <mx:GridItem width="264" height="193">
                                            <mx:Grid width="241" height="206">
                                                      <mx:GridRow width="100%" height="100%">
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Preview" id="imageViewer"  layout="absolute"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                                      <mx:GridRow width="100%" height="27" >
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
                                                                                                  click="takeSnapshot();"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
                                                                                                  click="deleteSnapshot();"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                            </mx:Grid>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
              <mx:ControlBar height="40" horizontalAlign="center">
                        <mx:Button label="Save Visitor"          id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
                        <mx:Button label="Clear form" enabled="{!formIsEmpty}"          click="clearFormHandler();" />
                        <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
                        <mx:Label width="211" id="state"/>
              </mx:ControlBar>
              <mx:Text text="{message}" fontWeight="bold" width="300"/>
    </mx:TitleWindow>
    ListVisitors.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:view="com.visitor.view.*"
              width="100%"
              height="100%"
              title="Visitor Management System - Found {visitorRecords} visitors."
              creationComplete="loadVisitors();">
              <mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:Script>
                        <![CDATA[
                                  import com.visitor.vo.Visitor;
                                  import mx.controls.Alert;
                                  import mx.managers.PopUpManager;
                                  import mx.containers.TitleWindow;
                                  import mx.collections.ArrayCollection;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.rpc.events.FaultEvent;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var visitors:ArrayCollection = new ArrayCollection();
                                  [Bindable]
                                  private var visitorRecords:int = 0;
                                  public function loadVisitors():void {
                                            loaderService.getVisitors();
                                  private function deleteVisitor():void {
                                            if(dataGrid.selectedItem != null) {
                                                      var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
                                                      deleteService.deleteVisitor(selectedItem.visitorId);
                                  private function createVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.formIsEmpty = true;
                                  private function updateVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.visitor = dataGrid.selectedItem as Visitor;
                                            titleWindow.formIsEmpty = false;
                                  private function handleLoadResult(ev:ResultEvent):void {
                                            visitors = ev.result as ArrayCollection;
                                            visitorRecords = visitors.length;
                                  private function handleDeleteResult(ev:ResultEvent):void {
                                            Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            loadVisitors();
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: "
                                                      + ev.fault.faultCode + " - "
                                                      + ev.fault.faultDetail + " - "
                                                      + ev.fault.faultString;
                        ]]>
              </mx:Script>
              <mx:VBox width="100%" height="100%">
                        <mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
                        <mx:DataGrid
                                  id="dataGrid"
                                  width="100%"
                                  height="100%"
                                  dataProvider="{visitors}"
                                  doubleClickEnabled="true"
                                  doubleClick="updateVisitor()" >
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="visitorId"          headerText="Visitor ID" width="100"/>
                                            <mx:DataGridColumn dataField="vType"                    headerText="Visitor's Type" />
                                            <mx:DataGridColumn dataField="vPurpose"           headerText="Visit Purpose" />
                                            <mx:DataGridColumn dataField="vName"                     headerText="Visitor's Name" />
                                            <mx:DataGridColumn dataField="vAddress"                    headerText="Visitor's Address" />
                                            <mx:DataGridColumn dataField="cPerson"                     headerText="Contact Person" />
                                            <mx:DataGridColumn dataField="cAddress"                    headerText="Contact Address" />
                                            <mx:DataGridColumn dataField="timeIn"                     headerText="Time-In" />
                                            <mx:DataGridColumn dataField="timeOut"                     headerText="Time-Out" />
                                            <mx:DataGridColumn dataField="vPhoto"                     headerText="Visitor's Photo" />
                                  </mx:columns>
                        </mx:DataGrid>
                        <mx:ControlBar horizontalAlign="center">
                                  <mx:Button label="Create Visitor"          click="createVisitor()"          toolTip="Create a new visitor and store it in the database." />
                                  <mx:Button label="Update Visitor"          click="updateVisitor()"           enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
                                  <mx:Button label="Delete Visitor"          click="deleteVisitor()"          enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
                                  <mx:Button label="Reload Data"                    click="loadVisitors()"           toolTip="Reload the visitor list from the database." />
                        </mx:ControlBar>
              </mx:VBox>
    </mx:Panel>
    Visitor.as
    package com.visitor.vo
              import mx.controls.Image;
              import spark.primitives.BitmapImage;
              [Bindable]
              [RemoteClass(alias="com.visitor.Visitor")]
              public class Visitor
                        public function Visitor()
                        public var visitorId:Number;
                        public var vType:String;
                        public var vPurpose:String;
                        public var vName:String;
                        public var vAddress:String;
                        public var cPerson:String;
                        public var cAddress:String;
                        public var timeIn:Date;
                        public var timeOut:Date;
                       public var vPhoto: Image;
    Visitor.java
    package com.visitor;
    import java.sql.Blob;
    import java.sql.Timestamp;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import org.hibernate.annotations.Index;
    @Entity
    @Table(name = "visitors")
    @NamedQueries( {
                        @NamedQuery(name = "visitors.findAll", query = "from Visitor"),
                        @NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
    public class Visitor {
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "visitorId", nullable = false)
              private Long visitorId;
              @Basic
              @Index(name = "vType_idx_1")
              @Column(name = "vType", nullable = true, unique = false)
              private String vType;
              @Basic
              @Column(name = "vPurpose", nullable = true, unique = false)
              private String vPurpose;
              @Basic
              @Column(name = "vName", nullable = true, unique = false)
              private String vName;
              @Basic
              @Column(name = "vAddress", nullable = true, unique = false)
              private String vAddress;
              @Basic
              @Column(name = "cPerson", nullable = true, unique = false)
              private String cPerson;
              @Basic
              @Column(name = "cAddress", nullable = true, unique = false)
              private String cAddress;
              @Basic
              @Column(name = "timeIn", nullable = false, unique = false)
              private Timestamp timeIn;
              @Basic
              @Column(name = "timeOut", nullable = true, unique = false)
              private Timestamp timeOut;
              @Basic
              @Column(name = "vPhoto", nullable = true, unique = false)
              private Blob vPhoto;
              public Visitor() {
                        super();
              public Long getVisitorId() {
                        return visitorId;
              public void setVisitorId(Long visitorId) {
                        this.visitorId = visitorId;
              public String getvType() {
                        return vType;
              public void setvType(String vType) {
                        this.vType = vType;
              public String getvPurpose() {
                        return vPurpose;
              public void setvPurpose(String vPurpose) {
                        this.vPurpose = vPurpose;
              public String getvName() {
                        return vName;
              public void setvName(String vName) {
                        this.vName = vName;
              public String getvAddress() {
                        return vAddress;
              public void setvAddress(String vAddress) {
                        this.vAddress = vAddress;
              public String getcPerson() {
                        return cPerson;
              public void setcPerson(String cPerson) {
                        this.cPerson = cPerson;
              public String getcAddress() {
                        return cAddress;
              public void setcAddress(String cAddress) {
                        this.cAddress = cAddress;
              public Timestamp getTimeIn() {
                        return timeIn;
              public void setTimeIn(Timestamp timeIn) {
                        this.timeIn = timeIn;
              public Timestamp getTimeOut() {
                        return timeOut;
              public void setTimeOut(Timestamp timeOut) {
                        this.timeOut = timeOut;
              public Blob getvPhoto() {
                        return vPhoto;
              public void setvPhoto(Blob vPhoto) {
                        this.vPhoto = vPhoto;
    VisitorService.java
    package com.visitor;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.apache.log4j.Logger;
    public class VisitorService {
              private static final String PERSISTENCE_UNIT = "visitor_db";
              private static Logger logger = Logger.getLogger(VisitorService.class);
              public VisitorService() {
                        super();
              public List<Visitor> getvisitors() {
                        logger.debug("** getVisitors called...");
                        EntityManagerFactory entityManagerFactory = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = entityManagerFactory.createEntityManager();
                        Query findAllQuery = em.createNamedQuery("visitors.findAll");
                        List<Visitor> visitors = findAllQuery.getResultList();
                        if (visitors != null)
                                  logger.debug("** Found " + visitors.size() + " records:");
                        return visitors;
              public void addUpdateVisitor(Visitor visitor) throws Exception {
                        logger.debug("** addUpdateVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        // When passing Boolean and Number values from the Flash client to a
                        // Java object, Java interprets null values as the default values for
                        // primitive types; for example, 0 for double, float, long, int, short,
                        // byte.
                        if (visitor.getVisitorId() == null          || visitor.getVisitorId() == 0) {
                                  // New consultant is created
                                  visitor.setVisitorId(null);
                                  visitor.setTimeIn(new Timestamp(new Date().getTime()));
                        } else {
                                  visitor.setTimeOut(new Timestamp(new Date().getTime()));
                                  // Existing consultant is updated - do nothing.
                        EntityTransaction tx = em.getTransaction();
                        tx.begin();
                        try {
                                  em.merge(visitor);
                                  tx.commit();
                        } catch (Exception e) {
                                  logger.error("** Error: " + e.getMessage());
                                  tx.rollback();
                                  throw new Exception(e.getMessage());
                        } finally {
                                  logger.info("** Closing Entity Manager.");
                                  em.close();
              public void deleteVisitor(Long visitorId) {
                        logger.debug("** deleteVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        Query q = em.createNamedQuery("visitors.byId");
                        q.setParameter("visitorId", visitorId);
                        Visitor visitor = (Visitor) q.getSingleResult();
                        if (visitor != null) {
                                  EntityTransaction tx = em.getTransaction();
                                  tx.begin();
                                  try {
                                            em.remove(visitor);
                                            tx.commit();
                                  } catch (Exception e) {
                                            logger.error("** Error: " + e.getMessage());
                                            tx.rollback();
                                  } finally {
                                            logger.info("** Closing Entity Manager.");
                                            em.close();
    remoting-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" class="flex.messaging.services.RemotingService">
              <adapters>
                        <adapter-definition id="java-object"
                                  class="flex.messaging.services.remoting.adapters.JavaAdapter"
                                  default="true" />
              </adapters>
              <default-channels>
                        <channel ref="my-amf" />
              </default-channels>
              <!-- ADC Demo application -->
              <destination id="visitorService">
                        <properties>
                                  <source>com.visitor.VisitorService</source>
                        </properties>
              </destination>
    </service>

    Hi!
    I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
    thanks in advance.
    Here the Code:
    VisitorEntryForm.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:vo="com.visitor.vo.*"
              width="600"
              height="300"
              defaultButton="{submitButton}"
              showCloseButton="true"
              creationComplete="creationCompleteHandler();"
              close="PopUpManager.removePopUp(this);"
              title="Visitor Entry Form" xmlns:text="flash.text.*">
              <mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
              <vo:Visitor id="visitor"
                                               vType="{vTypeField.text}"
                                               vPurpose="{vPurposeField.text}"
                                               vName="{vNameField.text}"
                                               vAddress="{vAddressField.text}"
                                               cPerson="{cPersonField.text}"
                                               cAddress="{cAddressField.text}"
                                     />
                        <mx:Script>
                        <![CDATA[
                        import mx.managers.PopUpManager;
                        import flash.media.Camera;
                        import com.visitor.vo.WebCam;
                        import com.visitor.vo.Base64;
                        import mx.core.UIComponent;
                        import mx.graphics.codec.JPEGEncoder;
                        import mx.controls.Alert;
                        import mx.containers.Canvas;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.events.ValidationResultEvent;
                        import mx.validators.Validator;
                                  [Bindable]
                                  private var webCam: com.visitor.vo.WebCam;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var formIsValid:Boolean = false;
                                  [Bindable]
                                  public var formIsEmpty:Boolean;
                                  private var focussedFormControl:DisplayObject;
                                  private function handleSaveResult(ev:ResultEvent):void {
                                            clearFormHandler();
                                            validateForm(ev);
                                            Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            // Reload the list.
                                            parentApplication.listConsultants.loaderService.getConsultants();
                                            PopUpManager.removePopUp(this);
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: " + ev.fault.faultCode + " \n "
                                                      + "Detail: " + ev.fault.faultDetail + " \n "
                                                      + "Message: " + ev.fault.faultString;
                                  public function saveVisitor():void {
                                            saveService.addUpdateVisitor(visitor);
                                  private function creationCompleteHandler():void {
                                            init();
                                            PopUpManager.centerPopUp(this);
                                            resetFocus();
                                  private function resetFocus():void {
                                            focusManager.setFocus(vTypeField);
                                  public function validateForm(event:Event):void  {
                                            focussedFormControl = event.target as DisplayObject;   
                                            formIsValid = true;
                                            // Check if form is empty
                                            formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
                                            validate(vTypeValidator);               
                                            validate(vPurposeValidator);
                                            validate(vNameValidator);
                                            validate(vAddressValidator);
                                            validate(cPersonValidator);
                                            validate(cAddressValidator);
                                  private function validate(validator:Validator):Boolean {
                                            var validatorSource:DisplayObject = validator.source as DisplayObject;
                                            var suppressEvents:Boolean = (validatorSource != focussedFormControl);
                                            var event:ValidationResultEvent = validator.validate(null, suppressEvents);
                                            var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
                                            formIsValid = formIsValid && currentControlIsValid;
                                            return currentControlIsValid;
                                  private function clearFormHandler():void {
                                            // Clear all input fields.
                                            vTypeField.text = "";
                                            vPurposeField.text = "";
                                            vNameField.text = "";
                                            vAddressField.text = "";
                                            cPersonField.text = "";
                                            cAddressField.text = "";
                                            message = "";
                                            // Clear validation error messages.
                                            vTypeField.errorString = "";
                                            vPurposeField.errorString = "";
                                            vNameField.errorString = "";
                                            vAddressField.errorString = "";
                                            cPersonField.errorString = "";
                                            cAddressField.errorString = "";
                                            formIsEmpty = true;
                                            formIsValid = false;
                                            resetFocus();
                                  private function init():void {
                                  webCam = new WebCam(97,97);
                                  var ref:UIComponent = new UIComponent();
                                  preview.removeAllChildren();
                                  preview.addChild(ref);
                                  ref.addChild(webCam);
                                  private function takeSnapshot():void {
                                  imageViewer.visible = true;
                                  imageViewer.width = preview.width;
                                  imageViewer.height = preview.height;
                                  var uiComponent : UIComponent = new UIComponent();
                                  uiComponent.width = webCam.width;
                                  uiComponent.height = webCam.height;
                                  var photoData:Bitmap = webCam.getSnapshot();
                                  var photoBitmap:BitmapData = photoData.bitmapData;
                                  uiComponent.addChild(photoData);
                                  imageViewer.removeAllChildren();
                                  imageViewer.addChild(uiComponent);
                                  private function uploadSnapshot():void
                                            if (imageViewer.getChildren().length > 0)
                                                      var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
                                                      var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
                                                      var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
                                                      var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
                                  private function deleteSnapshot():void
                                            imageViewer.removeAllChildren();
                        ]]>
                        </mx:Script>
              <mx:StringValidator id="vTypeValidator"          source="{vTypeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vPurposeValidator" source="{vPurposeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vNameValidator"          source="{vNameField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vAddressValidator"          source="{vAddressField}"          property="text" minLength="5" required="true" />
              <mx:StringValidator id="cPersonValidator" source="{cPersonField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="cAddressValidator"          source="{cAddressField}"          property="text" minLength="5" required="true" />
              <mx:Grid width="575" height="211">
                        <mx:GridRow width="575" height="211">
                                  <mx:GridItem width="301" height="235">
                                            <mx:Form width="301" height="208">
                                                      <mx:FormItem label="Visitor's Type">
                                                                <mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Contractor</mx:String>
                                                                                    <mx:String>Supplier</mx:String>
                                                                                    <mx:String>Transporter</mx:String>
                                                                                    <mx:String>Plant</mx:String>
                                                                                    <mx:String>Non-Plant</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visit Purpose">
                                                                <mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Official</mx:String>
                                                                                    <mx:String>Personal</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visitor's Name">
                                                                <mx:TextInput id="vNameField"  text="{visitor.vName}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="vAddressField"   text="{visitor.vAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Contact Person">
                                                                <mx:TextInput id="cPersonField"  text="{visitor.cPerson}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="cAddressField"  text="{visitor.cAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      </mx:Form>
                                  </mx:GridItem>
                                  <mx:GridItem width="264" height="193">
                                            <mx:Grid width="241" height="206">
                                                      <mx:GridRow width="100%" height="100%">
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Preview" id="imageViewer"  layout="absolute"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                                      <mx:GridRow width="100%" height="27" >
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
                                                                                                  click="takeSnapshot();"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
                                                                                                  click="deleteSnapshot();"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                            </mx:Grid>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
              <mx:ControlBar height="40" horizontalAlign="center">
                        <mx:Button label="Save Visitor"          id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
                        <mx:Button label="Clear form" enabled="{!formIsEmpty}"          click="clearFormHandler();" />
                        <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
                        <mx:Label width="211" id="state"/>
              </mx:ControlBar>
              <mx:Text text="{message}" fontWeight="bold" width="300"/>
    </mx:TitleWindow>
    ListVisitors.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:view="com.visitor.view.*"
              width="100%"
              height="100%"
              title="Visitor Management System - Found {visitorRecords} visitors."
              creationComplete="loadVisitors();">
              <mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:Script>
                        <![CDATA[
                                  import com.visitor.vo.Visitor;
                                  import mx.controls.Alert;
                                  import mx.managers.PopUpManager;
                                  import mx.containers.TitleWindow;
                                  import mx.collections.ArrayCollection;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.rpc.events.FaultEvent;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var visitors:ArrayCollection = new ArrayCollection();
                                  [Bindable]
                                  private var visitorRecords:int = 0;
                                  public function loadVisitors():void {
                                            loaderService.getVisitors();
                                  private function deleteVisitor():void {
                                            if(dataGrid.selectedItem != null) {
                                                      var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
                                                      deleteService.deleteVisitor(selectedItem.visitorId);
                                  private function createVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.formIsEmpty = true;
                                  private function updateVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.visitor = dataGrid.selectedItem as Visitor;
                                            titleWindow.formIsEmpty = false;
                                  private function handleLoadResult(ev:ResultEvent):void {
                                            visitors = ev.result as ArrayCollection;
                                            visitorRecords = visitors.length;
                                  private function handleDeleteResult(ev:ResultEvent):void {
                                            Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            loadVisitors();
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: "
                                                      + ev.fault.faultCode + " - "
                                                      + ev.fault.faultDetail + " - "
                                                      + ev.fault.faultString;
                        ]]>
              </mx:Script>
              <mx:VBox width="100%" height="100%">
                        <mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
                        <mx:DataGrid
                                  id="dataGrid"
                                  width="100%"
                                  height="100%"
                                  dataProvider="{visitors}"
                                  doubleClickEnabled="true"
                                  doubleClick="updateVisitor()" >
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="visitorId"          headerText="Visitor ID" width="100"/>
                                            <mx:DataGridColumn dataField="vType"                    headerText="Visitor's Type" />
                                            <mx:DataGridColumn dataField="vPurpose"           headerText="Visit Purpose" />
                                            <mx:DataGridColumn dataField="vName"                     headerText="Visitor's Name" />
                                            <mx:DataGridColumn dataField="vAddress"                    headerText="Visitor's Address" />
                                            <mx:DataGridColumn dataField="cPerson"                     headerText="Contact Person" />
                                            <mx:DataGridColumn dataField="cAddress"                    headerText="Contact Address" />
                                            <mx:DataGridColumn dataField="timeIn"                     headerText="Time-In" />
                                            <mx:DataGridColumn dataField="timeOut"                     headerText="Time-Out" />
                                            <mx:DataGridColumn dataField="vPhoto"                     headerText="Visitor's Photo" />
                                  </mx:columns>
                        </mx:DataGrid>
                        <mx:ControlBar horizontalAlign="center">
                                  <mx:Button label="Create Visitor"          click="createVisitor()"          toolTip="Create a new visitor and store it in the database." />
                                  <mx:Button label="Update Visitor"          click="updateVisitor()"           enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
                                  <mx:Button label="Delete Visitor"          click="deleteVisitor()"          enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
                                  <mx:Button label="Reload Data"                    click="loadVisitors()"           toolTip="Reload the visitor list from the database." />
                        </mx:ControlBar>
              </mx:VBox>
    </mx:Panel>
    Visitor.as
    package com.visitor.vo
              import mx.controls.Image;
              import spark.primitives.BitmapImage;
              [Bindable]
              [RemoteClass(alias="com.visitor.Visitor")]
              public class Visitor
                        public function Visitor()
                        public var visitorId:Number;
                        public var vType:String;
                        public var vPurpose:String;
                        public var vName:String;
                        public var vAddress:String;
                        public var cPerson:String;
                        public var cAddress:String;
                        public var timeIn:Date;
                        public var timeOut:Date;
                       public var vPhoto: Image;
    Visitor.java
    package com.visitor;
    import java.sql.Blob;
    import java.sql.Timestamp;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import org.hibernate.annotations.Index;
    @Entity
    @Table(name = "visitors")
    @NamedQueries( {
                        @NamedQuery(name = "visitors.findAll", query = "from Visitor"),
                        @NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
    public class Visitor {
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "visitorId", nullable = false)
              private Long visitorId;
              @Basic
              @Index(name = "vType_idx_1")
              @Column(name = "vType", nullable = true, unique = false)
              private String vType;
              @Basic
              @Column(name = "vPurpose", nullable = true, unique = false)
              private String vPurpose;
              @Basic
              @Column(name = "vName", nullable = true, unique = false)
              private String vName;
              @Basic
              @Column(name = "vAddress", nullable = true, unique = false)
              private String vAddress;
              @Basic
              @Column(name = "cPerson", nullable = true, unique = false)
              private String cPerson;
              @Basic
              @Column(name = "cAddress", nullable = true, unique = false)
              private String cAddress;
              @Basic
              @Column(name = "timeIn", nullable = false, unique = false)
              private Timestamp timeIn;
              @Basic
              @Column(name = "timeOut", nullable = true, unique = false)
              private Timestamp timeOut;
              @Basic
              @Column(name = "vPhoto", nullable = true, unique = false)
              private Blob vPhoto;
              public Visitor() {
                        super();
              public Long getVisitorId() {
                        return visitorId;
              public void setVisitorId(Long visitorId) {
                        this.visitorId = visitorId;
              public String getvType() {
                        return vType;
              public void setvType(String vType) {
                        this.vType = vType;
              public String getvPurpose() {
                        return vPurpose;
              public void setvPurpose(String vPurpose) {
                        this.vPurpose = vPurpose;
              public String getvName() {
                        return vName;
              public void setvName(String vName) {
                        this.vName = vName;
              public String getvAddress() {
                        return vAddress;
              public void setvAddress(String vAddress) {
                        this.vAddress = vAddress;
              public String getcPerson() {
                        return cPerson;
              public void setcPerson(String cPerson) {
                        this.cPerson = cPerson;
              public String getcAddress() {
                        return cAddress;
              public void setcAddress(String cAddress) {
                        this.cAddress = cAddress;
              public Timestamp getTimeIn() {
                        return timeIn;
              public void setTimeIn(Timestamp timeIn) {
                        this.timeIn = timeIn;
              public Timestamp getTimeOut() {
                        return timeOut;
              public void setTimeOut(Timestamp timeOut) {
                        this.timeOut = timeOut;
              public Blob getvPhoto() {
                        return vPhoto;
              public void setvPhoto(Blob vPhoto) {
                        this.vPhoto = vPhoto;
    VisitorService.java
    package com.visitor;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.apache.log4j.Logger;
    public class VisitorService {
              private static final String PERSISTENCE_UNIT = "visitor_db";
              private static Logger logger = Logger.getLogger(VisitorService.class);
              public VisitorService() {
                        super();
              public List<Visitor> getvisitors() {
                        logger.debug("** getVisitors called...");
                        EntityManagerFactory entityManagerFactory = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = entityManagerFactory.createEntityManager();
                        Query findAllQuery = em.createNamedQuery("visitors.findAll");
                        List<Visitor> visitors = findAllQuery.getResultList();
                        if (visitors != null)
                                  logger.debug("** Found " + visitors.size() + " records:");
                        return visitors;
              public void addUpdateVisitor(Visitor visitor) throws Exception {
                        logger.debug("** addUpdateVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        // When passing Boolean and Number values from the Flash client to a
                        // Java object, Java interprets null values as the default values for
                        // primitive types; for example, 0 for double, float, long, int, short,
                        // byte.
                        if (visitor.getVisitorId() == null          || visitor.getVisitorId() == 0) {
                                  // New consultant is created
                                  visitor.setVisitorId(null);
                                  visitor.setTimeIn(new Timestamp(new Date().getTime()));
                        } else {
                                  visitor.setTimeOut(new Timestamp(new Date().getTime()));
                                  // Existing consultant is updated - do nothing.
                        EntityTransaction tx = em.getTransaction();
                        tx.begin();
                        try {
                                  em.merge(visitor);
                                  tx.commit();
                        } catch (Exception e) {
                                  logger.error("** Error: " + e.getMessage());
                                  tx.rollback();
                                  throw new Exception(e.getMessage());
                        } finally {
                                  logger.info("** Closing Entity Manager.");
                                  em.close();
              public void deleteVisitor(Long visitorId) {
                        logger.debug("** deleteVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        Query q = em.createNamedQuery("visitors.byId");
                        q.setParameter("visitorId", visitorId);
                        Visitor visitor = (Visitor) q.getSingleResult();
                        if (visitor != null) {
                                  EntityTransaction tx = em.getTransaction();
                                  tx.begin();
                                  try {
                                            em.remove(visitor);
                                            tx.commit();
                                  } catch (Exception e) {
                                            logger.error("** Error: " + e.getMessage());
                                            tx.rollback();
                                  } finally {
                                            logger.info("** Closing Entity Manager.");
                                            em.close();
    remoting-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" class="flex.messaging.services.RemotingService">
              <adapters>
                        <adapter-definition id="java-object"
                                  class="flex.messaging.services.remoting.adapters.JavaAdapter"
                                  default="true" />
              </adapters>
              <default-channels>
                        <channel ref="my-amf" />
              </default-channels>
              <!-- ADC Demo application -->
              <destination id="visitorService">
                        <properties>
                                  <source>com.visitor.VisitorService</source>
                        </properties>
              </destination>
    </service>

  • Transfer Object in JSF, Spring, and Hibernate

    The application on which I am working deploys the JavaServer Faces, Spring and Hibernate frameworks.
    We are going to use the "transfer object" to move data between J2EE tiers from the front end to the back end and vice versa. In addition, data "types" may need to be converted --
    At the front end, the "type" of the data that are entered by users may not match that in the database table. For example, checkboxes may be marked or left blank by users. The "type" of the checkboxes is "boolean" in the JSF backing bean. However, we have either "Y" or "N" for the corresponding field in the database table.
    The JSF backing bean holds data as well as controller functionality. Of course, the transfer object holds data only.
    With regard to class properties, Is the transfer object an exact copy of the JSF backing bean? And at which tier the data are converted to match their correspoding "types" in the database tables?
    We also have the "data objects" which are exact representation of database tables.
    Thanks for your advices.

    Small example: you can decide in the business layer
    whether to convert it to boolean or Boolean (which
    has a 3rd state: null).But it all goes back to your data model. If your data model supports null for that property, then of course boolean is a poor choice. If that case one could use Boolean. None of this has anything to do with re-usability, which was your objection.
    I think the re-usability question goes back to the data model as well. Suppose your data model says this property is boolean valued. However if your database does not support booleans natively, then you need to map the value for storage in the database. But that is the data persistence layers problem.
    OTOH, suppose your data model says that this property may be 'Y' or 'N'. Then the Java class represent the business object should not have a boolean property, we should make it match the data model.
    However, I think that most cases where people are storing 'Y' or 'N' in a field in the database fall into the first case, where the data model is a boolean and they are working around limitations in the database. There is no reason in that case to perpetuate the same limitations in the Java code.

  • [SOLVED] Poweroff, suspend and hibernate don't work

    I installed Archlinux on my work desktop on Monday and can't get poweroff, suspend and hibernate to work. The command `systemctl poweroff` sort of works, except it doesn't actually turn off the computer. Suspend and hibernate don't work at all, the computer hangs on the terminal with a cursor on the top left corner of the screen. Here is the log from `journalctl`. There doesn't seem to be any error messages in it, as far as I can see.
    Apr 16 10:02:55 carolfs-ifusp sudo[1127]: carolfs : TTY=pts/0 ; PWD=/home/carolfs ; USER=root ; COMMAND=/usr/bin/systemctl poweroff
    Apr 16 10:02:55 carolfs-ifusp sudo[1127]: pam_unix(sudo:session): session opened for user root by carolfs(uid=0)
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Session c2 of user carolfs.
    Apr 16 10:02:55 carolfs-ifusp gnome-session[576]: Received signal:15->'Terminated'
    Apr 16 10:02:55 carolfs-ifusp org.gnome.evolution.dataserver.Sources3[591]: Received terminate signal.
    Apr 16 10:02:55 carolfs-ifusp colord[453]: Automatic remove of icc-9cb50954c1872204852075bef0599dec from xrandr-Goldstar Company Ltd-W2043-16843009
    Apr 16 10:02:55 carolfs-ifusp colord[453]: Profile removed: icc-9cb50954c1872204852075bef0599dec
    Apr 16 10:02:55 carolfs-ifusp colord[453]: device removed: xrandr-Goldstar Company Ltd-W2043-16843009
    Apr 16 10:02:55 carolfs-ifusp polkitd[358]: Unregistered Authentication Agent for unix-session:c2 (system bus name :1.37, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
    Apr 16 10:02:55 carolfs-ifusp ntpd[300]: ntpd exiting on signal 15
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped Session c2 of user carolfs.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Session c1 of user gdm.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped Session c1 of user gdm.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Sound Card.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped target Sound Card.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping system-systemd\x2dfsck.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Removed slice system-systemd\x2dfsck.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping system-getty.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Removed slice system-getty.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping User Manager for UID 1000...
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Disk Manager...
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Login Service...
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopping Default.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopping Default.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Login Prompts.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopped target Default.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopped target Default.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped target Login Prompts.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopping Basic System.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopping Basic System.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping GNOME Display Manager...
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopped target Basic System.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopped target Basic System.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Starting Generate shutdown-ramfs...
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopping Paths.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopping Paths.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopped target Paths.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopped target Paths.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopping Timers.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopping Timers.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopped target Timers.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped RealtimeKit Scheduling Policy Service.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopped target Timers.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopping Sockets.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopping Sockets.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped Locale Service.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Stopped target Sockets.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Stopped target Sockets.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Starting Shutdown.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped Disk Manager.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Starting Shutdown.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Reached target Shutdown.
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Reached target Shutdown.
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Starting Exit the Session...
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Starting Exit the Session...
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping Network.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped target Network.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping dhcpcd on all interfaces...
    Apr 16 10:02:55 carolfs-ifusp systemd[567]: Received SIGRTMIN+24 from PID 1159 (kill).
    Apr 16 10:02:55 carolfs-ifusp systemd[386]: Received SIGRTMIN+24 from PID 1160 (kill).
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped User Manager for UID 120.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped User Manager for UID 1000.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping user-1000.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Removed slice user-1000.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopping user-120.slice.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Removed slice user-120.slice.
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[1161]: sending signal TERM to pid 264
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[1161]: waiting for pid 264 to exit
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[264]: received signal TERM from PID 1161, stopping
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[264]: eno1: removing interface
    Apr 16 10:02:55 carolfs-ifusp systemd[387]: pam_unix(systemd-user:session): session closed for user gdm
    Apr 16 10:02:55 carolfs-ifusp systemd[568]: pam_unix(systemd-user:session): session closed for user carolfs
    Apr 16 10:02:55 carolfs-ifusp gnome-session[576]: Received signal:15->'Terminated'
    Apr 16 10:02:55 carolfs-ifusp gdm-session-worker[383]: <3>GLib: Source ID 71 was not found when attempting to remove it
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) evdev: AT Translated Set 2 keyboard: Close
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) UnloadModule: "evdev"
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) evdev: Microsoft Microsoft Basic Optical Mouse : Close
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) UnloadModule: "evdev"
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) evdev: Power Button: Close
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) UnloadModule: "evdev"
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) evdev: Power Button: Close
    Apr 16 10:02:55 carolfs-ifusp gdm-Xorg-:0[336]: (II) UnloadModule: "evdev"
    Apr 16 10:02:55 carolfs-ifusp org.freedesktop.Tracker1[591]: Received signal:15->'Terminated'
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[1161]: dhcpcd[1161]: sending signal TERM to pid 264
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[1161]: dhcpcd[1161]: waiting for pid 264 to exit
    Apr 16 10:02:55 carolfs-ifusp dhcpcd[264]: exited
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: Stopped Login Service.
    Apr 16 10:02:55 carolfs-ifusp systemd[1]: dhcpcd.service: main process exited, code=exited, status=1/FAILURE
    Apr 16 10:02:55 carolfs-ifusp mkinitcpio[1145]: ==> Starting build: none
    Apr 16 10:02:56 carolfs-ifusp mkinitcpio[1145]: -> Running build hook: [sd-shutdown]
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped dhcpcd on all interfaces.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unit dhcpcd.service entered failed state.
    Apr 16 10:02:56 carolfs-ifusp gdm-Xorg-:0[336]: (II) NVIDIA(GPU-0): Deleting GPU-0
    Apr 16 10:02:56 carolfs-ifusp gdm-Xorg-:0[336]: (EE) Server terminated successfully (0). Closing log file.
    Apr 16 10:02:56 carolfs-ifusp gdm[295]: Freeing conversation 'gdm-password' with active job
    Apr 16 10:02:56 carolfs-ifusp gdm[295]: Freeing conversation 'gdm-launch-environment' with active job
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped GNOME Display Manager.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Permit User Sessions...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Permit User Sessions.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Basic System.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Basic System.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Slices.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Slices.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping User and Session Slice.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Removed slice User and Session Slice.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Paths.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Paths.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Forward Password Requests to Wall Directory Watch.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Forward Password Requests to Wall Directory Watch.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Dispatch Password Requests to Console Directory Watch.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Dispatch Password Requests to Console Directory Watch.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Timers.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Timers.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Daily man-db cache update.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Daily man-db cache update.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Daily verification of password and group files.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Daily verification of password and group files.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Daily rotation of log files.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Daily rotation of log files.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Daily Cleanup of Temporary Directories.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Daily Cleanup of Temporary Directories.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Sockets.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Sockets.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Device-mapper event daemon FIFOs.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Closed Device-mapper event daemon FIFOs.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping LVM2 metadata daemon socket.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Closed LVM2 metadata daemon socket.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping D-Bus System Message Bus Socket.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Closed D-Bus System Message Bus Socket.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping System Initialization.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target System Initialization.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Apply Kernel Variables...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Apply Kernel Variables.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Setup Virtual Console...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Setup Virtual Console.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Encrypted Volumes.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Encrypted Volumes.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Load/Save Random Seed...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Update UTMP about System Boot/Shutdown...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Swap.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Swap.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivating swap Swap Partition...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivating swap Swap Partition...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivating swap Swap Partition...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivating swap Swap Partition...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivating swap Swap Partition...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivating swap Swap Partition...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Remote File Systems.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Remote File Systems.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Load/Save Random Seed.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Update UTMP about System Boot/Shutdown.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Create Volatile Files and Directories...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Create Volatile Files and Directories.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Local File Systems.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Local File Systems.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounting /run/user/1000/gvfs...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounting /run/user/120...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounting /boot...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounting /home...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounting Temporary Directory...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivated swap /dev/disk/by-partuuid/748828e6-d06b-4dc9-a1ee-94e2bf6e2d41.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivated swap /dev/disk/by-partlabel/swap.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivated swap /dev/disk/by-id/wwn-0x5000c500242cde85-part2.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivated swap /dev/disk/by-id/ata-ST3500418AS_5VM96G8V-part2.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivated swap /dev/disk/by-uuid/59c506eb-3a40-4eae-8048-317bcc3d00fb.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Deactivated swap Swap Partition.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounted /run/user/1000/gvfs.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounted Temporary Directory.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounting /run/user/1000...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounted /run/user/120.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounted /boot.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping EFI System Partition Automount.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unset automount EFI System Partition Automount.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounted /run/user/1000.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Unmounted /home.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Starting Unmount All Filesystems.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Reached target Unmount All Filesystems.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Local File Systems (Pre).
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped target Local File Systems (Pre).
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopping Remount Root and Kernel File Systems...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Stopped Remount Root and Kernel File Systems.
    Apr 16 10:02:56 carolfs-ifusp mkinitcpio[1145]: ==> Build complete.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Started Generate shutdown-ramfs.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Starting Shutdown.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Reached target Shutdown.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Starting Final Step.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Reached target Final Step.
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Starting Power-Off...
    Apr 16 10:02:56 carolfs-ifusp systemd[1]: Shutting down.
    Apr 16 10:02:56 carolfs-ifusp systemd-shutdown[1]: Sending SIGTERM to remaining processes...
    Apr 16 10:02:56 carolfs-ifusp systemd-journal[166]: Journal stopped
    Last edited by CFS (2014-05-08 12:57:13)

    Thank you for your replies. Shutdown now doesn't turn the computer off either. About the type of system, I think it was custom built. This is a new install from Monday, so I didn't update the kernel. Poweroff, suspend and hibernate have never worked. The requested output:
    $ uname -a
    Linux carolfs-ifusp 3.14.1-1-ARCH #1 SMP PREEMPT Mon Apr 14 20:40:47 CEST 2014 x86_64 GNU/Linux
    $ pacman -Qi linux
    Name : linux
    Version : 3.14.1-1
    Description : The Linux kernel and modules
    Architecture : x86_64
    URL : http://www.kernel.org/
    Licenses : GPL2
    Groups : base
    Provides : kernel26=3.14.1
    Depends On : coreutils linux-firmware kmod mkinitcpio>=0.7
    Optional Deps : crda: to set the correct wireless channels of your country
    Required By : nvidia
    Optional For : None
    Conflicts With : kernel26
    Replaces : kernel26
    Installed Size : 71136.00 KiB
    Packager : Tobias Powalowski <[email protected]>
    Build Date : Mon 14 Apr 2014 03:42:52 PM BRT
    Install Date : Mon 14 Apr 2014 07:50:11 PM BRT
    Install Reason : Explicitly installed
    Install Script : Yes
    Validated By : Signature

  • Windows explorer + other windows applications crashing regularly at resume from sleep and hibernate

    Good evening,
    I have a Thinkpad W510 (4319-29G) running Windows 7 Pro 64bit. The system is loaded with the latest software and drives from Lenovo including BIOS 6NET74WW (1.34), upgrade was done Dec 7th (windows update performed Dec 15th).
    The machine has
    - 8Gb RAM
    - nVidia Quadro FX880M, driver version is 8.17.12.5896, 7-9-2010 and video card BIOS is 70.16.5f.0.b
    - dual harddrives,
       - one Seagate Momentus XT 500Gb (ST95005620AS) FW rev SD23 in the main location with C: and some other partitions
       - one Hitatchi 320 Gb (HTS723232L9SA60) FW rev FC4ZC50B in the bay.
    - Intel Centrino Advanced-N 6200 AGN, driver version 13.3.0.24, 7-14-2010
    - Intel 82577LM Gigabit Network Connection, driver version 11.5.10.1030, 7-22-2010
    Recently I have experienced crashes of multiple windows components at resume from sleep and hibernate.
    It seems to happen when swithing location (from work to home) and thus switching from docking station with wired network connection to no dock and wireless network connection (dont know if this has any bearing but anyway).
    In the event viewer I typically have some 6-12 application errors logged. Sample output from event viewer is:
    Log Name: Application
    Source:Application Error
    EventID:1000
    Level:Error
    Logged:2010-12-15 20:30:02
    Task category100)
    Keywords: Classic
    Computer: xxxxxxx (my computername)
    Then for each application the following detailed data is written in event viewer in the general tab:
    #1
    Faulting application name: rundll32.exe_nview64.dll, version: 6.1.7600.16385, time stamp: 0x4a5bc9e0
    Faulting module name: nview64.dll, version: 6.14.10.13527, time stamp: 0x4c35752f
    Exception code: 0xc0000005
    Fault offset: 0x00000000000f0786
    Faulting process id: 0x115c
    Faulting application start time: 0x01cb9bd59882f1f6
    Faulting application path: C:\Windows\system32\rundll32.exe
    Faulting module path: C:\Program Files\NVIDIA Corporation\nView\nview64.dll
    Report Id: b606b17d-0881-11e0-be39-00a0c6000000
    #2
    Faulting application name: taskhost.exe, version: 6.1.7600.16385, time stamp: 0x4a5bc3c1
    Faulting module name: nview64.dll_unloaded, version: 0.0.0.0, time stamp: 0x4c35752f
    Exception code: 0xc000041d
    Fault offset: 0x00000001800bb350
    Faulting process id: 0x10c0
    Faulting application start time: 0x01cb9bd5694caebe
    Faulting application path: C:\Windows\system32\taskhost.exe
    Faulting module path: nview64.dll
    Report Id: b6ae8cb2-0881-11e0-be39-00a0c6000000
    #3
    Faulting application name: sidebar.exe, version: 6.1.7600.16385, time stamp: 0x4a5bc9e1
    Faulting module name: nview64.dll_unloaded, version: 0.0.0.0, time stamp: 0x4c35752f
    Exception code: 0xc000041d
    Fault offset: 0x00000001800bb350
    Faulting process id: 0x6f0
    Faulting application start time: 0x01cb9bd5986a397a
    Faulting application path: C:\Program Files\Windows Sidebar\sidebar.exe
    Faulting module path: nview64.dll
    Report Id: b6bd0bd9-0881-11e0-be39-00a0c6000000
    #4
    Faulting application name: Explorer.EXE, version: 6.1.7600.16450, time stamp: 0x4aebab8d
    Faulting module name: nview64.dll_unloaded, version: 0.0.0.0, time stamp: 0x4c35752f
    Exception code: 0xc000041d
    Fault offset: 0x0000000008c3b350
    Faulting process id: 0x1210
    Faulting application start time: 0x01cb9bd569d9ae8e
    Faulting application path: C:\Windows\Explorer.EXE
    Faulting module path: nview64.dll
    Report Id: b6d21ac7-0881-11e0-be39-00a0c6000000
    #5
    Faulting application name: Dwm.exe, version: 6.1.7600.16385, time stamp: 0x4a5bc541
    Faulting module name: nview64.dll_unloaded, version: 0.0.0.0, time stamp: 0x4c35752f
    Exception code: 0xc000041d
    Fault offset: 0x00000001800ba570
    Faulting process id: 0x11c4
    Faulting application start time: 0x01cb9bd569aa125c
    Faulting application path: C:\Windows\system32\Dwm.exe
    Faulting module path: nview64.dll
    Report Id: b72bfbe8-0881-11e0-be39-00a0c6000000
    #6
    Faulting application name: rundll32.exe_PWMTR64V.DLL, version: 6.1.7600.16385, time stamp: 0x4a5bc9e0
    Faulting module name: nview64.dll_unloaded, version: 0.0.0.0, time stamp: 0x4c35752f
    Exception code: 0xc000041d
    Fault offset: 0x00000001800bb350
    Faulting process id: 0x1450
    Faulting application start time: 0x01cb9bd59995023a
    Faulting application path: C:\Windows\system32\rundll32.exe
    Faulting module path: nview64.dll
    Report Id: b7e4521b-0881-11e0-be39-00a0c6000000
    It seems that a module "nview64.dll" is always the first application to crash. I suspect this has something with graphics to do.
    I dont know if this event triggers the following crashes or if it is so that the display is initialized before the other programs.
    After all crash diagnostic messages have been shown windows explorer restarts and also other applications restart but a lot of system tools in the system tray are gone so a cold start is needed to restore all tools again.
    I really would appreciate any help and suggestions how to fix this really annoying issue.
    Thanks, Anton

    I had a similar issue, as soon as a described even a little bit of it to warrenty support they sent someone to swap the board
    It seems thats the only fix, its been fine since 

  • How to handle blob data with java and mysql and hibernate

    Dear all,
    I am using java 1.6 and mysql 5.5 and hibernate 3.0 . Some time i use blob data type . Earlier my project's data base was oracle 10g but now i am converting it to Mysql and now i am facing problem to save and fetch blob data to mysql database . Can anybody give me the source code for blob handling with java+Mysql+Hibernate
    now my code is :--
    ==================================================
    *.hbm.xml :--
    <property name="image" column="IMAGE" type="com.shrisure.server.usertype.BinaryBlobType" insert="true" update="true" lazy="false"/>
    ===================================================
    *.java :--
    package com.shrisure.server.usertype;
    import java.io.OutputStream;
    import java.io.Serializable;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Types;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.BLOB;
    import org.hibernate.HibernateException;
    import org.hibernate.usertype.UserType;
    import org.jboss.resource.adapter.jdbc.WrappedConnection;
    import com.google.gwt.user.client.rpc.IsSerializable;
    public class BinaryBlobType implements UserType, java.io.Serializable, IsSerializable {
    private static final long serialVersionUID = 1111222233331231L;
    public int[] sqlTypes() {
    return new int[] { Types.BLOB };
    public Class returnedClass() {
    return byte[].class;
    public boolean equals(Object x, Object y) {
    return (x == y) || (x != null && y != null && java.util.Arrays.equals((byte[]) x, (byte[]) y));
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    BLOB tempBlob = null;
    WrappedConnection wc = null;
    try {
    if (value != null) {
    Connection oracleConnection = st.getConnection();
    if (oracleConnection instanceof oracle.jdbc.driver.OracleConnection) {
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    if (oracleConnection instanceof org.jboss.resource.adapter.jdbc.WrappedConnection) {
    InitialContext ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("java:/DefaultDS");
    Connection dsConn = dataSource.getConnection();
    wc = (WrappedConnection) dsConn;
    // with getUnderlying connection method , cast it to Oracle
    // Connection
    oracleConnection = wc.getUnderlyingConnection();
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    tempBlob.open(BLOB.MODE_READWRITE);
    OutputStream tempBlobWriter = tempBlob.getBinaryOutputStream();// setBinaryStream(1);
    tempBlobWriter.write((byte[]) value);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    tempBlob.close();
    st.setBlob(index, tempBlob);
    } else {
    st.setBlob(index, BLOB.empty_lob());
    } catch (Exception exp) {
    if (tempBlob != null) {
    tempBlob.freeTemporary();
    exp.printStackTrace();
    st.setBlob(index, BLOB.empty_lob());
    // throw new RuntimeException();
    } finally {
    if (wc != null) {
    wc.close();
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
    final Blob blob = rs.getBlob(names[0]);
    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
    public Object deepCopy(Object value) {
    if (value == null)
    return null;
    byte[] bytes = (byte[]) value;
    byte[] result = new byte[bytes.length];
    System.arraycopy(bytes, 0, result, 0, bytes.length);
    return result;
    public boolean isMutable() {
    return true;
    public Object assemble(Serializable arg0, Object arg1) throws HibernateException {
    return assemble(arg0, arg1);
    public Serializable disassemble(Object arg0) throws HibernateException {
    return disassemble(arg0);
    public int hashCode(Object arg0) throws HibernateException {
    return hashCode();
    public Object replace(Object arg0, Object arg1, Object arg2) throws HibernateException {
    return replace(arg0, arg1, arg2);
    =================================================================
    can anyone give me the source code for this BinaryBlobType.java according to mysql blob handling ..

    Moderator action: crosspost deleted.

  • Stored procedure, EJB, JPA, and JavaServer Faces

    Hi!
    I am currently working on a Web application using EJB, JPA, and JavaServer Faces. A part of the
    business logic is already stored in the database as stored procedures, so we need to call those
    procedures (instead of named queries) through a EJB and represent the data on the web tier.
    Where can I find an extensive tutorial using this technology? There is no such tutorial in the Oracle Learning Library.
    Maybe somebody can provide a link and/or example.
    Thanks in advance for your help!

    Hi,
    http://download.oracle.com/docs/cd/B10464_05/web.904/b10313/queries.htm#1135305
    For more help, see the TopLink / JPA forum
    TopLink/JPA
    Frank

Maybe you are looking for

  • Problem in creating database -Missing Redo log file

    I am try to create a new database using DBCA .While creating a database it shows the error oracle instance terminated.Force Disconnected. My alert log file is Errors in file /u01/app/oracle/diag/rdbms/oracl/oracl/trace/oracl_ora_5424.trc: ORA-00313:

  • Windows 7 Home Premium Peer-to-peer network over a switch

    Sorry for asking such a basic question here. I am trying to setup a small office network. There are 5 computers all running Windows 7 Home Premium. Using a switch I want to connect all 5 together. I have a software package running on PC1, which will

  • Error in posting F-02

    Hi friends, when Im trying to post F-02 Im facing the following error code. system error in routine FI_TAX_CHK_PRICING_DATA  error code 13  functiion builder TAX2. Its a new company code and all the customization is made perfect.

  • HTML to RTF

    Hi all I rename an HTML to RTF and if I use WORD DOC I see what I want to see. If I use WORD PAD I see the HTML code.That's bad. Any usefull idea with xsl or sort of? Regards

  • Slideshow Reverse then Stop or Pause

    Not sure how to enable an action that both Reverses the motion of the timeline .. then stops at a certain point without having a hard stop on the timeline itself but instead on the action of the button that is being clicked.. I'm not a developer. I'v