Showing posts with label WebLogic. Show all posts
Showing posts with label WebLogic. Show all posts

Monday, 14 August 2017

javax.naming.OperationNotSupportedException: bind not allowed in a ReadOnlyContext; remaining name ~ foundjava

I got this exception when i tried to define a mail session in WebLogic’s console. I defined the JNDI name to be java:/Mail but it seems that WebLogic does not like the java:/ prefix, so I had to remove it (both from the console and the calling code), and it worked.
Read More »

Caused by javax.persistence.TransactionRequiredException with message: “no transaction is in progress” ~ foundjava

This is weird, I am not sure why I am getting it. I have an application that makes some calculations that take some considerable time, and I persist the results. I run my application with 100 records from the database and everything works fine. I run my application with 60.000 records from the database and I am getting the above error message. The exception happens when the flush() method is called on the EntityManager. If I am to have a wild guess I’d say that there is a transaction time out (it is set to 30 seconds in the weblogic console) and therefore when the flush() method is called there is no active transaction.
Anyway I managed to overcome this issue by explicitly defining a user transaction
1
2
3
4
5
6
7
8
9
10
import org.jboss.seam.transaction.Transaction;
import org.jboss.seam.transaction.UserTransaction;
...
...
 
UserTransaction ut = Transaction.instance();
ut.begin();
...
...
ut.commit();
If you have any idea why this is happening please leave a comment.
UPDATE: Now the first transaction (the one with 100 records) fails. It complains that there is already one transaction active when I try to start a new one. I guess I need to revert my code and to increase the transaction timeout on the weblogic console, this would solve both issues.
Read More »

java.lang.OutOfMemoryError: getNewTla ~ foundjava

This is an error I was getting while trying to load a huge excel file with WebLogic. It seems that the TLA (Thread Local Area) was running out of memory. The TLA is the space reserved on the heap for use exclusively by a thread. Running out of memory means that there is no more space to use in the heap. Having said this, the solution is to increase the available heap space (with Xmx) and not just to fiddle around with the XXtlaSize switch.
Read More »

Sunday, 13 August 2017

java.lang.ArrayIndexOutOfBoundsException with EmbeddedLDAP ~ foundjava

If you forcefully stop the Weblogic Admin Server you might end up with corrupted LDAP files, and your admin server won’t start up with the following exception
1
2
3
4
5
6
####<Dec 7, 2013 2:45:18 AM BST> <Critical> EmbeddedLDAP <AdminServer> <VDE Replication Thread> <<anonymous>> <> <BEA-000000> <java.lang.ArrayIndexOutOfBoundsException
     at com.octetstring.vde.EntryChanges.readBytes(EntryChanges.java:279)
     at com.octetstring.vde.EntryChanges.<init>(EntryChanges.java:72)
     at com.octetstring.vde.replication.BackendChangeLog.getChange(BackendChangeLog.java:548)
     at com.octetstring.vde.replication.Replicator.run(Replicator.java:180)
     at com.octetstring.vde.replication.Replication.run(Replication.java:339)
Before you do anything make sure that you have a copy or you know all the groups and users you have created in your domain.
The solution on Weblogic 7.x was to delete the EmbeddedLDAP.tran file. But with later Weblogic versions this might not work. Another solution is to backup and delete the servers/<admin server>/data/ldap folder. If this still does not work then backup and delete the servers/<admin server>/data folder. This will fix it but once the Admin server is up and running make sure that all the groups and users are still there. If not you will have to recreate all of them manually from the console.
Read More »