Interface Page Broken in 1.8 Testing
Description
Environment
Acceptance / Success Criteria
Lucidchart Diagrams
Activity

Seth Leger February 27, 2011 at 9:22 PM
If you need to search for changes like this, just check out the source, then run a 'git log 1.8' and search (using '/') for the bug number, you should get a hit in the commit log message (if we're following our best practices and documenting the bug number). Then you can run 'git show -v [hash]' with the commit hash to see the actual code changes.
commit 8ce5b289e7b63c1ac6a53195d16e476df7cf59e3
Author: Seth Leger <seth@opennms.org>
Date: Fri Dec 31 18:36:03 2010 -0500
Simplified one function to fix problems surrounding bug https://opennms.atlassian.net/browse/NMS-4323#icft=NMS-4323.
diff --git a/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java b/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
index 278c5e9..ca2df1c 100644
— a/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
+++ b/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
@@ -1272,24 +1272,10 @@ public class NetworkElementFactory implements InitializingBean, NetworkElementFa
}
/* (non-Javadoc)
* @see org.opennms.web.element.NetworkElementFactoryInterfac#getAtInterface(int, java.lang.String)
*/
+ * @see org.opennms.web.element.NetworkElementFactoryInterface#getAtInterface(int, java.lang.String)
+ */
public AtInterface getAtInterface(int nodeId, String ipAddr) {OnmsCriteria criteria = new OnmsCriteria(OnmsNode.class);
criteria.createAlias("node", "node");
criteria.add(Restrictions.eq("node.id", nodeId));
criteria.add(Restrictions.eq("ipAddress", ipAddr));
criteria.add(Restrictions.ne("status", StatusType.DELETED));
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
-final List<OnmsNode> nodes = m_nodeDao.findMatching(criteria);
if (nodes.size() > 1) {
LogUtils.warnf(this, "More than 1 node returned! Using the first one, but this could be wrong...");
} else if (nodes.size() == 0) {
LogUtils.debugf(this, "No nodes matched for nodeId = %d, IP Address = %s", nodeId, ipAddr);
return null;
}
final OnmsNode node = nodes.get(0);
+ OnmsNode node = m_nodeDao.get(nodeId);
return getAtInterfaceForOnmsNode(node, ipAddr);
}

Joshua Summers February 26, 2011 at 10:46 PM
Seth,
Can you list the fix for this? I am getting this exact same error in 1.8.8-SNAPSHOT and I was hoping to merge your changes to resolve this rather then sift through the latest versions for the fix

Seth Leger January 18, 2011 at 3:37 PM
I've add some unit test data to DatabasePopulator for the atinterfaces table. Marking issue as fixed.

Seth Leger December 31, 2010 at 6:38 PM
I pushed a fix for this crash; I'll wait to resolve the bug until I push some simple unit tests in place for this function.

Seth Leger December 31, 2010 at 3:02 PM
This fix is breaking things. The Hibernate statements in this method are not correct, there are no 'node' or 'ipaddress' properties of the OnmsNode object. I think that the class was supposed to use OnmsArpInterface as it originally did but maybe Donald's changes when he ported the class from JDBC to Hibernate weren't quite right. Here is the exception that I get now:
2010-12-31 14:55:35,856 ERROR [32724103@qtp-1002899-98] log: Nested in org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: node of: org.opennms.netmgt.model.OnmsNode; nested exception is org.hibernate.QueryException: could not resolve property: node of: org.opennms.netmgt.model.OnmsNode:
org.hibernate.QueryException: could not resolve property: node of: org.opennms.netmgt.model.OnmsNode
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:67)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:61)
at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1385)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getPathEntityName(CriteriaQueryTranslator.java:227)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.createCriteriaEntityNameMap(CriteriaQueryTranslator.java:214)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.<init>(CriteriaQueryTranslator.java:104)
at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:82)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1577)
at sun.reflect.GeneratedMethodAccessor428.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1282)
at $Proxy76.list(Unknown Source)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate$5.doInHibernate(AbstractDaoHibernate.java:329)
at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate$5.doInHibernate(AbstractDaoHibernate.java:317)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate.findMatching(AbstractDaoHibernate.java:334)
at org.opennms.web.element.NetworkElementFactory.getAtInterface(NetworkElementFactory.java:1286)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...
Details
Assignee
Seth LegerSeth LegerReporter
Tarus BalogTarus BalogComponents
Affects versions
Priority
Major
Details
Details
Assignee

Reporter

Components
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

Clicking on a node page and then an interface results in an error (bad Seth).
java.lang.ClassCastException: org.opennms.netmgt.model.OnmsArpInterface cannot be cast to org.opennms.netmgt.model.OnmsNode
at org.opennms.web.element.NetworkElementFactory.getAtInterface(NetworkElementFactory.java:1292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy75.getAtInterface(Unknown Source)
at org.apache.jsp.element.interface_jsp._jspService(org.apache.jsp.element.interface_jsp:407)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at org.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExportFilter.java:49)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.opennms.web.AddRefreshHeaderFilter.doFilter(AddRefreshHeaderFilter.java:79)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.opennms.web.StoreRequestPropertiesFilter.doFilter(StoreRequestPropertiesFilter.java:80)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
at org.opennms.web.springframework.security.AuthFilterEnabler.doFilterHttp(AuthFilterEnabler.java:110)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)