[JBoss Eclipse IDE (users)] - javax.persistence.GeneratorType cannot be resolved
by ataud
I install JBossIDE-1.6.0.GA-Bundle-win32 and jboss-4.0.4.GA
I create a new EJB3 project
I create the folowing EntityBean :
----------------------------------------------------------------------------------
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratorType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "COUNTRY")
public class CountryEntity implements Serializable {
int numCountry;
String labelCountry;
String code2Country;
String code3Country;
private Collection persons;
@Id( generate = GeneratorType.AUTO)
@Column (name = "NUM_COUNTRY")
public int getNumCountry() {
return numCountry;
}
public void setNumCountry(int numCountry) {
this.numCountry = numCountry;
}
@Column (name = "LABEL_COUNTRY")
public String getLabelCountry() {
return labelCountry;
}
public void setLabelCountry(String labelCountry) {
this.labelCountry = labelCountry;
}
@Column (name = "CODE2_COUNTRY")
public String getCode2Country() {
return code2Country;
}
public void setCode2Country(String code2Country) {
this.code2Country = code2Country;
}
@Column (name = "CODE3_COUNTRY")
public String getCode3Country() {
return code2Country;
}
public void setCode3Country(String code3Country) {
this.code3Country = code3Country;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="country")
@JoinColumn(name="FK_COUNTRY") // Foreign key in PERSON
public Collection getPersons() {
return persons;
}
public void setPersons(Collection persons) {
this.persons = persons;
}
}
----------------------------------------------------------------------------------
But the Eclipse IDE do not reconise the class javax.persistence.GeneratorType
"The import javax.persistence.GeneratorType cannot be resolved"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972969#3972969
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972969
19 years, 7 months
[Installation, Configuration & Deployment] - IllegalStateException after idle
by jamesclinton
Hi
Currently we have a spring app deployed in jboss 4.0.2 (backend hibernate/oracle).
All is well until the system is left idle for sometime, after which requesting a page doesn't work and the following exception is thrown in the log.
| 00:01:43,359 WARN [IdleRemover] run: IdleRemover ignored unexpected runtime exception
| java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END
| at java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEncoder.java:941)
| at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:537)
| at sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.java:358)
| at sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:414)
| at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:160)
| at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
| at java.io.FilterWriter.close(FilterWriter.java:92)
| at org.apache.log4j.FileAppender.closeFile(FileAppender.java:171)
| at org.apache.log4j.FileAppender.reset(FileAppender.java:302)
| at org.apache.log4j.FileAppender.setFile(FileAppender.java:271)
| at org.apache.log4j.DailyRollingFileAppender.rollOver(DailyRollingFileAppender.java:321)
| at org.apache.log4j.DailyRollingFileAppender.subAppend(DailyRollingFileAppender.java:343)
| at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
| at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
| at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
| at org.apache.log4j.Category.callAppenders(Category.java:187)
| at org.apache.log4j.Category.forcedLog(Category.java:372)
| at org.apache.log4j.Category.log(Category.java:864)
| at org.jboss.logging.Log4jLoggerPlugin.debug(Log4jLoggerPlugin.java:128)
| at org.jboss.logging.Logger.debug(Logger.java:144)
| at org.jboss.resource.connectionmanager.IdleRemover$1.run(IdleRemover.java:67)
| at java.lang.Thread.run(Thread.java:595)
| 00:01:43,481 INFO [STDOUT] Exception in thread "IdleRemover"
|
Any comments or thoughts on where to look to solve this would be appreciated.
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972966#3972966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972966
19 years, 7 months
[JBoss/Spring Integration] - Jndi lookup on spring factory return 'null'
by jissma
hello,
I'm trying to deploy a spring application (no EJB inside only POJO class) with deployer ( Jboss 4.0.2 : the one packaged with jbpm)
i export a jar(test3.spring) from eclipse and place it in deploy folder, when i watch the log everything seam to be ok :
i get the following message : "Bean factory [test3] binded to local JNDI."
then i inspect the JNDI listXML(); in JMX console my object seem to be referenced :
| test3
| org.jboss.spring.factory.NamedXmlApplicationContext
when i run the Juint test to get the factory, the returned object of
context.lookup("test3"); is null
could you help me solve this problem ?
here is my : jboss-spring.xml in META-INF in test3.spring
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE beans SYSTEM "http://www.springframework.org/dtd/spring-beans.dtd">
| <beans>
| <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
| <property name="locations">
| <list>
| <value>/org/appli/hibernate.properties</value>
| </list>
| </property>
| </bean>
|
|
| <bean id="dSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
| <property name="url">
| <value>jdbc:firebirdsql:localhost/3050:c:/dev/databases/hibernate.gdb</value>
| </property>
| <property name="driverClassName" >
| <value>org.firebirdsql.jdbc.FBDriver</value>
| </property>
| <property name="username">
| <value>sysdba</value>
| </property>
| <property name="password">
| <value>masterkey</value>
| </property>
| </bean>
|
|
| <bean id="myTransactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
| <property name="sessionFactory"><ref local="sessionFactory"/></property>
| </bean>
|
| <bean id="contactService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
| <property name="transactionManager"><ref local="myTransactionManager"/></property>
| <property name="target"><ref local="contactDAO"/></property>
| <property name="transactionAttributes">
| <props>
| <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
| <prop key="save*">PROPAGATION_REQUIRED</prop>
| </props>
| </property>
| </bean>
|
|
| <bean id="habitationService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
| <property name="transactionManager"><ref local="myTransactionManager"/></property>
| <property name="target"><ref local="habitationDAO"/></property>
| <property name="transactionAttributes">
| <props>
| <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
| <prop key="save*">PROPAGATION_REQUIRED</prop>
| </props>
| </property>
| </bean>
|
|
| <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
| <property name="dataSource">
| <ref bean="dSource"/>
| </property>
| <property name="hibernateProperties">
| <props>
| <prop key="hibernate.dialect">${hibernate.dialect}</prop>
| <prop key="hibernate.show_sql">true</prop>
| <prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
| </props>
| </property>
| <property name="mappingResources">
| <list>
| <value>org/appli/db/TContact.hbm</value>
| <value>org/appli/db/THabitation.hbm</value>
| </list>
| </property>
| </bean>
|
| <bean id="hTemplate" class="org.springframework.orm.hibernate.HibernateTemplate">
| <property name="sessionFactory">
| <ref bean="sessionFactory"/>
| </property>
| </bean>
|
| <bean id="contactDAO" class="org.appli.db.ContactsDao">
| <property name="hibernateTemplate">
| <ref local="hTemplate"/>
| </property>
| </bean>
|
| <bean id="habitationDAO" class="org.appli.db.HabitationsDao">
| <property name="hibernateTemplate">
| <ref local="hTemplate"/>
| </property>
| </bean>
|
| <bean id="contactBusiness" class="org.appli.business.ContactsBusiness" singleton="true">
| <property name="contactsDao">
| <ref local="contactDAO"/>
| </property>
| </bean>
|
| </beans>
and there the Juint test that return null :
public void testlookup() {
| try {
| Properties jndiProps = new Properties();
| jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| jndiProps.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interface");
| jndiProps.setProperty(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
| InitialContext context = new InitialContext(jndiProps);
| NamedXmlApplicationContext nXAC= (NamedXmlApplicationContext) context.lookup("test3");
| nXAC.getBean("contactDAO");
|
|
| } catch (NamingException e) {
| System.out.println("Naming Error " + e.getMessage());
|
| }
|
| }
|
thank you in advance for your reply.
jm
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972962#3972962
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972962
19 years, 7 months