[EJB 3.0] - ORA-00904
by Ceene
Hi
I have a problem with my EntityBean but i don't know why. I hapoe somebody can help me.
Ouput in the JBoss-Console
| 10:43:14,296 WARN [JDBCExceptionReporter] SQL Error: 904, SQLState: 42000
| 10:43:14,296 ERROR [JDBCExceptionReporter] ORA-00904: Ungültiger Spaltenname
|
| |
| | My EntityBean "LOV_User.java"
| |
| | | package tcejb;
| | |
| | | import javax.persistence.*;
| | |
| | | @Entity
| | | @NamedQueries({
| | | @NamedQuery(name="LOV_USER.findByName",
| | | query="SELECT l FROM LOV_User l WHERE l.user = ?1 ")
| | | })
| | | @Table(name="LOV_USER")
| | | public class LOV_User implements java.io.Serializable {
| | |
| | | private static final long serialVersionUID = 1;
| | |
| | | private String user;
| | | private String user_name;
| | | private String user_password;
| | | private int admin_sign;
| | | private String status_sign;
| | | private String new_date;
| | | private String update_date;
| | | private String last_user;
| | |
| | | @Id
| | | @Column(name="LOV_USR_USER")
| | | public String getUser() {return user;}
| | | public void setUser(String user) {this.user = user;}
| | |
| | | @Column(name="LOV_USR_USER_NAME")
| | | public String getUserName() {return user_name;}
| | | public void setUserName(String user_name) {this.user_name = user_name;}
| | |
| | | @Column(name="LOV_USR_USER_PASSWORD")
| | | public String getUserPassword() {return user_password;}
| | | public void setUserPassword(String user_password) {this.user_password = user_password;}
| | |
| | | @Column(name="LOV_USR_ADMIN_SIGN")
| | | public int getAdminSign() {return admin_sign;}
| | | public void setAdminSign(int admin_sign) {this.admin_sign = admin_sign;}
| | |
| | | @Column(name="LOV_USR_STAUS_SIGN")
| | | public String getStatusSign() {return status_sign;}
| | | public void setStatusSign(String status_sign) {this.status_sign = status_sign;}
| | |
| | | @Column(name="LOV_USR_NEW_DATE")
| | | public String getNewDate() {return new_date;}
| | | public void setNewDate(String new_date) {this.new_date = new_date;}
| | |
| | | @Column(name="LOV_USR_UPDATE_DATE")
| | | public String getUpdateDate() {return update_date;}
| | | public void setUpdateDate(String update_date) {this.update_date = update_date;}
| | |
| | | @Column(name="LOV_USR_LAST_USER")
| | | public String getLastUser() {return last_user;}
| | | public void setLastUser(String last_user) {this.last_user = last_user;}
| | | }
| | |
| |
| | My StatefulBean
| |
| | | package tcejb;
| | |
| | | import java.util.List;
| | | import java.util.Vector;
| | | import javax.ejb.*;
| | | import javax.persistence.*;
| | |
| | | @Stateful
| | | public class LoginBean implements LoginRemote {
| | | @PersistenceContext(unitName="tcdb")
| | | private EntityManager manager;
| | |
| | | private String user;
| | |
| | | @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| | | public void initialisieren(String key) {
| | | Query query = manager.createNamedQuery("LOV_USER.findByName");
| | | query.setParameter(1, key);
| | | List liste = query.getResultList();
| | | Vector<LOV_User> erg = new Vector<LOV_User>();
| | | for(Object o : liste)
| | | {
| | | erg.add((LOV_User) o);
| | | }
| | | user = erg.toString();
| | | }
| | |
| | | @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| | | public String getUser() {return user;}
| | |
| | | @Remove
| | | public void remove() {
| | |
| | | }
| | |
| | | }
| | |
| |
| | Please somebody get me a solution. I have no idea why the Column name is not ok. If i write the column-name from the database-table the same message pop up.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135224#4135224
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135224
18 years, 1 month
[JBoss AOP] - Re: Exception to invoke remote object when upgrade to jboss-
by avihaimar
Thanks for the answer.
i spent a lot of time on it.
Just take clean jboss4.2GA, run the ant script which provided by you in order to upgrade to aop2(CR4).
than i try to call to my stateless from a java client and it failed with the attach error.
I am suspecting that there is problem with the client classpath. I use with jbossall-client.jar , which located under jbooss/client ,to connect to the server. is there a chance that need to update it after upgrade aop in server?
please help!!!!!
Client::::
| import java.util.Date;
| import java.util.Properties;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
|
| import com.tikal.ejb3sample.model.Hotel;
| import com.tikal.ejb3sample.service.HotelService;
| import org.apache.log4j.Logger;
|
| /**
| * @author hennebrueder
| *
| */
| public class DemoTester {
| private static Logger logger = Logger.getLogger(DemoTester.class);
|
| /**
| * constants
| */
| private static final String IIOP_NAMING_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory";
| private static final String IIOP_JNDI_FACTORY = "org.jboss.naming:org.jnp.interfaces";
|
| private static String EAR_NAME = "application-1.0/";
| private static String serviceName = "HotelServiceBean";
|
| private Context context;
|
| /**
| * c'tors
| * @throws NamingException
| */
| public DemoTester() throws NamingException {
| context = initContext();
| }
|
| private Context initContext() throws NamingException {
| //init properties
| Properties properties = new Properties();
| properties.put(Context.INITIAL_CONTEXT_FACTORY, IIOP_NAMING_CONTEXT_FACTORY);
| properties.put(Context.URL_PKG_PREFIXES, IIOP_JNDI_FACTORY);
| properties.put(Context.PROVIDER_URL, "127.0.0.1:1099");
| return new InitialContext(properties);
|
| }
|
| /**
| * @param args
| * @throws Exception
| */
| public static void main(String[] args) throws Exception {
|
| String date = "" + new Date(System.currentTimeMillis());
| System.out.println("Test time : " + date);
| DemoTester tester = new DemoTester();
|
| try {
| tester.testSaveHotel();
|
| }
| catch( Exception e ) {
| e.printStackTrace();
| }
|
| }
|
|
| public void testSaveHotel() throws Exception {
| logger.trace("test save hotel");
| HotelService hotelService = (HotelService)context.lookup(EAR_NAME + serviceName + "/remote");
| hotelService.doSomethingFunny();
| }
|
| }
Stateless:
| import java.util.jar.Attributes;
| import java.util.jar.Manifest;
|
| import javax.ejb.EJB;
| import javax.ejb.Local;
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
|
| import com.tikal.ejb3sample.dao.HotelDao;
| import com.tikal.ejb3sample.model.Hotel;
| import com.tikal.ejb3sample.model.Room;
| import com.tikal.ejb3sample.model.TestAop;
| import com.tikal.ejb3sample.service.HotelService;
|
| @Stateless
| @Local(HotelService.class)
| @Remote(HotelService.class)
| public class HotelServiceBean implements HotelService {
|
| @EJB
| private HotelDao hotelDao;
|
| public void doSomethingFunny() {
| System.out.println("yyyyyyyyyy");
| }
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135221#4135221
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135221
18 years, 1 month
[JBoss jBPM] - Re: Problem with changing backend database to mysql
by mputz
First, if you really want to use the datasource as defined in jbpm-ds.xml, you should alter hibernate.cfg.xml to resemble this:
| <!-- DON'T USE DIRECT HIBERNATE CONFIGS, USE DATASOURCE INSTEAD -->
| <!--
| <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
| <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpmbackend</property>
| <property name="hibernate.connection.username">root</property>
| <property name="hibernate.connection.password">password</property>
| -->
| <!-- JDBC connection properties (end) -->
| <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
| <!-- DataSource properties (begin) --> <property name="hibernate.connection.datasource">java:/JbpmDS</property> <!-- DataSource properties (end) -->
Next, do you have users in your database? What does this SQL query return?
SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_='manager'
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135206#4135206
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135206
18 years, 1 month