Javax.persistence annotated class creating persistence.jar dependency

Hi,
I'm trying to create a JAR for clients to use. I would like to include a few classes that have been annotated for use with hibernate using the standard javax.persistence annotations (code snippet below). The problem is, @GeneratedValue accepts a javax.persistence.GenerationType enum which is creating a dependency and, in fact, causes the client's compiler to fail if they try to import and use the Award class after including my JAR.
Does anyone know of a solution. Thanks in advance. Here's the compiler output:
An exception has occurred in the compiler (1.6.0_04). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for javax.persistence.GenerationType not found
Compilation completed with 1 error and 0 warnings
1 error
0 warnings
Compiler internal error. Process terminated with exit code 4
@Entity
@Table( name = "award" )
public class Award
    @Id
    @GeneratedValue( strategy = GenerationType.IDENTITY ) // this requires that GenerationType be available to the client
    @Column( name = "award_id", nullable = false, length = 19 )
    private Long id;
    // etc., etc.
}

Did you read the error message anyway? Did you bother to Google the error message?
At least try upgrading both the JDK and the JPA implementation.

Similar Messages

  • Unable to create Executable JAR file

    Hi,
    I tried to create Executable JAR file for
    //JarTest.java
    class JarTest
         public static void main( String args[] )
              System.out.println("i am EXECUTABLE JAR ");
    mf is like
    Manifest-Version: 1.0
    Main-Class: JarTest
    used jar cmf JarTest.mf exe.jar *.classIt created a jar file but i can't Execute the file
    Help me
    Thanks
    AE

    java is choosy about the actual manifest file format (line ending, trailing empty line, whatever).
    This works for me with your example:
    posman@proli:~/ivan/aa> cat mf
    Manifest-Version: 1.0
    Main-Class: JarTest
    posman@proli:~/ivan/aa> od -cx mf
    0000000   M   a   n   i   f   e   s   t   -   V   e   r   s   i   o   n
            614d 696e 6566 7473 562d 7265 6973 6e6f
    0000020   :       1   .   0  \n   M   a   i   n   -   C   l   a   s   s
            203a 2e31 0a30 614d 6e69 432d 616c 7373
    0000040   :       J   a   r   T   e   s   t  \n  \n  \0
            203a 614a 5472 7365 0a74 000a

  • Problems building JavaDoc of classes using Hibernate/javax.persistence

    Hallo!
    I am trying to create the javadoc of classes that use hibernate. First it starts of with error messages like
      [javadoc] SubmissionSet.java:40: cannot find symbol
      [javadoc] symbol: class Table
      [javadoc] @Table(name="submissionset"/*, schema = "reg"*/)or
      [javadoc] Employee.java:8: package javax.persistence does not exist
      [javadoc] import javax.persistence.JoinColumn;
      [javadoc]                         ^Afterwards it gets even strange with exceptions within javadoc like:
    [javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
      [javadoc]     at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
      [javadoc]     at com.sun.tools.doclets.formats.html.TagletWriterImpl.deprecatedTagOutput(TagletWriterImpl.java:70)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.taglets.DeprecatedTaglet.getTagletOutput(DeprecatedTaglet.java:40)
      [javadoc]     at com.sun.tools.doclets.formats.html.MethodWriterImpl.writeDeprecated(MethodWriterImpl.java:166)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.buildDeprecationInfo(MethodBuilder.java:183)
      [javadoc]     at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      [javadoc]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [javadoc]     at java.lang.reflect.Method.invoke(Method.java:597)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.invokeMethod(MethodBuilder.java:109)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.bu    at java.lang.reflect.Method.invoke(Method.java:597)
      [javadoc]     at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
      [javadoc]     at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
      [javadoc]     at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
      [javadoc]     at com.sun.tools.javadoc.Start.begin(Start.java:128)
      [javadoc]     at com.sun.tools.javadoc.Main.execute(Main.java:41)
      [javadoc]     at com.sun.tools.javadoc.Main.main(Main.java:31)I suppose the problem is somehow linked to the usage of hibernate since the same ant script works for other projects (that don't use hibernate...). Do you have an idea what could be wrong?
    Thanks in advance
    Patrick

    See [http://forums.sun.com/thread.jspa?threadID=5333060&tstart=0]. In general, if you use third-party libraries in your code, you should include these libraries in Javadoc's classpath option when generating documentation.

  • NoSuchMethodError: javax.persistence.OneToMany

    Hi all,
    I have an application that run with mvn jetty:run and run fine, but when i deployed in weblogic 10.3.4 send next error,
    I guess it takes one of the weblogic jars, but as I make the application take the jar of war instead of the weblogic
    [28/06/2011 08:52:21 ERROR ContextLoader:initWebApplicationContext:220] - Context initialization failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'abstractPersistenceDaoGenericHibernate' defined in URL [zip:C:/oracle/JDEV11/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/fisa-service/t8lrkf/war/WEB-INF/lib/fisa-model-0.0.1-SNAPSHOT.jar!/mx/grupocp/fisa/model/dao/impl/AbstractPersistenceDaoGenericHibernate.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.orm.hibernate3.HibernateTemplate]: : Error creating bean with name 'hibernateTemplate' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Invocation of init method failed; nested exception is java.lang*.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z*
         at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
         at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
         at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
         at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
         at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
         at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
         at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
         at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    this is ma pom file
    <parent>
              <artifactId>fisa</artifactId>
              <groupId>mx.grupocp</groupId>
              <version>0.0.1-SNAPSHOT</version>
         </parent>
         <groupId>mx.grupocp</groupId>
         <artifactId>fisa-service</artifactId>
         <version>0.0.1-SNAPSHOT</version>
         <packaging>war</packaging>
         <dependencies>
              <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-orm</artifactId>
                   <version>${org.springframework.version}</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.hibernate</groupId>
                   <artifactId>hibernate-core</artifactId>
                   <version>${org.hibernate.version}</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.hibernate</groupId>
                   <artifactId>hibernate-annotations</artifactId>
                   <version>${org.hibernate.version}</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>commons-dbcp</groupId>
                   <artifactId>commons-dbcp</artifactId>
                   <version>1.4</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>com.oracle</groupId>
                   <artifactId>ojdbc6</artifactId>
                   <version>11.2.0.2.0</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>mx.grupocp</groupId>
                   <artifactId>fisa-model</artifactId>
                   <version>0.0.1-SNAPSHOT</version>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.aspectj</groupId>
                   <artifactId>aspectjweaver</artifactId>
                   <version>1.6.11</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>net.sf.jasperreports</groupId>
                   <artifactId>jasperreports</artifactId>
                   <version>4.0.1</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-core</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-frontend-jaxws</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-http</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-http-jetty</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-jms</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-common-utilities</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-local</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-databinding-aegis</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-frontend-simple</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-management</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>cglib</groupId>
                   <artifactId>cglib</artifactId>
                   <version>2.2</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>javassist</groupId>
                   <artifactId>javassist</artifactId>
                   <version>3.12.1.GA</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>log4j</groupId>
                   <artifactId>log4j</artifactId>
                   <version>1.2.15</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.slf4j</groupId>
                   <artifactId>slf4j-log4j12</artifactId>
                   <version>1.6.1</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.slf4j</groupId>
                   <artifactId>slf4j-api</artifactId>
                   <version>1.6.1</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
         </dependencies>

    Hi all,
    I have an application that run with mvn jetty:run and run fine, but when i deployed in weblogic 10.3.4 send next error,
    I guess it takes one of the weblogic jars, but as I make the application take the jar of war instead of the weblogic
    [28/06/2011 08:52:21 ERROR ContextLoader:initWebApplicationContext:220] - Context initialization failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'abstractPersistenceDaoGenericHibernate' defined in URL [zip:C:/oracle/JDEV11/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/fisa-service/t8lrkf/war/WEB-INF/lib/fisa-model-0.0.1-SNAPSHOT.jar!/mx/grupocp/fisa/model/dao/impl/AbstractPersistenceDaoGenericHibernate.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.orm.hibernate3.HibernateTemplate]: : Error creating bean with name 'hibernateTemplate' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/PersistenceAppCtx.xml]: Invocation of init method failed; nested exception is java.lang*.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z*
         at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
         at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
         at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
         at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
         at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
         at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
         at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
         at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    this is ma pom file
    <parent>
              <artifactId>fisa</artifactId>
              <groupId>mx.grupocp</groupId>
              <version>0.0.1-SNAPSHOT</version>
         </parent>
         <groupId>mx.grupocp</groupId>
         <artifactId>fisa-service</artifactId>
         <version>0.0.1-SNAPSHOT</version>
         <packaging>war</packaging>
         <dependencies>
              <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-orm</artifactId>
                   <version>${org.springframework.version}</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.hibernate</groupId>
                   <artifactId>hibernate-core</artifactId>
                   <version>${org.hibernate.version}</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.hibernate</groupId>
                   <artifactId>hibernate-annotations</artifactId>
                   <version>${org.hibernate.version}</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>commons-dbcp</groupId>
                   <artifactId>commons-dbcp</artifactId>
                   <version>1.4</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>com.oracle</groupId>
                   <artifactId>ojdbc6</artifactId>
                   <version>11.2.0.2.0</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>mx.grupocp</groupId>
                   <artifactId>fisa-model</artifactId>
                   <version>0.0.1-SNAPSHOT</version>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.aspectj</groupId>
                   <artifactId>aspectjweaver</artifactId>
                   <version>1.6.11</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>net.sf.jasperreports</groupId>
                   <artifactId>jasperreports</artifactId>
                   <version>4.0.1</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-core</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-frontend-jaxws</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-http</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-http-jetty</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-jms</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-common-utilities</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-transports-local</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-databinding-aegis</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-frontend-simple</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.apache.cxf</groupId>
                   <artifactId>cxf-rt-management</artifactId>
                   <version>2.3.3</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>cglib</groupId>
                   <artifactId>cglib</artifactId>
                   <version>2.2</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>javassist</groupId>
                   <artifactId>javassist</artifactId>
                   <version>3.12.1.GA</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>log4j</groupId>
                   <artifactId>log4j</artifactId>
                   <version>1.2.15</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.slf4j</groupId>
                   <artifactId>slf4j-log4j12</artifactId>
                   <version>1.6.1</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
              <dependency>
                   <groupId>org.slf4j</groupId>
                   <artifactId>slf4j-api</artifactId>
                   <version>1.6.1</version>
                   <type>jar</type>
                   <scope>compile</scope>
              </dependency>
         </dependencies>

  • Java.lang.NoSuchMethodError: javax/persistence/OneToMany.orphanRemoval()Z

    Hi,
    I have a web application that is built using Spring 3.2.1 and Hibernate 4.2.0 (JPA 2). The application deploys and runs well in Weblogic v 12.1.1. Now we have a change in the requirement from the client regarding the server version. The server needs to be downgraded to a lower version i.e., Weblogic v 10.3.2. Now, when I deploy the application onto this version of the server I get the following exception while deployment.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0' while setting constructor argument with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0': Cannot resolve reference to bean 'org.springframework.security.authentication.ProviderManager#0' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'cpmaSecurityService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cpmaSecurityService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ncr.cpa.data.dao.UserDao com.ncr.cpa.service.impl.CPMASecurityService.userDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.ncr.cpa.data.dao.impl.UserDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContextTxManager.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/OneToMany.orphanRemoval()Z
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:933)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:390)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:113)
      at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1870)
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3155)
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:487)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:427)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:201)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:249)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:427)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:28)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:672)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
      at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:44)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
      at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
      at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
      at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:52)
      at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
      at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:31)
      at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
      at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:170)
      at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:124)
      at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181)
      at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97)
      at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    It looks like a problem with the JPA library. I tried few of the solutions after I did some research but were of no use. Below are the solutions that I had tried
    Solution 1:
    1) Copy hibernate-jpa-2.0-api-1.0.1.Final.jar into your weblogic's %DOMAIN_HOME%/lib directory.
    2) Open up your setDomainEnv.cmd (windows) or setDomainEnv sh (unix) script file and set your PRE_CLASSPATH variable to set PRE_CLASSPATH=%DOMAIN_HOME%\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar
    After trying the above solution the exception is still raised while deployment of the application.
    Solution 2:
    Create "weblogic-application.xml" file into META-INF with something like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-application xmlns="http://xmlns.oracle.com/weblogic/weblogic-application">
    <application-param>
      <param-name>webapp.encoding.default</param-name>
      <param-value>UTF-8</param-value>
    </application-param>
    <prefer-application-packages> 
      <package-name>javax.persistence.*</package-name>
    </prefer-application-packages>
    </weblogic-application>
    After trying the above solution the exception is still raised while deployment of the application
    I really appreciate if anyone can suggest me what is causing this exception and how can I fix this?
    Thanks,
    Srikanth

    Hi,
    if you deplyo to Application Server 10.1.3 make sure you install the ADF runtime libraries 10.1.3.1. Shut down the Application Server and use the runtime installer from the JDeveloper tools menu
    Frank

  • Package javax.persistence does not exist

    Hi, I'm a beginner on Weblogic, sorry my so simple and basic question (and my bad english). But I'm trying to build the weblogic examples ("ant build", as the documentation says) and got error messages like this:
    Buildfile: build.xml
    clean:
    init:
    [mkdir] Created dir: /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30/build/META-INF
    [copy] Copying 1 file to /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30/build/META-INF
    [copy] Copying 1 file to /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30/build/META-INF
    [echo] ======================================================
    [echo] Building EJB 3.0 Samples
    [echo] ======================================================
    [echo] Base directory : /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30
    [echo] Samples Home : /opt/bea/wlserver_10.3/samples
    [echo] Deployed Target : /opt/bea/wlserver_10.3/samples/server/examples/build/ejb30/reviewService.ear
    compile:
    [javac] Compiling 38 source files to /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30/build
    [javac] /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30/src/java/examples/ejb/ejb30/domain/Artist.java:6: package javax.persistence does not exist
    [javac] import javax.persistence.*;
    [javac] ^
    [javac] /opt/bea/wlserver_10.3/samples/server/examples/src/examples/ejb/ejb30/src/java/examples/ejb/ejb30/domain/Person.java:7: package javax.persistence does not exist
    I suppose that there is some "jar" containing "javax.persistence" that should be included in some classpath
    on build.xml file, but I didn't find such "jar". I found in documentation that persistence is also implemented using
    the Kodo software, an may be I should configure it, but I don't know how. Can someone help me building the
    Weblogic examples?
    Thanks.

    Hi,
    Here the result of :
    echo "CLASSPATH" in windows after running setWLS.Env.cmd
    C:\bea\patch_wlw1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\JROCKI~1\lib\tools.jar;C:\bea\WLSERV~1.3\server\lib\weblogic_sp.jar;
    C:\bea\WLSERV~1.3\server\lib\weblogic.jar;
    C:\bea\modules\features\weblogic.server.modules_10.3.0.0.jar;
    C:\bea\WLSERV~1.3\server\lib\webservices.jar;
    C:\bea\modules\ORGAPA~1.5/lib/ant-all.jar;
    C:\bea\modules\NETSFA~1.0_1/lib/ant-contrib.jar;
    C:\bea\patch_wlw1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
    C:\bea\JROCKI~1\lib\tools.jar;
    C:\bea\WLSERV~1.3\server\lib\weblogic_sp.jar;
    C:\bea\WLSERV~1.3\server\lib\weblogic.jar;
    C:\bea\modules\features\weblogic.server.modules_10.3.0.0.jar;
    C:\bea\WLSERV~1.3\server\lib\webservices.jar;
    C:\bea\modules\ORGAPA~1.5/lib/ant-all.jar;
    C:\bea\modules\NETSFA~1.0_1/lib/ant-contrib.jar;
    C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip
    Hope it will help
    can you past the content of you script setWLSEnv.sh?
    Also try with the script setExamplesEnv.sh under C:\bea\wlserver_10.3\samples\domains\wl_server (for windows) the equivalent of Unix
    Thanks

  • Can I create a JTA EntityManagerFactory in a utility class in a .jar file?

    I have utility classes in a .jar file inside of a .war file deployed in Glassfish 3.1. One of these utility classes, CredentialsUtil, needs to access a database. I can't inject an EntityManager into CredentialsUtil since it is not an EJB. (For security reasons I don't want to make CredentialsUtil an EJB. I want it to be a POJO.)
    In CredentialsUtil I need an EntityManagerFactory that is connected to a datasource defined in Glassfish. Here is the line from CredentialsUtil.java and from the persistence.xml both of which will be in the util.jar file:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("Credpu");
    <persistence-unit name="Credpu" transaction-type="JTA">
    I can't use RESOURCE_LOCAL since any changes to the datasource configuration must be done in Glassfish rather than changing persistence.xml.
    (The transaction context is not important in CredentialsUtil. It will be called by a WS-Security handler which may not have a transaction context.)
    Can I put the persistence.xml and the CredentialsUtil class that creates the EntityManagerFactory from it inside of the util.jar file (which will be in a .war), or do I have to move the class and a copy of the persistence.xml file out to the .war file? (I'll have to leave persistence.xml in the .jar file too since there are some @Entity in the .jar file. I don't know why but there are @Entity pojos in the .jar file.)
    I'd like to use the existing persistence.xml, but if I can't is there is a way to create an EntityManagerFactory (or EntityManager) that gets its datasource directly from Glassfish, ignoring persistence.xml?
    Thanks.

    Styles in Pages are saved in the documents (or templates). There is no easy method for adding a style to a built-in template (and it is strongly recommended that you do not tamper with them). You can open a built- in template, add your style and save it as a user template so that your new style will be standard in documents created from that template.

  • How to update java.sql.Clob using javax.persistence.EntityManager?

    Hello.
    Can anyone tell me (or show me some example) how to update java.sql.Clob using javax.persistence.EntityManager.
    When I’m trying to update column (with type Clob) value is not inserting, after update column is empty. I haven’t any error during update, I’m using database Oracle 10g.
    Edited by: ernest211 on Jul 16, 2009 1:24 AM

    Post some code so we can see how you are doing it. If you are using JPA entities take a look at the @Lob annotation.
    m

  • How to create a Jar with only class files?

    Dear all,
    I want to create a jar file with only classes.My class files and java files are in different folders under com .
    say
    com
    in com there are two folders
    folder 1 -- subfolder 1
    folder 2 -- subfolder 2
    like this.
    If i want to create a jar file from com directory how should i give the jar command.Again my jar should contain only .class files.
    Any help will be appreciated
    Thanks
    lekshmi

    It doesn't work.Says "No such class or directory"
    Any other way Or is it possible to do so?Read the link I posted and create the statement to make your structure. I was thinking you were inside the com directory but if you are above it you will need something like this instead:
    jar -cf test.jar com\*.class com\subfolder1\*.class com\subfoler2\*.class
    But either way don't just copy and past this. Think about what is does so that you can make it work for you.
    Also, you might want to look into using Ant if you are going to be building this a lot.

  • Javax.servlet.ServletException: Cannot create bean of class

    People,
    HELP!! I am getting desperate!!!
    I am a newbie when it comes to TOMCAT, but i have been using Blazix before.
    My current system is using APACHE/TOMCAT on a Solaris machine and I keep hitting the same problem. I have gone through the archives but the only thing it states is to check the directory which i have done.
    I keep getting:
    Error 500
    Internal Error
    javax.servlet.ServletException: Cannot create bean of class MyClass
    The code used to work on the Blazix server so i am assuming it is something to do with a config parameter somewhere - but i do not know where. I have checked the directory/package structure and they seem to work. It even serves it when they are html pages not jsp, but obviously wont use the bean. :(
    I can post code if necessary.
    Please help
    Steve

    The FormData.class file is in examples/WEB-INF/classes/ directory.
    Is this wrong? then should it be in a package called examples.steve???
    <TITLE> Poc </TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META NAME="Generator" CONTENT="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
    <META NAME="Author" CONTENT="Steve Brodie">
    <META NAME="Proof of Concept order entry system" CONTENT="">
    <META NAME="PROOF OF CONCEPT ORDER ENTRY SYSTEM " CONTENT="">
    </HEAD>
    <%@ page import="steve.FormData" %>
    <jsp:useBean id="user" class="steve.FormData"/>
    <jsp:setProperty name="user" property="*"/>
    <FORM METHOD=POST ACTION="SaveDetails.jsp">
    <CENTER>
    <H1>     
    POC CNS demo <BR>
    POC Order Entry System <BR></H1>
    <H2><CENTER>PROOF OF CONCEPT ORDER ENTRY SYSTEM <BR>
    in order to illustrate the use of an new product<BR></H1>
    </CENTER>
    <BODY>
    Please enter the following details: <BR>
    Second name <INPUT TYPE=TEXT NAME=secondName SIZE=20><BR>
    First name <INPUT TYPE=TEXT NAME=firstName SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address1 SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address2 SIZE=20><BR>
    Post Code <INPUT TYPE=TEXT NAME=postCode SIZE=10><BR>
    Phone NO. <INPUT TYPE=TEXT NAME=phone SIZE=10><BR>
    <BR>
    Credit Card<INPUT TYPE=TEXT NAME=credit SIZE=15><BR>
    <BR>
    Quality of Service:
    <SELECT TYPE=TEXT NAME="QoS">
    <OPTION SELECTED TYPE=TEXT NAME=Gold>Gold <BR>
    <OPTION TYPE=TEXT NAME=Silver>Silver <BR>
    <OPTION TYPE=TEXT NAME=Bronze>Bronze <BR>
    </SELECT>
    <BR>
    <BR>
    <INPUT TYPE=RESET>
    <P><INPUT TYPE=SUBMIT>
    <BR>
    <BR>
    <IMG SRC=../images/Cisco.gif>
    </FORM>
    </BODY>
    </HTML>
    package steve;
    * @author Steven Brodie
    * @date
    * @version 0.0
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class FormData {
         String secondName = null;
         String firstName = null;
         String address1 = null;
         String address2 = null;
         String postCode = null;
         int credit = 0;
         int phone = 0;
         String qos = null;
         String file = "out";
         String filex = "xout";
         PrintWriter pout = null;
         PrintWriter xout = null;
         FormData() {
              try {
                   pout = new PrintWriter(new BufferedWriter(new FileWriter(file + ".txt")));
                   xout = new PrintWriter(new BufferedWriter(new FileWriter(filex + ".xml")));
              xout.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              xout.println("<OrderEntry xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
              xout.println("xsi:noNamespaceSchemaLocation=\"http://machine2.com:8080/xml/xsd/OrderEntry.xsd\">");
              } catch (IOException ioe) {
                   System.err.println("DataFileWriter error ioe on init");
                   ioe.printStackTrace();
                   System.exit(1);
    public void setFirstName( String value ) {
    firstName = value;
              System.out.println(firstName);
              pout.println(firstName);
              xout.println("<firstname value= \"" + firstName + "\"/>");
    public void setSecondName( String value ) {
    secondName = value;
              System.out.println(secondName);
              pout.println(secondName);
              xout.println("<secondname value= \"" + secondName + "\"/>");
    public void setAddress1( String value ) {
    address1 = value;
              System.out.println(address1);
         pout.println(address1);
              xout.println("<address1 value= \"" + address1 + "\"/>");
    public void setAddress2( String value ) {
    address2 = value;
              System.out.println(address2);
              pout.println(address2);
              xout.println("<address2 value= \"" + address2 + "\"/>");
    public void setPostCode( String value ) {
    postCode = value;
              System.out.println(postCode);
              pout.println(postCode);
              xout.println("<postCode value= \"" + postCode + "\"/>");
    public void setCredit( int value ) {
    credit = value;
              System.out.println(credit);
              pout.println(credit);
              xout.println("<creditCard value= \"" + credit + "\"/>");
         public void setPhone( int value) {
              phone = value;
              System.out.println("0" + phone);
              pout.println("0" + phone);
              xout.println("<phoneNo value= \"0" + phone + "\"/>");
    public void setQoS( String value ) {
    qos = value;
              System.out.println(qos);
              pout.println(qos);
              xout.println("<QoS value= \"" + qos + "\"/>");
              xout.println("</OrderEntry>");
              pout.flush();
              pout.close();
              xout.flush();
              xout.close();
    public String getFirstName() {
              return firstName;
    public String getSecondName() {
              return secondName;
    public String getAddress1() {
              return address1;
    public String getAddress2() {
              return address2;
    public String getPostCode() {
              return postCode;
    public int getCredit() {
              return credit;
         public int getPhone() {
              return phone;
         public String getQoS() {
              return qos;

  • Creating a JAR File for a program that depends on other JAR files

    Hi, I'm pretty new to this so it shouldn't be terribly hard to answer:
    I have a program which uses JGoodies. There are 2 JGoodies .jar files in the same directory as my program. So I compile it by doing:
    javac -extdirs . NameOfMyProgram.java
    First off, is this the best way to do it? Is there any way of 'calling' these JAR files from within NameOfMyProgram.java?
    Secondly, if I then try to run it by doing java NameOfMyProgram, it doesn't work; can't find the JGoodies stuff. I end up having to add the classpaths of the unzipped JGoodies directories.
    So I have 2 questions:
    1. How can I execute my file so that it reads from the JAR files, not the big expanded folders that I unzipped?
    2. How can I create a JAR file that reads the JGoodies files properly? Right now, I have a Manifest.txt file that looks like:
    Main-Class: NameOfMyProgram
    Class-Path: forms-1.0.5.jar
    Class-Path: looks-1.3.1.jar
    Thanks a lot for your help!

    - learn how to use mysql JDBC
    - pack JDBC driver only
    - remotely access your DB
    - set proper security level for your app

  • Create BPEL jar file using Bpelc via Java classes

    HI,
    I am trying to create the BPEL files ( xyz.bpel, bpel.xml, xyz.wsdl etc.. ) on the fly using Java code... Once I create all these files, I create a packaged jar (Ex : bpel_xyz_v2006_10_17__37256.jar) file and deploy the same in the Bpel PM.
    Right now, in order to create the jar file, I am running the bpelc.bat file under bpel/bin and then using the IBPELDomainHandle, I am deploying the process.
    But my requirement is to create the jar file using java rather than executing the bpelc.bat file..
    Can you please give me pointers as to how to achieve the same?
    Thanks
    Pramod

    Actually, I had figured out the part of calling the Bpelc class, but initially I was trying to create an object of the class and was not able to do so. That was where I got stuck.
    Eventually, I did something like the code snippet below and it works fine and the jar file is created. Just fyi for anyone looking in the future.
    String[] setupValues;
    setupValues = new String[]{ "-home", "D:\\product\\10.1.3.1\\OracleAS_1\\bpel", "-rev",
    "1.0", };
    Bpelc.main(setupValues);
    Thanks
    Pramod

  • How do you create a jar file with txt and classes?

    Hey, I'm trying to create code to create a jar file with a text file, but I can't figure out how to add the text file. Here is what I have so far:
    try {
                // Name of jar file to write
                String archiveFile = "test.jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("test.txt"));
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
            }It creates the .jar file with the correct manifest but I can't get it to write the test.txt or anything else into the jar file.
    -Gandolf
    Edited by: GanMatt on Jun 18, 2009 8:18 AM
    Edited by: GanMatt on Jun 18, 2009 8:19 AM

    Alright, my question has changed. Here's the code:
    try {
                // Name of jar file to write
                String archiveFile = "test.jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("test.txt"));
                out.write("Hi".getBytes());
                out.flush();
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this,ex.toString(),"BUG!",JOptionPane.INFORMATION_MESSAGE);
            }It creates the jar file with the txt file inside it, but I can't write "Hi" inside of the text file. Any ideas?
    -Gandolf

  • Creating a JAR with main class def.

    Hello Amigos,
    I am having problems creating a jar file. My problem is that when I create the jar file and insert this line in my manifest file
    Main-Class: classnamewhere classname is what ever class you want as explain here:
    http://java.sun.com/developer/Books/javaprogramming/JAR/basics/run.html
    Then I have the jar file and double click it and get the Fail to load Main-Class error.
    This is what I am typing in the command line:
    jar cmf MANIFEST.MF myapp.jar *.class
    When I go back and extract all the files out of the jar file the manifest files looks like this:
    Manifest-Version: 1.0
    Created-By: 1.3.1 (IBM Corporation)Thanks in advance

    No ofense but... You got to be kidding me!?!?!Not kidding at all. Had you read the online tutorial, you'd have found the following line:
    Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
    Have you tried it yet?

  • Javax.persistence.NoResultException: No entity help

    here is a my method
    public WnUser findUser (Object email) {
    return (WnUser) em.createQuery("SELECT object(u.email) FROM entities.WnUser u WHERE u.email =:email")
    .setParameter("email", email).getSingleResult();
    when I call this I see errors
    2:23:44,843 ERROR [STDERR] javax.ejb.EJBException: javax.persistence.NoResultException: No entity found for query
    12:23:44,843 ERROR [STDERR]      at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
    12:23:44,843 ERROR [STDERR]      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
    12:23:44,843 ERROR [STDERR]      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
    12:23:44,843 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    12:23:45,281 ERROR [STDERR]      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
    12:23:45,281 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    I want write method fro login by email and password, also I want search email with entity beans, nut I have this errors, what is it?

    Seems this is happening because your query finds no result.
    If you look at the javadoc for javax.persistence.Query, you can see that method getSingleResult() throws a NoResultException if there is no result.

Maybe you are looking for

  • Smartform Graphics problem

    hi , I am facing one problem with the graphics I have to Print the logo of my company when i put this logo in the graphics i can see it in the form painter but it is not visible in the print preview . The same problem occurs with standard logos also

  • Adobe TV Exercise Files location "learn CS6 Photoshop"

    Where can I subscribe to download the exercise files that are referred to in the Adobe TV Learn CS6 Photoshop. I have searched on Lynda.com. I have searched on the web and can only find reference to pirate sites ?

  • Is there any BAPI calling only  ABAP command SET UPDATE TASK LOCAL

    Hi abapers we have a requirement to run SET UPDATE TASK LOCAL befor calling BAPI_ENTRYSHEET_CREATE command by JAVA through JCO. is there any BAPI that contains SET UPDATE TASK LOCAL command or simillar functionality. Thanks & Regards, Ramesh

  • WebDynpro ABAP - inter session events possible?

    Hi Experts, I have a ABAP-WebDynpro application with various tabstrips to show and maintain process data within a production process. Each tabstrip contains several data of a specific process step. At the beginning, very few data are already present.

  • Can I draw a freehand line in a Fill & Sign document?

    Can I draw a freehand line in a Fill & Sign document? I have filled in the form but need to draw a freehand line to indicate the markings on our horse's face.