当前位置: 编程技术>移动开发
本页文章导读:
▪StdSchedulerFactory.getDefaultScheduler() 这个支配器启动报错,求解! StdSchedulerFactory.getDefaultScheduler() 这个调度器启动报错,求解!急
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.quartz.SchedulerException;
/**
* 类说明:定时执行监听.........
▪ Activity缺少无参默认构造方法,产生实例化异常InstantiationException Activity缺少无参默认构造方法,产生实例化错误InstantiationException
Android 2.3.3
Eclipse Version: 3.7.0
LogCat
主要错误:
04-06 11:24:33.126: ERROR/AndroidRuntime(17173): Caused by: java.lang.InstantiationExce.........
▪ 转:兑现类似手机QQ的可折叠固定标题列表 转:实现类似手机QQ的可折叠固定标题列表
http://douzifly.cnblogs.com/
......
[1]StdSchedulerFactory.getDefaultScheduler() 这个支配器启动报错,求解!
来源: 互联网 发布时间: 2014-02-18
StdSchedulerFactory.getDefaultScheduler() 这个调度器启动报错,求解!急
接口任务调度器已终止调度!
2012-4-12 17:03:06 org.apache.catalina.core.StandardContext processTlds
严重: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.spi.LocationInfo.<init>(LocationInfo.java:95)
at org.apache.log4j.spi.LoggingEvent.getLocationInformation(LoggingEvent.java:182)
at org.apache.log4j.helpers.PatternParser$LocationPatternConverter.convert(PatternParser.java:475)
at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:56)
at org.apache.log4j.PatternLayout.format(PatternLayout.java:495)
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:292)
at org.apache.log4j.DailyRollingFileAppender.subAppend(DailyRollingFileAppender.java:349)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
at org.apache.log4j.Category.callAppenders(Category.java:187)
at org.apache.log4j.Category.forcedLog(Category.java:372)
at org.apache.log4j.Category.log(Category.java:864)
at org.apache.commons.logging.impl.Log4JLogger.debug(Log4JLogger.java:110)
at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.java:575)
at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
at org.apache.catalina.core.StandardContext.processTlds(StandardContext.java:4307)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4144)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.quartz.SchedulerException; /** * 类说明:定时执行监听类 * @author huqy */ public class InterfaceSchedulerListener implements ServletContextListener { public void contextInitialized(ServletContextEvent arg0) { try { InvSchedule invschedule = new InvSchedule(); invschedule.loadScheduler(); System.out.println("quartz定时器已启动======================================"); } catch (SchedulerException e) { e.printStackTrace(); } } public void contextDestroyed(ServletContextEvent arg0) { System.out.println("接口任务调度器已终止调度!"); } }
import org.quartz.CronTrigger; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.impl.StdSchedulerFactory; /** * @function 定时执行类 * @author huqy * */ public class InvSchedule{ public final static String JOB_GROUP_NAME = "INV_GROUP_JOB"; public final static String TRIG_GROUP_NAME = "INV_GROUP_TRIG"; public void loadScheduler() throws SchedulerException { Scheduler scheduler = null; try{ scheduler = StdSchedulerFactory.getDefaultScheduler();//这里报错了 错误信息如下 scheduler.start(); //定时开关 ON==开 OFF==关 if(InvConfig.getInstance().getJobswitch("job.switch").equals("ON")){ /** * 用户机构 定时同步 */ JobDetail jobDetail = new JobDetail("INTERFACE_SCHEDULE",JOB_GROUP_NAME,this.getClass().forName("com.nci.inv.webservice.InvUserAndOrgJob")); CronTrigger ct = new CronTrigger("INTERFACE_SCHEDULE1",TRIG_GROUP_NAME,InvConfig.getInstance().getTime("userandorg.time")); scheduler.scheduleJob(jobDetail, ct); } } catch (Exception e){ System.out.println("启动-INTERFACE_SCHEDULE-计划任务失败!"); e.printStackTrace(); } } }
接口任务调度器已终止调度!
2012-4-12 17:03:06 org.apache.catalina.core.StandardContext processTlds
严重: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.spi.LocationInfo.<init>(LocationInfo.java:95)
at org.apache.log4j.spi.LoggingEvent.getLocationInformation(LoggingEvent.java:182)
at org.apache.log4j.helpers.PatternParser$LocationPatternConverter.convert(PatternParser.java:475)
at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:56)
at org.apache.log4j.PatternLayout.format(PatternLayout.java:495)
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:292)
at org.apache.log4j.DailyRollingFileAppender.subAppend(DailyRollingFileAppender.java:349)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
at org.apache.log4j.Category.callAppenders(Category.java:187)
at org.apache.log4j.Category.forcedLog(Category.java:372)
at org.apache.log4j.Category.log(Category.java:864)
at org.apache.commons.logging.impl.Log4JLogger.debug(Log4JLogger.java:110)
at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.java:575)
at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
at org.apache.catalina.core.StandardContext.processTlds(StandardContext.java:4307)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4144)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
[2] Activity缺少无参默认构造方法,产生实例化异常InstantiationException
来源: 互联网 发布时间: 2014-02-18
Activity缺少无参默认构造方法,产生实例化错误InstantiationException
Android 2.3.3 Eclipse Version: 3.7.0 LogCat
主要错误:
04-06 11:24:33.126: ERROR/AndroidRuntime(17173): Caused by: java.lang.InstantiationException: com.tmall.nokia.Iphone 04-06 11:24:33.126: ERROR/AndroidRuntime(17173): at java.lang.Class.newInstanceImpl(Native Method) 04-06 11:24:33.126: ERROR/AndroidRuntime(17173): at java.lang.Class.newInstance(Class.java:1409) 04-06 11:24:33.126: ERROR/AndroidRuntime(17173): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-06 11:24:33.126: ERROR/AndroidRuntime(17173): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 04-06 11:24:33.126: ERROR/AndroidRuntime(17173): ... 11 more
发生错误原因分析:
Iphone 继承自 Activity,启动Iphone 进入正常,后在其中加入构造方法。
public Iphone(Context context) { this.context = context; }
在其它地方实例化Iphone ,
Iphone Iphone = new Iphone(context);
可正常使用。
但在以
Intent integer = new Intent(context, Iphone.class); context.startActivity(integer);
方式启动,进入Activity 时,产生上述InstantiationException实例化错误。
原来,Activity 默认不需构造函数,但在加入有参数的构造方法后,必须同时加入无参数的默认构造方法
解决办法:
Iphone 加入默认构造方法
public Iphone() { }
发布,正常。
[3] 转:兑现类似手机QQ的可折叠固定标题列表
来源: 互联网 发布时间: 2014-02-18
转:实现类似手机QQ的可折叠固定标题列表
http://douzifly.cnblogs.com/
最新技术文章: