Mantis – Linking to attachments
Been wondering if it’s possible to refer to attachments in Mantis Bug Tracker from the description or additional information like it’s possible to link or refer to issues and comments. If anyone knows the solution, please reply to this
I’ll be posting the solution if I find one or if there even is one.
Caused by: java.net.ConnectException: Connection refused: connect
Your JBoss probably isn’t on is it
? It’s also likely to be Monday and your vacation is probably over, so my condolences.
An internal error occurred during: “Generating Artifacts”. Foreign key name mapped to different tables! previous: org.hibernate.mapping.Table current:org.hibernate.mapping.Table
Literally means that you need to rename your duplicate foreign keys to have unique names.
JPA show SQL query
If you need to show SQL in JBoss debug screen (console) from your JPA / EJB project:
<properties>
<property name= “hibernate.dialect”value=”org.hibernate.dialect.PostgreSQLDialect” />
<property name= “hibernate.show_sql” value=”true” />
</properties>
in persistence.xml should do the trick.
Unable to load tag handler class “tags.templates.InsertTag” for tag “template:insert”
Edited:
Well solved this one.. I was missing the InsertTag.class from WEB-INF/classes/tags. Don’t know how that went missing
Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”
Well this is what bugs macgyvered is all about: ugly hacks
so here goes.
I’ve been battling with an error in my Java Web Project for a few hours and got it solved now. IDE: MyEclipse 8.0M2
Problem (error):
Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”
Solution:
After surfing through several different solutions from adding jstl.jar to class path and lib folder etc etc. I found the following to work for me:
Mr. Nick Potter down at Coderanch said the following:
“Eclipse has a strange bug (?) when it comes to JSTL. It doesn’t find the c.tld from the jstl jar (for JSTL 2.0 and on, i believe). So extract the c.tld from the jstl.jar and put it somewhere in the WEB-INF, for example in WEB-INF/tlds. The use this uri for @taglib in your jsps. You shouldn’t have any problems. “
For this to work I had to edit my taglib line in the jsp file to like this since I added the c.tld file to WEB-INF/tlds/
<%@ taglib uri=”WEB-INF/tlds/c.tld” prefix=”c”%>
Works perfectly now! Hopefully this was helpful to you too, if not please leave a comment and maybe I can help you out.
PostgreSQL / JPA / EJB sequence ID jumping
If you encounter a problem where you generate a new primary key value through a persisted JPA entity and it seems to change to a larger value than it’s suppose to. E.g. you add a new row of data to a table that has a primary key field called “id” and there’s only one value currently in that table which contains the “id” value 0 (zero). And yet the next value you add to the table through EJB / JPA jumps to a greatly larger value like 5000. SO to the chase. How to fix this problem:
Make sure you’re mapped @Id field is as follows:
@Id
@GeneratedValue( strategy=GenerationType.SEQUENCE, generator=”generatorName” ) // name of the generator
@SequenceGenerator( name=”generatorName”, sequenceName=”nameOfTheSequenceInYourDatabase”, allocationSize=1) // name of the sequence in the db
@Column (name=”id”) // name of the column in the db
private Integer id;
The most important part of that being: “allocationSize=1″ this prevents the hibernate layer from trying to optimize this process so that when creating a new entry the server doesn’t have to go to the database to get this value. To quote my guru colleague: “This kind of optimization provides only marginal benefit.”
Exception in thread “main” java.lang.NullPointerException at test.WSTest.main(WSTest.java:46)
If you’re an idiot like me, try checking whether your method returns ‘null’ or not.
Initializing Java tooling 1%
MyEclipse 8.0 M2 was barely breathing after I got SVN plugin (Subclipse) finally installed to it (which in itself was one bitch of an operation btw had to use Pulse for this) aaanyway so if your Eclipse takes a long time to (basically it doesn’t go anywhere from 1%, atleast not in the 20 minutes I waited) start your MyEclipse from command line here’s how: windows button + r, then type in cmd and then go to the eclipse folder and type myeclipse.exe -clean