PiJava

November 4, 2010

ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []

Filed under: Oracle — pijava @ 7:04 am

Solution :
Analyze table and index by using these scripts

analyze [table] validate structure cascade;

analyze [index] validate structure;

if the analyze had failed drop index or table and recreate them.

December 4, 2009

java.lang.LinkageError: Class javax/xml/namespace/QName violates loader constraints: definition mismatch between parent and child loaders

Filed under: java, problems — Tags: , — pijava @ 9:58 am

Reason:
QName.class exists in both j2ee.jar and some jar that was added to the project. A definition mismatch occurs when classloader load these QName classes.

Solution:
Remove QName.class file from the jars that you add to the project. (ie. stax-api-1.0.1.jar, xml-apis-1.3.04.jar)

Spring Webservice Soap Request/Response Logging with log4j

Filed under: java, spring — Tags: , , , , — pijava @ 9:09 am

Add following lines to log4j.xml

<appender
  name="SPRINGLOGFILE"
  class="org.apache.log4j.RollingFileAppender">
  <param
    name="File"
    value="logs/spring.log" />
  <param
    name="Append"
    value="true" />
  <param
    name="MaxFileSize"
    value="1MB" />
  <param
    name="MaxBackupIndex"
    value="5" />
  <layout class="org.apache.log4j.PatternLayout">
    <param
      name="ConversionPattern"
      value="%d %-5p %c{2} - %m%n" />
  </layout>
</appender>



<logger name="org.springframework.ws">
  <priority value="DEBUG" />
  <appender-ref ref="SPRINGLOGFILE" />
</logger>

May 4, 2009

Javascript Email Validation (Regular Expression)

Filed under: JavaScript — Tags: , , — pijava @ 2:20 pm
function isValidEmail(email)
{
  var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

  if(!filter.test(email))
    return false;
  return true;
}

Using jQuery with RichFaces

Filed under: jQuery, RichFaces — Tags: , — pijava @ 12:35 pm

RichFaces includes jQuery JavaScript framework. You can use the futures of jQuery directly without defining the component on a page if it is convenient for you. To start using the jQuery feature on the page, include the library into a page with the following code:

<a4j:loadScript src="resource://jquery.js"/>

In order to test jQuery on your page

Add the following to the <body>:

 <a href="">Link</a>

Add the following to the page:

<script type="text/javascript">
  jQuery(document).ready(function() {
    jQuery("a").click(function() {
      alert("Hello world!");
     });
  });
</script>
  • Remember to use jQuery() function instead of $()

then just click the “Link”

WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.

Filed under: java, problems — Tags: , — pijava @ 10:33 am

Solution:

1. download activation.jar http://java.sun.com/javase/technologies/desktop/javabeans/jaf/downloads/index.html

2. download mail.jar http://java.sun.com/products/javamail/downloads/index.html

3. add these two jar’s to the project

April 30, 2009

Changing port number in JBoss

Filed under: JBoss — Tags: , , , , — pijava @ 2:29 pm

JBoss Version : 4.2.0.GA

JBoss is running on port number 8080 as default. If you want to change the port number of your JBoss (jBoss 4)

1. Open JBoss Home/server/default/deploy/jboss-web.deployer folder
*if JBoss is running under “minimal” or “all” mode, open JBoss Home/server/mode/deploy/jboss-web.deployer

2. Open server.xml file in this folder

3. FindĀ  <Connector port=”8080″ address=… tag

4. Change 8080 port, with any port you want to use
* ie. <Connector port=”8081″ address=…

5. Restart JBoss


Adding users and roles to Tomcat

Filed under: Tomcat — Tags: , , , , — pijava @ 12:57 pm

Apache Tomcat Version : 6.0.18

Open the tomcat-users.xml, located in your Tomcat Home/conf folder.

To add a role :

<role rolename="myRole"/>

To add a user :

<user username="myUsername" password="myPassword" roles="myRole"/>

To asign multiple roles to a user :

<user username="myUsername" password="myPassword" roles="myRole1,myRole2,myRole3"/>

tomcat-users.xml

<?xml version="1.0" encoding="utf-8"?>
<tomcat-users>
<role rolename="manager"/>
<user username="admin" password="admin" roles="manager"/>
</tomcat-users>

Create a free website or blog at WordPress.com.