michael tall

Ranch Hand
+ Follow
since Nov 02, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by michael tall

I played with descriptor files and server property files and ran the program. Log file entries are given below:
17:48:30,937 INFO [OpenEJB] invoking method create on a1.jar/AccountBean
17:48:31,484 INFO [OpenEJB] finished invoking method create
17:48:37,562 INFO [Transaction] TX Required: Started transaction org.apache.geronimo.transaction.manager.TransactionImpl@1ef330a
17:48:38,062 INFO [Runtime] Starting OpenJPA 1.0.3
17:48:38,062 TRACE [Runtime] Properties: openjpa.DataCacheManager: default
openjpa.BrokerFactory: jdbc
openjpa.EntityManagerFactory: default
openjpa.ConnectionRetainMode: on-demand
openjpa.DataCacheTimeout: -1
openjpa.NontransactionalWrite: true
openjpa.IgnoreChanges: false
openjpa.FetchGroups: default
openjpa.jdbc.SubclassFetchMode: join
openjpa.jdbc.FetchDirection: forward
openjpa.InverseManager: false
openjpa.MaxFetchDepth: -1
openjpa.Compatibility: default
openjpa.ConnectionFactoryMode: local
openjpa.RetryClassRegistration: false
openjpa.jdbc.SynchronizeMappings: buildSchema(SchemaAction='add,deleteTableContents')
openjpa.jdbc.Schemas:
openjpa.AutoClear: datastore
openjpa.FetchBatchSize: -1
openjpa.ProxyManager: default
openjpa.OrphanedKeyAction: log
openjpa.Multithreaded: false
openjpa.SavepointManager: in-mem
openjpa.Optimistic: true
openjpa.jdbc.EagerFetchMode: parallel
openjpa.jdbc.DBDictionary: sqlserver(SupportsDeferredConstraints=false)
openjpa.Log: commons
openjpa.QueryCompilationCache: true
openjpa.jdbc.LRSSize: query
openjpa.ManagedRuntime: auto
openjpa.LockTimeout: -1
openjpa.jdbc.ResultSetType: forward-only
openjpa.MetaDataFactory: jpa(Files=/D:/g/geronimo-tomcat6-javaee5-2.1.3/repository/default/a1.jar/1234353719375/a1.jar-1234353719375.jar/ejb.jar)
openjpa.jdbc.DriverDataSource: simple
openjpa.DataCache: false
openjpa.WriteLockLevel: write
openjpa.RuntimeUnenhancedClasses: supported
openjpa.MetaDataRepository: default
openjpa.jdbc.SchemaFactory: dynamic
openjpa.jdbc.TransactionIsolation: default
openjpa.FlushBeforeQueries: true
openjpa.TransactionMode: managed
openjpa.AutoDetach:
openjpa.ClassResolver: org.apache.openjpa.persistence.PersistenceUnitInfoImpl$ClassResolverImpl
openjpa.jdbc.MappingDefaults: jpa
openjpa.DetachState: loaded
openjpa.RetainState: true
openjpa.DynamicDataStructs: false
openjpa.NontransactionalRead: true
openjpa.jdbc.UpdateManager: operation-order
openjpa.LockManager: version
openjpa.ReadLockLevel: read
openjpa.Id: bnk
openjpa.QueryCache: true
openjpa.jdbc.SQLFactory: default
openjpa.BrokerImpl: non-finalizing
openjpa.Sequence: table(Table=OPENJPASEQ, Increment=100)
openjpa.RestoreState: immutable
17:48:42,218 TRACE [MetaData] Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@1e86b36".
17:48:46,015 INFO [JDBC] Using dictionary class "org.apache.openjpa.jdbc.sql.SQLServerDictionary".
17:49:07,625 INFO [Transaction] TX Required: setRollbackOnly() on transaction org.apache.geronimo.transaction.manager.TransactionImpl@1ef330a
17:49:07,625 INFO [Transaction] TX Required: Rolling back transaction org.apache.geronimo.transaction.manager.TransactionImpl@1ef330a
I enclosed persist() ni try ... catch block and ran the program. Application server log entries are given below:
17:22:11,140 INFO [OpenEJB] invoking method create on a1/AccountBean
17:22:11,296 INFO [OpenEJB] finished invoking method create
17:22:14,296 INFO [Transaction] TX Required: Started transaction org.apache.geronimo.transaction.manager.TransactionImpl@12fe3f3
17:22:14,390 INFO [Runtime] Starting OpenJPA 1.0.3
17:22:14,812 INFO [Transaction] TX Required: Committing transaction org.apache.geronimo.transaction.manager.TransactionImpl@12fe3f3
I have located dra_log file (dr beingn the name of the database) in MSSQL\Data folder. I opened it in notepad but was unable to read it.
18:42:17,776 INFO [OpenEJB] invoking method create on a1/AccountBean
18:42:17,776 INFO [OpenEJB] finished invoking method create
18:42:20,683 INFO [Transaction] TX Required: Started transaction org.apache.geronimo.transaction.manager.TransactionImpl@45297e
18:42:20,683 INFO [Transaction] TX Required: setRollbackOnly() on transaction org.apache.geronimo.transaction.manager.TransactionImpl@45297e
18:42:20,683 INFO [Transaction] TX Required: Rolling back transaction org.apache.geronimo.transaction.manager.TransactionImpl@45297e
I tried to redirect the output using the command:
java BankClient > exception.txt
but it created 0-sized file. Any ideas?
javax.ejb.EJBException: Unknown Container Exception: java.rmi.RemoteException: Cannot read the response from the server. The class for an object being returned is not located in this exception:; nested exception is: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.ArgumentException...........
I searched for log4j files but none of them have been modified recently.
I am not using sql. I am using annotations and setting the field values and then calling the persist() method of EntityManager object. Code is given here:
<code>
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.*;
@Entity
public class AccountNtt implements Serializable {
@Id
public String accountNumber;
public String accountType;
public String ownerName;
public int balance;
public AccountNtt() {
}
}
</code>
Table is
<code>USE [dra]
GO
/****** Object: Table [dbo].[AccountNtt] Script Date: 02/08/2009 16:52:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AccountNtt](
[accountNumber] [varchar](20) NOT NULL,
[accountType] [varchar](20) NULL,
[ownerName] [varchar](20) NULL,
[balance] [int] NULL,
CONSTRAINT [PK_AccountNtt] PRIMARY KEY CLUSTERED
(
[accountNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF</code>
Business interface is
<code>import javax.ejb.Remote;
import java.util.*;
@Remote
public interface Account {
void createAccountNtt(AccountNtt a);
}</code>
Bean is
<code>import java.util.List;
import javax.ejb.Stateless;
import javax.ejb.Remote;
import javax.persistence.PersistenceContext;
import javax.persistence.EntityManager;
import javax.persistence.Query;
@Stateless
@Remote(Account.class)
public class AccountBean implements Account {
@PersistenceContext(unitName="bnk")
EntityManager manager;
public void createAccountNtt(AccountNtt a) {
manager.persist(a);
}
}</code>
Client code is
<code>
import javax.naming.Context;
import javax.naming.InitialContext;
import java.io.*;
import java.util.Properties;
import java.util.*;
import javax.ejb.EJBException;
public class BankClient {
public static void main(String[] args) {
try {
AccountNtt a10 = new AccountNtt();
a10.accountNumber = "3833";
a10.accountType = "savings";
a10.ownerName = "bailey";
a10.balance = 2524;
Properties p = new Properties();
p.load(new FileInputStream("jndi.properties"));
p.put("openejb.authentication.realmName","geronimo-admin");
InitialContext ctx = new InitialContext(p);
Account a = (Account) ctx.lookup("AccountBeanRemote");
a.createAccountNtt(a10);
}
catch(Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}</code>
I ran a standalone client from a different JVM. Right now I don't have the exact stack trace because it happened sometime back. Then I checked with application server logs (application server is on another JVM). Log entries are:<code>15:01:32,500 INFO [OpenEJB] invoking method create on a1/AccountBean
15:01:33,218 INFO [OpenEJB] finished invoking method create
15:01:37,703 INFO [Transaction] TX Required: Started transaction org.apache.geronimo.transaction.manager.TransactionImpl@115e9a8
15:01:38,250 INFO [Runtime] Starting OpenJPA 1.0.3
15:01:38,640 INFO [Transaction] TX Required: setRollbackOnly() on transaction org.apache.geronimo.transaction.manager.TransactionImpl@115e9a8
15:01:38,656 INFO [Transaction] TX Required: Rolling back transaction org.apache.geronimo.transaction.manager.TransactionImpl@115e9a8
</code>.
I wanted to know how I could check SQL server 2005 express logs.
I have an entity that inserts few records in a table. This is throwing exception at the time of execution. Is there a way I can lookup more detailed information in SQL Server logs and figure out why the transactions are not succeeding? I know this is a database question and probably not posted in the right forum. But in case anyone knows...
How to identify what business interfaces and enterprise beans will be required for an application? This is not about coding them but just to make a list of different pieces of code that will be required for an application? ny guidelines?
How to identify what business interfaces and enterprise beans will be required for an application? This is not about coding them but just to make a list of different pieces of code that will be required for an application?
15 years ago
I just downloaded Apache Geronimo 2.1.3 on Windows XP and successfully tested with a JSP.
Next I have an example business interface and enterprise bean already coded and ready to be compiled. I saw the documentation but still unable to figure out how to compile the ejb interface and class files.
15 years ago
I have JSE6 installed. Trying very basic RMI with an interface, a server class and a client class. What are the steps to execute?
15 years ago
I coded an interface, a server program and a client program (all very simple) and compiled them. All 3 .class files are in same folder. After starting server program, I wanted to execute client program on a remote machine. I removed classpath and started rmiregistry. When I executed the server program, it threw exceptions but didn't abort. Exception reads: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: Echo ... etc
Code is
What may be causing exception?
15 years ago
Thank you. You are 100 per cent correct. I created a new database user and granted all required permissions. Same code worked without any problems.