Labels

Tuesday, October 21, 2014

java.sql.SQLException: ORA-04063: view

java.sql.SQLException: ORA-04063: view "XXXXX

 oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
 oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
 oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
 oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
 oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
 oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
 oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
 oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
 oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
 oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
 org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
 org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:648)
 org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:641)
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
 org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:112)
 org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:122)
 

Solution:- If it is not finding related view we will get this error.To fix issue we need to create related view.


Monday, October 20, 2014

PreparedStatementCallback; bad SQL grammar nested exception is java.sql.SQLException: ORA-00980

ERROR [com..AN010Action] - PreparedStatementCallback; bad SQL grammar [ SELECT ? ]; nested exception is java.sql.SQLException: ORA-00980: シノニム変換が無効です。

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar nested exception is java.sql.SQLException: ORA-00980: シノニム変換が無効です。

at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:111)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:641)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:670)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:678)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:710)
at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.query(SimpleJdbcTemplate.java:187)
at com.gehc.ohr.common.dao.BaseDao.queryList(BaseDao.java:20)
at com.gehc.ohr.common.dao.impl.LoginSearchDaoImpl.searchUserInfo(LoginSearchDaoImpl.java:41)
at com.gehc.ohr.common.service.impl.LoginServiceImpl.getUserInfo(LoginServiceImpl.java:30)
at com.gehc.ohr.common.action.BaseAction.getUserSession(BaseAction.java:258)
at com.gehc.ohr.common.action.BaseAction.baseExecute(BaseAction.java:188)
at com.gehc.ohr.common.action.BaseAction.execute(BaseAction.java:133)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableReque



Solution:- If it is not finding related view we will get this error.To fix issue we need to create related view.

Friday, September 12, 2014

java.lang.NoClassDefFoundError: com/teradata/jdbc/jdbc_4/ifsupport/LocalEscapeFunctions

<Sep 12, 2014 6:28:17 AM UTC> <Error> <HTTP> <BEA-101017> <[ServletContext@1839328839[app:xxxx module:xxx path:/xxx  spec-version:2.5]] Root cause of ServletException.
java.lang.NoClassDefFoundError: com/teradata/jdbc/jdbc_4/ifsupport/LocalEscapeFunctions
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
       at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
       Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: com.teradata.jdbc.jdbc_4.ifsupport.LocalEscapeFunctions
       at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
       at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
       at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
       Truncated. see log file for complete stacktrace




Solution:- 


we need to set  WEBLOGIC_CLASSPATH in commEnv.sh file.


Example:- 

WEBLOGIC_CLASSPATH="${JAVA_HOME}/lib/tools.jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic_sp.jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic.jar${CLASSPATHSEP}${FEATURES_DIR}/weblogic.server.modules_10.3.5.0.jar${CLASSPATHSEP}${WL_HOME}/server/lib/webservices.jar${CLASSPATHSEP}${ANT_HOME}/lib/ant-all.jar${CLASSPATHSEP}${ANT_CONTRIB}/lib/ant-contrib.jar${CLASSPATHSEP}${WL_HOME}/server/lib/tdgssconfig.jar${CLASSPATHSEP}${WL_HOME}/server/lib/terajdbc4.jar"

export WEBLOGIC_CLASSPATH

after adding class path like above restart server.




Wednesday, September 10, 2014

[org.hibernate.util.DTDEntityResolver] recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

Solution:-


<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

Please change above one to like below one in hibernate.cfg.xml file 


<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

[org.hibernate.dialect.Oracle9Dialect] The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect instead


Solution:-
Please change in hibernate.cfg.xml file from

<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>


to <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>

Thursday, August 7, 2014

Jboss apache integration

Apache JBOSS integration



1) Download mod_jk module from
http://www.gtlib.gatech.edu/pub/apache/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/i586/

2) Copy mod_jk-1.2.28-httpd-2.2.X.so to /opt/apacheconf

3) Edit the httpd.conf and add the following line
Include /opt/apacheconf/mod-jk.conf

4) Create /opt/apacheconf/mod-jk.conf file with the following content
LoadModule jk_module /opt/apacheconf/mod_jk-1.2.28-httpd-2.2.X.so
JkWorkersFile /opt/apacheconf/workers.properties
JkLogFile /opt/apachelogs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
JkRequestLogFormat "%w %V %T"

JkMountFile /opt/apacheconf/uriworkermap.properties
JkShmFile /opt/apachelogs/jk.shm

<Location /jkstatus>
JkMount status
#Order deny,allow
#Deny from all
#Allow from 127.0.0.1
</Location>

5) Create /opt/apacheconf/uriworkermap.properties file with the following content
# Simple worker configuration file
# Mount the Servlet context to the ajp13 worker
/jmx-console=loadbalancer
/jmx-console/*=loadbalancer
/web-console=loadbalancer
/web-console/*=loadbalancer
/testWeb/*=loadbalancer
!/testWeb/images/*=loadbalancer

6) Create /opt/apacheconf/workers.properties file with the following content
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host={jboss-server-ip-address goes here}
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.prepost_timeout=10000 #Not required if using ping_mode=A
worker.node1.connect_timeout=10000 #Not required if using ping_mode=A
worker.node1.ping_mode=A #As of mod_jk 1.2.27
# worker.node1.connection_pool_size=10 (1)

# Define Node2
# modify the host as your host IP or DNS name.
#worker.node2.port=8009
#worker.node2.host= node2.mydomain.com
#worker.node2.type=ajp13
#worker.node2.lbfactor=1
#worker.node2.prepost_timeout=10000 #Not required if using ping_mode=A
#worker.node2.connect_timeout=10000 #Not required if using ping_mode=A
#worker.node2.ping_mode=A #As of mod_jk 1.2.27
# worker.node1.connection_pool_size=10 (1)

# Load-balancing behaviour
worker.loadbalancer.type=lb
#worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.balance_workers=node1

# Status worker for managing load balancer
worker.status.type=status

The above configuration is to test with one app server functionally.

7) Update /opt/apacheconf/httpd-vhosts.conf with JkMount
Listen 9080
NameVirtualHost *
<VirtualHost *>
ServerName {server-name}
ServerAlias {alias}
JkMount /testWeb loadbalancer
JkMount /testWeb/* loadbalancer
</VirtualHost>

8) Update the following line to include jvmRoute in /opt/jboss-eap-5.0/jboss-as/server/default/deploy/jbossweb.sar/server.xml

<Engine name="jboss.web" defaultHost="localhost" jvmRoute="domain-name-goes-here">

9) Restart Apache and JBOSS server

10) Test the web server URL http://{domain-name}/testWeb/test.jsp


Apache 2.2.14 installation on RHEL 5 (statically linked Apache binary)

Apache 2.2.14 installation on RHEL 5 (statically linked Apache binary)


Benefit of a statically built Apache server is that at compile time users have to examine all modules needed. This insures the smallest memory footprint for the Apache binary, and can also result in a more secure server by limiting exposure to loaded modules. Once you build and run your Apache binary, you will know exactly the memory footprint of each child or
worker

1) Create user
#useradd -m apacheadm
#passwd apacheadm

2) Login as apacheadm

3) Download httpd-2.2.14.tar.gz source distribution to /opt/software

4) Prepare for install

chmod 755 httpd-2.2.14.tar.gz
gunzip httpd-2.2.14.tar.gz
tar -xvf httpd-2.2.14.tar
rm httpd-2.2.14.tar
cd httpd-2.2.14
./configure --prefix=/opt/apache --enable-headers --enable-proxy --enable-rewrite --with-included-apr
make

Optional:

i) To include modules of your choice: ./configure --prefix=/opt/apache --with-included-apr --enable-ssl --enable-module=proxy
ii) Compile Apache for dynamic loading: ./configure --prefix=/opt/apache --enable-so

5) Install Apache
make install

References:
Apache website
F5 LTM deployment guide for Apache