SSH框架中@Service 调用问题,急求大神解答!

我手头有个ssh项目框架,通过jsp页面操作,到Action中依次调用Service、Dao等方法进行操作。我现在需要在其他类中调用该Action中的Service的方法。先看图:这是某个Action中有个sdkDeployService,使用了@Resource注入。下面是Action内容:

这个是Action内容

这个是Service:

图片说明

这个是ServiceImpl:

图片说明

我在其他地方这样写的:

@Autowired
private SdkDeployService sdkDeployService;

sdkDeployService.deploy();

结果显示:在sdkDeployService.deploy() 这里java.lang.NullPointerException.报空指针。求大神告诉,ssh里如何获得并调用service里的方法。急求,万分感谢!!

0

4个回答

在springmvc-servlet.xml中表示自动扫描注解,或者ServiceImpl里改成这个@Services
("SdkDeployService")

0
sinat_32688815
岁末的风 这个框架里没有这个xml文件存在。而且我找了好久,没有发现有任何bean或什么对它写入
3 年多之前 回复

struts框架,需要对应的set,get方法,你这样注解没有将service注入进去,再加个set,get方法试试。

0
sinat_32688815
岁末的风 回复wenxuechaozhe: 我这边没有spring.xml这个配置文件。然后我发现是因为普通类无法调用service层。还有:在spring里配置是如何写的?
3 年多之前 回复
wenxuechaozhe
wenxuechaozhe 回复岁末的风: 你要是想要完全使用注解方式进行声明service层,你应该在你的spring配置文件中进行扫描,去查找所对应的service层。
3 年多之前 回复
wenxuechaozhe
wenxuechaozhe 别用自动注入,换成@Resource
3 年多之前 回复
sinat_32688815
岁末的风 哥,还是不行。加上get,set了还是那个地方报空指针异常
3 年多之前 回复

如果是使用ssh框架的话,使用Service注解,需要的在application配置文件对接口实例化对象进行注解的。
比如我的配置文件:

0
 <bean id="appImpl" class="org.csun.ns.biz.NtAppBiz" />
0
sinat_32688815
岁末的风 回复一枪尽骚丶魂: 我找到原因了,不是我代码问题。是web.xml里面配置问题。谢谢了
3 年多之前 回复
u012377333
一枪尽骚丶魂 ,如果没有在application配置,就会出现appImpl是空指针的情况
3 年多之前 回复
u012377333
一枪尽骚丶魂 回复岁末的风: 我在项目里面就是@Autowired private NtAppImpl appImpl; // 注解实例化的对象
3 年多之前 回复
sinat_32688815
岁末的风 我看了下项目,Service它是自动注入的方式,,我在一个普通类内调用它的方法,我需要做什么操作??
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ssh问题求大神解答
[color=#800000]在学习ssh架构的时候遇到下面问题:rn这是web.xml文件[/color]rnrnrn rn struts2rn rn org.apache.struts2.dispatcher.FilterDispatcherrn rn rn rn struts2rn *.actionrn rn rn struts2 rn *.jsp rn rn rn struts-cleanup rn org.apache.struts2.views.jsp.ui.AnchorTagrn rn rn rn struts-cleanuprn /*rn rn rn index.jsprn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rnrnrnrn[b]rn这是index.jsp文件[/b][color=#800000][/color]rn<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rn<%@ taglib prefix="s" uri="/struts-tags" %>rnrnrn rn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rn rn rn Operate Listrn [color=#FF0000]Save User rn List Users[/color]rn rnrn[color=#FF0000]标签前面有小感叹号rn运行的时候出现404错误[/color]rnrnrnrn但是刚刚搭建好的ssh架构,运行index.jsp是没有任何问题的,准备加点代码,结果就成了这样,求大神解答!!!万分感激
大神、求解答。。!!急急急、
[img=https://img-bbs.csdn.net/upload/201404/08/1396949936_660665.jpg][/img]rnrn这大概是什么情况??
小菜急求大神解答
情况是这样的,有很多个数据库 都是日库 月库命令规则也是根据时间来的 。日月库里面都有同一张表,现在要统计这张表的记录的总数。求大神
急问!!求大神解答!!
附上代码:rnsuccessBtn.setOnClickListener(new View.OnClickListener() rn @Overridern public void onClick(View v) rn checkEmailIsUse(inputUserEmailEt);//此处是进行网络请求,获得返回数据rnrn Log.d(TAG, "onClick: "+emailCanuse);rnrn switch (status)rn case 200:rn if(!emailCanuse)rn showDialog();rn rn else rn Toast.makeText(getContext(),"账号不存在,请重新确认!",Toast.LENGTH_SHORT).show();rn rn break;rnrn rnrn rn );rn我想进行的操作是,利用网络请求获取的值,判断其是否符合条件,再进行弹框操作,但是问题是第一次点击没有反应而且emailCanuse的值为初始化的值且打印不了,第二次点击才有反应和正确赋值和调用里面的dialogrn网络请求方面利用Gson解析返回的json数据:rn CheckEmail ce = new CheckEmail();rn Gson gson = new Gson();rn ce = gson.fromJson(resData,CheckEmail.class);rn status = ce.getStatus();rn emailCanuse = ce.getData();rn 在这里获取到的值打印出来是正确的。rn rn rn 到底是什么原因啊?!!!求解答啊!!rn rn rn```rn rn```rnrnrn```rn rn```rnrn
问题求大神解答
求大神解答,还在加班
急求解答ssh问题(多对多)
Configuration cfg = new Configuration().configure();rnSession session = cfg.buildSessionFactory().openSession();rnQuery query = session.createQuery("from SysUser s where s.userName='admin'");rn此方法可以得到SysUser方的数据和关联的另一方数据rn当在ssh下 List list=(List)getHibernateTemplate().find(" from SysUser where userName='amdin'");rn只能得到SysUser的数据但是得不到关联的另一方的数据rn配置文件如下SysUser:rnrnrn rnrnrnrnrn rn @hibernate.classrn table="sys_user"rn rn truernrn rn rn @hibernate.idrn generator-class="native"rn type="java.lang.Integer"rn column="id"rnrn rn truern rn rnrn rn truern truern rn @hibernate.propertyrn column="user_name"rn unique="true"rn length="20"rn not-null="true"rn rn rn rn truern truern rn @hibernate.propertyrn column="real_name"rn length="20"rn not-null="true"rn rn rn rn truern truern rn @hibernate.propertyrn column="phone"rn length="20"rn not-null="true"rn rn rn rn rn truern truern rn @hibernate.propertyrn column="password"rn length="64"rn not-null="true"rn rn rn rn truern truern rn @hibernate.propertyrn column="sex"rn length="10"rn rn rn rn truern truern rn @hibernate.propertyrn column="status"rn length="10"rn rn rn rn truern truern rn @hibernate.propertyrn column="create_time"rn length="19"rn not-null="true"rn rn rn rn rn rn rnrn rn rn rn rnrnrnrnSysRole:rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn rnrn如果哪位高手知道,请指教下,感激不尽,并给高分!rn
求大神解答一下session问题,急!!!
[img=https://img-bbs.csdn.net/upload/201605/19/1463637538_645987.png][/img]点击登陆的时候,进行验证。如果是第一次登陆,跳转到信息页面,第二次以后就跳到首页。。后台把状态码给session里面,我这边该如何做,jsp 的,求详细代码和思路啊。。。急!!!
C++deque问题,急求大神解答
下面第3,7行代码看不懂,可以为我解答一下吗?rn[code=c]rn deque strDeq;rnrn strDeq.assign(4, string("CHINA"));rn strDeq.push_back("first_string");rn strDeq.push_front("last_string");rnrn copy(strDeq.begin(), strDeq.end(),rn ostream_iterator(cout, " "));rn cout << endl;rn cout << endl;rnrn for (int i = 0; i < strDeq.size(); ++i)rn cout << "strDeq[" << i << "] : " << strDeq[i] << endl;rn cout << endl;rnrn for (int i = 0; i < strDeq.size(); ++i)rn cout << "strDeq.at(" << i << ") : " << strDeq.at(i) << endl;rn cout << endl;rn[/code]
急:ssh框架问题
我项目先前只用了spring+hibernate,现在需要加入struts,我用eclipse导入struts,在struts-config.xml中加入 rn rn rn用来和spring管理搭配rn rn 问题:当struts-config.xml加入这代码 启动不报错,访问action报下面的错rn java.lang.IllegalStateException: Could not find ContextLoaderPlugIn's WebApplicationContext as ServletContext attribute [org.springframework.web.struts.ContextLoaderPlugIn.CONTEXT.]: Did you register [org.springframework.web.struts.ContextLoaderPlugIn]?rn rn 如果struts-config.xml中不加入上面的代码不报错,可以访问action,但是就不能用spring的管理了,必须在aciton里面new对象rn rn 想知道什么原因,是否是什么包被覆盖了或没有导入?
SSH框架中懒加载问题 在线等!!!!求大神
表的结构如图:[img=https://img-bbs.csdn.net/upload/201305/06/1367819625_37649.jpg][/img]rn用hibernate维护,语句为rn[code=java]public List getRequest(String userName) rn rn Session session = sessionFactory.openSession();rn rn // @SuppressWarnings("unchecked") 嘛意思rn List pubrequests = sessionrn .createQuery("from PubRequest as p where p.pubuser.userName = ? and p.allowText ='同意' ")rn .setString(0, userName)rn .list();rn rn for(PubRequest pubrequest:pubrequests)rn System.out.println(pubrequest.getAllowText()+"============================");rn rn for(PubRequest pubrequest:pubrequests)rn System.out.println(pubrequest.getPubuser().getTrueName()+"============================");rn System.out.println(pubrequest.getPubtest().getTestName()+"============================");rn rn rn session.close();rn return pubrequests;rn rnrn[/code]rnrn其中allowText的值可以输出,但是下面的引用外键的不可以输出rnrn下面是三个bean类,lazy不去掉也不对,如果把lazy去掉或改成不是懒加载机制,直接报rnjava.lang.NullPointerExceptionrn org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:2314)rn org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:664)rn org.hibernate.type.EntityType.resolve(EntityType.java:444)rn org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:168)rn org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:134)rn org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:999)rn org.hibernate.loader.Loader.doQuery(Loader.java:878)rn[code=java]package com.niit.bean;rnrnimport java.io.Serializable;rnimport java.util.Date;rnimport java.util.Set;rnrnimport javax.persistence.Column;rnimport javax.persistence.Entity;rnimport javax.persistence.FetchType;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.Id;rnimport javax.persistence.JoinColumn;rnimport javax.persistence.ManyToMany;rnimport javax.persistence.ManyToOne;rnimport javax.persistence.OneToMany;rnimport javax.persistence.OneToOne;rnrnimport org.hibernate.annotations.Proxy;rn/**rn * rn * 考试信息表rn */rn@Entityrnpublic class PubTest implements Serializablernrn @Idrn @GeneratedValuern private int testId; //考试idrn private String testName; //考试名rn @Column(columnDefinition="timestamp")rn private Date startTime; //开始时间rn @Column(columnDefinition="timestamp")rn private Date endTime; //结束时间rn @ManyToOne(fetch=FetchType.LAZY)rn @JoinColumn(name="tacticsId") //策略rn private PubTactics pubtactics; rn private String isTimeOut; //是否过期rn @OneToMany(mappedBy="pubtest",fetch=FetchType.LAZY)rn private Set pubexamquestions; //考试对应表(用来两表关联)rn @OneToMany(mappedBy="pubtest",fetch=FetchType.LAZY)rn private Set testPersonLists; //考试结果表rn @OneToMany(mappedBy="pubtest",fetch=FetchType.LAZY)rn private Set pubRequests; //考试请求表rn @OneToOne(mappedBy="pubtest",fetch=FetchType.LAZY)rn private PubTestList pubtestlist; //考试结果表(总)rn rn /*方法略*/rn rnrn[/code]rn[code=java]package com.niit.bean;rnrnimport java.io.Serializable;rnimport java.util.Set;rnrnimport javax.persistence.Column;rnimport javax.persistence.Entity;rnimport javax.persistence.FetchType;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.Id;rnimport javax.persistence.OneToMany;rnrn/**rn * 考生信息表rn */rn@Entityrnpublic class PubUser implements Serializable rnrn @Idrn @GeneratedValuern private int userId; // 考生IDrn @Column(unique = true)rn private String userName; // 登录用户名rn @Column(nullable = false)rn private String userPassword; // 登陆密码rn private String examId; // 准考证号rn private String userSex; // 考生性别rn private String cardType; // 证件类型rn private String cardNum; // 证件号码rn private String userPhone; // 联系电话rn private String communiType; // 联系方式rn private String communiNum; // 即时通讯号rn private String userAddress; // 考生地址rn private String trueName; // 考生真实姓名rn private String userSchool; // 考生学校rn private String userEmail; // 考生邮箱rn private String userPost; // 考生邮编rn private String userClass; // 考生所在班级rn @OneToMany(mappedBy = "pubuser", fetch = FetchType.LAZY)rn private Set testPersonLists; // 考试结果表rn @OneToMany(mappedBy = "pubuser", fetch = FetchType.LAZY)rn private Set pubrequests; // 考试申请rnrn /*方法略*/rn rnrn[/code]rn[code=java]package com.niit.bean;rnrnimport java.io.Serializable;rnimport java.util.Date;rnrnimport javax.persistence.Entity;rnimport javax.persistence.FetchType;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.Id;rnimport javax.persistence.JoinColumn;rnimport javax.persistence.ManyToOne;rn/**rn *考试请求表 rn */rn@Entityrnpublic class PubRequest implements Serializable rn @Idrn @GeneratedValuern private int requestId; //请求IDrn @ManyToOne(fetch=FetchType.LAZY)rn @JoinColumn(name="testId",nullable=false) rn private PubTest pubtest; //考试信息rn @ManyToOne(fetch=FetchType.LAZY)rn @JoinColumn(name="userId",nullable=false) rn private PubUser pubuser; //考生IDrn private String allowText; //是否同意rn private Date RequestTime; //申请日期rn rn rn rn /*方法略*/rn[/code]rn
Java SSH框架出现异常,求大神指教
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [beans.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrnat org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:621)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)rn at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)rnCaused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptorrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn ... 56 morern2017-8-14 17:27:43 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class cn.it.shop.listener.InitDataListenerrnorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [beans.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)rn at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)rn at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)rn rnrn严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnjava.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContextrn at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:172)rn at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1078)rn at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1052)rn at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1000)rn at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:554)rn at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)rn at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3866)rn at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4500)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rn严重: StandardServer.await: create[8005]: rnjava.net.BindException: Address already in use: JVM_Bindrn at java.net.PlainSocketImpl.socketBind(Native Method)rn at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)rn at java.net.ServerSocket.bind(ServerSocket.java:319)rn at java.net.ServerSocket.(ServerSocket.java:185)rn at org.apache.catalina.core.StandardServer.await(StandardServer.java:373)rn at org.apache.catalina.startup.Catalina.await(Catalina.java:630)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:590)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
求大神指点 SSH框架部分
public class LoginAction extends ActionSupportn n public ActionForward execute(n ActionMapping mapping,n ActionForm form,n HttpServletRequest request,n HttpServletResponse response) n return mapping.findForward("success");n n nn n这段代码 execute 中的 属性都是做什么的 本人初学者请大神指点
SSH框架,Websocket连接失败,求大神指导
环境:jdk8、tomcat8rn使用的是Spring API for WebSocket,项目框架是SSH。rn问题:websocket客户端一直连接失败,rn报错信息:WebSocket connection to 'ws://192.168.1.110:8080/项目名/collectionList' failed: Error during WebSocket handshake: Unexpected response code: 404。rn下面贴上前后台代码,求大神帮忙分析一下
急求SSH框架大神!救救小弟。。有报酬。。
本人的研究生毕业论文迫在眉睫了rn具体是要求用SSH框架做一个电路课程的教学辅助系统。。数据库用MySQL就可以 实现在线答疑,文件上传下载等功能即可 有兴趣的大神请联系我 具体要求加QQ说 48590130 武汉地区最好 有报酬
急求解答,存储过程调用
一个存储过程有多个参数,如:rnCREATE PROC u_kcdm @kcdm char(8) , @jxbh char(4) , @xkczxq char(3) , @xkczjgb char(5) , @xkczkb char(3), @xh char(8), @xklc char(1)rnasrnrnAsp中如何传递多参,调用这样的存储过程?????rnrn这是我写的另一一个参数存储过程的调用rn dim jsh,commrn Const adcmdstoredproc=4rn Const adinteger=3rn Const adparaminput=1rn Const adparamoutput=2rn Const adChar=8rn set comm=Server.Createobject("ADODB.command")rn comm.Activeconnection=Connrn comm.Commandtext="U_jshrn Set Jsh=comm.CreateParameter("@Jsh",adChar,adparaminput,20,trim(Request("Jsh")))rn comm.Parameters.Append Jshrn Set rs=comm.Executern请大家帮帮忙
求大神解答python中的正则表达式问题
对于正则表达式中的非贪婪模式,我想知道非贪婪模式中的最少的字符是怎么规定的。比如+?在不同情况下表示的匹配次数是多少?
ssh框架整合问题,求大神
210 ERROR ContextLoader:220 - Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:rnPropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'systemPropertiesModeName' threw exception; nested exception is org.springframework.core.ConstantException: Field 'SYSTEM_PROPERTIES_MODE_ENVIRONMENT' not found in class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:626)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:rnPropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'systemPropertiesModeName' threw exception; nested exception is org.springframework.core.ConstantException: Field 'SYSTEM_PROPERTIES_MODE_ENVIRONMENT' not found in class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)rn ... 21 morern九月 01, 2016 11:37:03 上午 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:rnPropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'systemPropertiesModeName' threw exception; nested exception is org.springframework.core.ConstantException: Field 'SYSTEM_PROPERTIES_MODE_ENVIRONMENT' not found in class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:626)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:rnPropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'systemPropertiesModeName' threw exception; nested exception is org.springframework.core.ConstantException: Field 'SYSTEM_PROPERTIES_MODE_ENVIRONMENT' not found in class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)rn ... 21 more
ssh的一个问题。求大神
十月 23, 2015 4:48:15 下午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory C:\MyEclipse 2015\.metadata\.me_tcat7\webapps\GraduationDesignrn十月 23, 2015 4:48:16 下午 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn2015-10-23 16:48:48,134 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input streamrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1897)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:744)rnCaused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input streamrn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:541)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:631)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)rn ... 28 morernCaused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connectrn at org.dom4j.io.SAXReader.read(SAXReader.java:484)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:532)rn ... 32 morern十月 23, 2015 4:48:48 下午 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input streamrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1897)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:744)rnCaused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input streamrn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:541)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:631)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)rn ... 28 morernCaused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connectrn at org.dom4j.io.SAXReader.read(SAXReader.java:484)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:532)rn ... 32 morern十月 23, 2015 4:48:48 下午 org.apache.catalina.core.ApplicationContext logrnrnrn以前没这问题,最近改了I个表结构,就变成这样了
【高中基础C语言题目求大神】求大神解答。。。急。。
[img=https://img-bbs.csdn.net/upload/201512/22/1450778583_564448.jpg][/img]rn求答案,,,,= =
ssh问题 求大神帮助
sshrn Equipment.hbm.xml 的其中一部分rn rn rn rn rn rn rn rn rn rn[img=http://img.my.csdn.net/uploads/201304/22/1366638963_7047.JPG][/img]rn我想通过 roomID 和 homeID 这两个属性找出 eqID rn 也就是 某学校( homeID),某教室(roomID ) 找到 某人 ( eqID)rnroom 和 home 都是对象rnequipmentDAO.findByProperty("id.room",room); 这样不行 rnrnrn错误提示rnorg.springframework.orm.hibernate3.HibernateQueryException: Expected positional parameter count: 1, actual parameters: [com.wlw.beans.Room@165eff6] [from Equipment as model where model.id.room= ?]; nested exception is org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [com.wlw.beans.Room@165eff6] [from Equipment as model where model.id.room= ?]rn
docker部署的问题?求大神解答解答???
为什么会出点这个错误,如图rn[img=https://img-bbs.csdn.net/upload/201905/06/1557118781_977363.png][/img]rnrn分明是进入容器后访问正常,不进入容器访问就会出现“”链接被充值“” 到底为什么???求解rnrn这是我的上一篇求助帖:https://bbs.csdn.net/topics/392601985rnrn小弟已经被卡一周多了,还望大神指点一二!!
求大神解答问题啊
HTTP Status 500 – Internal Server Error Type Exception Report Message Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: Description The server encountered...
求大神解答,空指针的问题
代码是用jsch连接ssh。rn这样写没问题,可以加载远程目录下的文件rn[code=java]rnpublic class SftpTest rn private String host;rn private String username;rn private String password;rn private int port = 22;rn private ChannelSftp channelSftp;rn private Session session;rnrn public SftpTest() rn rnrn public SftpTest(String host, String username, String password, int port) rn this.host = host;rn this.username = username;rn this.password = password;rn this.port = port;rn rn /**rn * connect server via sftprn */rn public void connect() rn String localPath = "G:/sftp/";rn String remotePath = "/home/Administrator";rn rn try rnrn JSch jsch = new JSch(); rn session= jsch.getSession(username, host, port);rn System.out.println("Session created.");rn session.setPassword(password);rn Properties sshConfig = new Properties();rn sshConfig.put("StrictHostKeyChecking", "no");rn session.setConfig(sshConfig);rn session.connect();rn System.out.println("Session connected.");rn System.out.println("Opening Channel.");rn ChannelSftp channelSftp = (ChannelSftp) session.openChannel("sftp");rn channelSftp.connect();rn System.out.println("Connected to " + host + ".");rn rn Vector listFiles=channelSftp.ls(remotePath);rn for(int i=0;i
求大神帮助解答问题
#includern#define MAXLINE 1000 //允许输入行的最大长度rnrnint getline(char line[],int maxline);rnvoid copy(char to[],char from[]);rnrn//print the longest linernmain()rnrn int len;rn int max;rn char line[MAXLINE];rn char longest[MAXLINE];rn rn max = 0;rn while((len = getline(line,MAXLINE)) > 0)rn if(len>max)rn max = len;rn copy(longest,line); rn rn if(max > 0)rn printf("%s",longest);rn return 0 ;rn rn rn //getline函数:将一行读入到S中并返回其长度rn rn int getline(char s[],int lim)rn rn int c,i;rn rn for(i = 0;irn#define MAXLINE 1000 //允许输入行的最大长度rnrnint getline(char line[],int maxline);rnvoid copy(char to[],char from[]);rnrn//print the longest linernmain()rnrn int len;rn int max;rn char line[MAXLINE];rn char longest[MAXLINE];rn rn max = 0;rn while((len = getline(line,MAXLINE)) > 0)rn printf("%d,%s",len,line);rn if(len>max)rn max = len;rn copy(longest,line);rn rn rn if(max>0)rn printf("%s",longest);rn rn return 0 ;rn rn rn //getline函数:将一行读入到S中并返回其长度rn rn int getline(char s[],int lim)rn rn int c,i,j;rn rn j = 0;rn for(i = 0;(c = getchar())!=EOF&&c!='\n';++i)rn if(i
sql问题,求大神解答!!!
一共两道题请求解答!下面是代码,生成三个表,sc,student,coursernrnrn```rn create database STdbrngornuse STdbrngornrncreate table studentrn(rn sno char(9) primary key,rn sname char(20) unique,rn ssex char(2),rn sage smallint,rn sdept char(20)rn)rnrncreate table coursern(rn cno char(4) primary key,rn cname char(40),rn cpno char(4),rn ccredit smallintrn --,foreign key (cpno) references course(cno)rn)rnrncreate table scrn(rn sno char(9),rn cno char(4),rn grade smallint,rn primary key (sno,cno),rn foreign key (sno) references student(sno),rn foreign key (cno) references course(cno)rn)rnrn--插入rnrninsert into studentrnvalues('200215121','李勇','男',20,'CS')rninsert into studentrnvalues('200215122','刘晨','女',19,'CS')rninsert into studentrnvalues('200215123','王敏','女',18,'MA')rninsert into studentrnvalues('200215125','张立','男',19,'IS')rninsert into studentrnvalues('200215126','陈天华','男',19,'IS')rninsert into studentrnvalues('200215128','宋阳','女',19,'MA')rnrnselect * from studentrnrnrninsert into coursernvalues('1','数据库','5',4)rninsert into course(cno,cname,ccredit)rnvalues('2','数学',2)rninsert into coursernvalues('3','信息系统','1',4)rninsert into coursernvalues('4','操作系统','6',3)rninsert into coursernvalues('5','数据结构','7',4)rninsert into coursernvalues('6','数据处理','NULL',2)--用''表示NULL是一个具体的值rninsert into coursernvalues('7','PASCAL语言','6',4)rninsert into coursernvalues('8','C_语言','NULL',4)rninsert into coursernvalues('9','面向对象',NULL,4)--不用''表示NULL是一个空值rnrnselect * from coursernrninsert into scrnvalues('200215121','1',92)rninsert into scrnvalues('200215121','2',85)rninsert into scrnvalues('200215121','3',88)rninsert into scrnvalues('200215121','4',72)rninsert into scrnvalues('200215121','5',65)rninsert into scrnvalues('200215121','6',58)rninsert into scrnvalues('200215121','7',95)rninsert into scrnvalues('200215121','8',68)rnrnrnrninsert into scrnvalues('200215122','2',90)rninsert into scrnvalues('200215122','3',80)rninsert into scrnvalues('200215126','1',NULL)rnrnselect * from scrnrn```rn问题1:查询选修课程超过3门的学生姓名和选修门数rn问题2:查询“C_语言”课程得最高分的学生的姓名、性别、所在系rn问题3:查询各门课程名称及相应的选课人数rn求大神解答!!!rnrn
奇葩的问题,求大神解答~!~!
本人菜鸟一枚,大神勿喷哈。rn今天调试程序,发现从数据库中取到的数据,到DataSet可视化工具里就不一样了。具体看图。rn图一:rn[img=https://img-bbs.csdn.net/upload/201408/01/1406880079_42491.jpg][/img]rn图二:rn[img=https://img-bbs.csdn.net/upload/201408/01/1406880105_92512.jpg][/img]rnrn为什么到DataSet可视化工具里时间自动多了星期啊??而切更奇怪的是,旁边的同事用同一份项目调试,不会出现我这样的情况。求大神指点迷津~!感谢
数据结构问题,求大神解答
假设某但循环单链表非空,且无表头节点也无表头指针,指针p指向该链表中的某节点。请设计一个算法将p所指节点的后继节点变为p所指节点的前驱节点。
float问题 求大神解答
我在Android开发中使用github上的MPAndroidChart时,在y轴添加数据时,它需要的是float型的值,如果按照演示的情况,添加了3个值分别是 10f 60f 30f n而我从数据库中调用的数据,求和后 进行每个数据除以和 即求出每个数据的百分比 进行除法以后 就不行了? 求解 float做了除法以后,怎么让他变成整数,像例子上面的那样?nn谢谢大神,小白没币了,见谅~nnn这是演示代码的数据private float[] y = 10f, 60f, 30f ;nn这是我的数据 float quarterly = ((float) (fee_type.get(("a" + i)) / resultIncome)) * 100;n yValues.add(new Entry(quarterly, i - 1));nn这是log中我显示的除法结果 我感觉是这里出问题的 捕捉的数据是这样的n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 7.534247n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 7.534247n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 7.534247n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 15.068494n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 7.534247n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 22.602741n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 7.534247n11-21 18:32:02.785 19211-19211/com.chase.cn.demon D/info5: == 30.136988
C++问题,求大神解答
[code=C/C++][/code]rn#includern#includern#includern#includern#includernusing namespace std;rnvector v;rnvoid input();//输入函数rnvoid print();//输出函数rnint BitSquareSum(int n);//平方和函数rnbool LessThanBitSquareSum(int a,int b)rnreturn BitSquareSum(a)>v[i]; ++i);rn rnrnint BitSquareSum(int n)rn int sum=0;rn for(int x=n; x; x/=10)rn sum += (x%10)*(x%10);rn return sum;rnrnvoid print()rn for(int i=0; i
菜鸟的问题!!求大神解答
grade = 97rnif grade < 60:rn print 'E'rnelif grade >= 60:rn print 'D'rnelif grade >= 70:rn print 'C'rnelif grade >= 80:rn print 'B'rnelif grade >= 90:rn print 'A'rn 为什么输出D,而不是A?
指针问题求大神解答
#includernmain()rnrn int a=10,b=20,s,t,*pa,*pb;rn pa=&a;rn pb=&b;rn s=*pa+*pb;rn t=(*pa)**pa;rn printf("a=%d\nb=%d\na+b=%d\na*b=%d\n",a,b,a+b,a*b);rn printf("s=%d\nt=%d\n",s,t);rnrnrn[color=#FF0000]问一下,为什么输出的时候显示的t=100而不是t=200啊[/color]
installshield的问题求大神解答
我这里有一个installshield2015的工程,现在修改了general information的summary information stream下面分内容,要在安装包的哪里才可以找到这些信息啊,我的是installscript msi的工程,生成的exe文件,软件上说可以在属性的概要tab里面看到,但是我的文件属性里面就没有这个tab,我要怎么确认这里的信息修改了,急求解决啊
C#问题求大神解答
[img=https://img-bbs.csdn.net/upload/201602/11/1455189277_781694.png][/img]rn连接access数据库的时候出现这种情况rn附代码rnusing System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Linq;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.Data.OleDb;rnrnnamespace WindowsFormsApplication41rnrn public partial class Form1 : Formrn rn OleDbConnection objconnection;rn rn int vRec;rn public Form1()rn rn InitializeComponent();rn rnrn private void Form1_Load(object sender, EventArgs e)rn rnrn rn private void linkdb()rn rn string strConnection = @"Provider=Microsoft.Jet.OleDb.4.0,Data Source=C:\Users\lyq\Documents\Visual Studio 2012\Projects";rn objconnection = new OleDbConnection(strConnection);rn objconnection.Open();rn rnrn private void button1_Click(object sender, EventArgs e)rn rn linkdb();rn string sql = "select*from name";rn OleDbDataAdapter myda = new OleDbDataAdapter(sql, objconnection);rn DataSet myds = new DataSet();rn vRec = myda.Fill(myds, "name");rn dataGridView1.DataSource = myds.Tables["name"];rn rn
java 问题 求大神解答
第三题,我们老师说是选D,汉字能做标识符吗?![图片](https://img-ask.csdn.net/upload/201506/01/1433130011_272511.jpg)
数据库查询问题求大神解答
select unitcode from g3_unit where unitname like'%部门001%'这个可以查询出来nnselect unitno from g3_unit where unitcode like '1___'这个也可以查询出来nnselect unitno from g3_unit where unitcode like '(select unitcode from g3_unit where unitname like'%部门001%')___' 这两个加起来就不行了,我知道肯定是我写法的问题,请问各位大神怎么改一下?
求大神解答网络传输问题
比如两个微信用户之间,现在分别处于内网环境下,如何使向对方发送的消息到达对方所处内网环境下,因为用户再移动,怎样知道对方所处内网地址?
android问题,求大神解答
为什么会这样![图片](https://img-ask.csdn.net/upload/201611/13/1479048427_425951.jpg)
java的问题 求大神解答
![图片](https://img-ask.csdn.net/upload/201705/14/1494732244_517321.jpg)
c语言编程问题 求大神解答
Maximum numberrn• Write a program that outputs maximum and minimum number in 10 random numbersrn• Range of the random number is 1-1000 • Use the for looprn例子)rn400 509 392 949 667 606 364 338 120 441 Maximum number is 996rnMinimum number is 120 rn ![图片说明](https://img-ask.csdn.net/upload/201510/04/1443958116_527706.jpeg)
VC++问题 求大神解答
[img=https://img-bbs.csdn.net/upload/201305/30/1369889762_518565.jpg][/img]rnrn上图中的问题如何解决啊
相关热词 c#异步发送kafka c#窗体编号 c# 操作二进制文件 c# 反射 机制 c#线程 窗体失去响应 c#角度转弧度 c# 解析gps数据 c# vs设置 语法版本 c# json含回车 c#多线程demo