java视频监控,java怎么操控摄像头,怎么调用厂家的dll

最近遇到一个项目,有视频监控部分,以前没有接触过摄像头,请问java该如何控制摄像头的行为呢,还有上传和下载摄像头的视频信息到页面上,请大神前辈们指教

suannai0314
鹳狸媛 楼主的这个问题解决了么?下边的答案能解决问题么?如果可以麻烦点击答案旁的√采纳哦~如果没有也可以将自己的答案贴上然后进行采纳的。
6 年多之前 回复

3个回答

想问下各位 怎么编写android手机上的应用去取得网络摄像头的资源来呢?我现在遇到的问题就是自己写了一个应用 但是不能够获得网络摄像机的数据 用他自己带的软件是可以的 它是通过登陆摄像头ID然后就可以了,我的为什么不行呢,是不是需要验证呢(用浏览器ip方式登陆摄像头的时候会提示输入用户名密码)这个问题怎么解决

视频监控摄像头这个很简单啊 厂家会提交接口给你的 提供文档给你的 你只要调用它的接口 就行了 想怎么控制就怎么控制

qq_33718649
qq_33718649 请问你的问题解决了吗
3 年多之前 回复
Gwolf_Fuhaitao
影非弦 厂家的一般都是dll吧
6 年多之前 回复

请问你的问题解决了吗

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java中子类调用父类构造函数中定义的变量

package jm; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class dl extends JFrame implements ActionListener{ GridBagLayout gridbag=new GridBagLayout(); public dl(){ super("登陆界面"); setSize(500,500); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // setLookAndFell(); setLayout(gridbag); JLabel yhm=new JLabel("用户名:"); JTextField yyhm=new JTextField(20); JLabel mmm=new JLabel("密码:"); JPasswordField mm=new JPasswordField(20); mm.setEchoChar('#'); JButton tj=new JButton("登陆"); addComponent(yhm,0,0,10,20,1,1,GridBagConstraints.NONE,GridBagConstraints.EAST); addComponent(yyhm,1,0,10,20,1,4,GridBagConstraints.NONE,GridBagConstraints.WEST); addComponent(mmm,0,1,10,20,1,1,GridBagConstraints.NONE,GridBagConstraints.EAST); addComponent(mm,1,1,10,20,1,1,GridBagConstraints.NONE,GridBagConstraints.WEST); addComponent(tj,1,40,10,20,1,1,GridBagConstraints.NONE,GridBagConstraints.WEST); pack(); setVisible(true); } public void addComponent(Component component,int gridx,int gridy,int ipadx,int ipady,int weightx,int weighty,int fill,int anchor){ GridBagConstraints constraint=new GridBagConstraints(); constraint.gridx=gridx; constraint.gridy=gridy; constraint.ipadx=ipadx; constraint.ipady=ipady; constraint.weightx=weightx; constraint.fill=fill; constraint.anchor=anchor; gridbag.setConstraints(component,constraint); add(component); } public void actionPerformed(ActionEvent event){ } public static void main(String[] arg){ dl dld=new dl(); } } ``` 父类的构造函数中定义了一个按钮tj,用来作为登录按钮,没有定义行为,准备在子类中定义 ``` package jm; import java.awt.event.*; import java.awt.*; import javax.swing.*; public class sczj extends dl{ public sczj(){ } public void actionPerformed(ActionEvent event){ Object source=event.getSource(); if(source==super.tj){ System.out.println("其实你没有错"); //准备在这里定义tj按钮的行为,但是NETBEANS提示找不到符号tj,动行的时候也没有效果 } } public static void main(String[] arg){ new sczj(); } }

android jni java.lang.UnsatisfiedLinkError

在调用jni时,报java.lang.UnsatisfiedLinkError: No implementation found for void com.eaglive.voip.VoipSdk.init(java.lang.String, int, java.lang.String) (tried Java_com_eaglive_voip_VoipSdk_init and Java_com_eaglive_voip_VoipSdk_init__Ljava_lang_String_2ILjava_lang_String_2) 还有调用了其他的so文件,但是这里出现的错误好像与它们无关,就暂时不贴出来了, 网上说的检查java类包名和jni方法名这个我检查了,没问题,还有使用命令查看了so文件是否加载到目录里,结果如下: ![图片说明](https://img-ask.csdn.net/upload/201709/04/1504532197_671134.png) System.loadLibrary("voip"); 这句也没报异常。跪求大牛帮我看看,还是哪里的问题。拜托,拜托……

java中的文件选择框

<p><br><img src="http://dl.iteye.com/upload/attachment/453399/ce6dbf09-1a92-3e97-a333-2e594adcf751.jpg" alt=""></p> <p>java中如何打开一个这样的文件选择对话框,我做了个音乐播放器,有个添加整个文件夹下的所有音乐的功能,只能用JFileChooser来实现,但我想要这种树状显示文件夹的,在网上找了很久都说没有这种方式的,但myeclipse这个IDE软件都可以打开这种选择框,而它完全是java写的,希望那位高人能指点指点! </p>

mybatis与struts1 [java.lang.NoClassDefFoundError:org/apache/ibatis/io/Resources]

在Action中,当我要向数据库中插入一条记录时,报了下面的错误: [code="java"] javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/ibatis/io/Resources org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:294) org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187) com.zrxx.action.ProjectAction.execute(ProjectAction.java:33) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) java.lang.NoClassDefFoundError: org/apache/ibatis/io/Resources com.zrxx.util.SqlSessionFactoryTool.getSqlSessionFactory(SqlSessionFactoryTool.java:30) com.zrxx.dao.BaseDao.openSession(BaseDao.java:15) com.zrxx.dao.BaseDao.openSession(BaseDao.java:10) com.zrxx.dao.ProjectDao.insertPro(ProjectDao.java:13) com.zrxx.action.ProjectAction.add(ProjectAction.java:54) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270) org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187) com.zrxx.action.ProjectAction.execute(ProjectAction.java:33) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [/code] 这个错误是当dao对象已经创建了,调用dao.insert()时发出的 附上我的SqlSessionFactoryTool源代码: [code="java"] public class SqlSessionFactoryTool { private static SqlSessionFactoryTool tool; private SqlSessionFactory factory; public static SqlSessionFactoryTool getInstance(){ if(tool == null) tool = new SqlSessionFactoryTool(); return tool; } public SqlSessionFactory getSqlSessionFactory(){ String resource = "/mybatis.xml"; Reader reader = null; try { reader = Resources.getResourceAsReader(resource); } catch (IOException e) { e.printStackTrace(); } factory = new SqlSessionFactoryBuilder().build(reader); return factory; } [/code] 这是我的目录结构 [img]http://dl.iteye.com/upload/attachment/597707/8f659481-6204-34e4-9c24-18ba93290695.png[/img]

java出现报错QAQ 完全无头绪 注册页面点击注册后显示如下错误:

严重: Servlet.service() for servlet [UserServlet] in context with path [/goods] threw exception java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at cn.itcast.servlet.BaseServlet.service(BaseServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at cn.itcast.filter.EncodingFilter.doFilter(EncodingFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cn.itcast.servlet.BaseServlet.service(BaseServlet.java:44) ... 26 more Caused by: java.lang.RuntimeException: java.sql.SQLException: Data truncation: Data too long for column 'loginname' at row 1 Query: insert into t_user values (?,?,?,?,?,?) Parameters: [73819349617543F5B35F175489731F6F, 8E84EB7B41B14C22832B10625AADD601332DC8C364D6489A9AA8B87C7AF89962, aaaaaa, 1215402123@qq.com, false, 8E84EB7B41B14C22832B10625AADD601332DC8C364D6489A9AA8B87C7AF89962] at cn.itcast.goods.user.service.UserService.regist(UserService.java:72) at cn.itcast.goods.user.web.servlet.UserServlet.regist(UserServlet.java:131) ... 31 more Caused by: java.sql.SQLException: Data truncation: Data too long for column 'loginname' at row 1 Query: insert into t_user values (?,?,?,?,?,?) Parameters: [73819349617543F5B35F175489731F6F, 8E84EB7B41B14C22832B10625AADD601332DC8C364D6489A9AA8B87C7AF89962, aaaaaa, 1215402123@qq.com, false, 8E84EB7B41B14C22832B10625AADD601332DC8C364D6489A9AA8B87C7AF89962] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:402) at cn.itcast.jdbc.TxQueryRunner.update(TxQueryRunner.java:55) at cn.itcast.goods.user.dao.UserDao.add(UserDao.java:52) at cn.itcast.goods.user.service.UserService.regist(UserService.java:70) ... 32 more 求问如何结局,我是照着一个学习视频学习的..

java.lang.RuntimeException ,找不到配置的Action类

applicationContext.xml文件中配置scheduleAction了啊!struts.xml文件中“初始化当前用户显示所有日程列表”的action也是用的scheduleAction,为什么“查询日程列表”的action就找不到这个类呢? ---------------------- [img]http://dl.iteye.com/upload/attachment/570153/cb780579-43b0-3273-8efe-ee6ea4e7cb92.png[/img] --------------------- [img]http://dl.iteye.com/upload/attachment/570155/1cb500de-6251-3b01-bb08-28bd26c01d9d.png[/img] ---------------------- [img]http://dl.iteye.com/upload/attachment/570157/b0b8b53a-ce5a-31e4-b351-90cb8f96b835.png[/img] java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [[color=red]scheduleAction[/color]] org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:100) org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385) org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274) com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:76) com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:356) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) root cause java.lang.ClassNotFoundException: scheduleAction org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) org.apache.struts2.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:111) org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:98) org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385) org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274) com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:76) com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:356) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

SpringDm为什么老报java.lang.ClassNotFoundException

请各位大侠熟悉osgi的帮忙解决 异常 [code ="java"] Exception in thread "SpringOsgiExtenderThread-2" org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.orm.ibatis.SqlMapClientFactoryBean] for bean with name 'sqlMapClient' defined in URL [bundleentry://266.fwk2279771/META-INF/spring/data-source.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org.springframework.orm.ibatis.SqlMapClientFactoryBean not found from bundle [Contact (Contact)] at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1144) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:758) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.NoClassDefFoundError: org.springframework.orm.ibatis.SqlMapClientFactoryBean not found from bundle [Contact (Contact)] at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:112) at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at org.springframework.util.ClassUtils.forName(ClassUtils.java:211) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138) ... 11 more Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/FactoryBean at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:608) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400) at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:464) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207) at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99) ... 16 more Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.FactoryBean at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [/code] 项目结构 [img]http://dl.iteye.com/upload/attachment/0071/5377/c79ecbc1-53d9-3e64-af47-c9a6e0331319.jpg[/img] MANIFEST.MF Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Contact Bundle-SymbolicName: Contact Bundle-Version: 1.0.0.qualifier Export-Package: com.javaworld.sample.osgi.spring.contact Bundle-ClassPath: ., lib/commons-dbcp-1.2.2.jar, lib/commons-pool-1.4.jar, lib/mysql-connector-java-5.0.8-bin-g.jar, lib/commons-io-1.0.jar, lib/commons-lang-20030203.000129.jar, lib/aspectjtools-1.6.12.jar Import-Package: javax.servlet;version="2.4.0", javax.servlet.http;version="2.4.0", org.apache.jasper, org.osgi.framework;version="1.4.0", org.springframework.orm.ibatis;version="2.5.6.SEC03", org.springframework.orm.ibatis.support;version="2.5.6.SEC03", org.springframework.osgi.web.context.support;version="1.2.0.rc1", org.springframework.web.context;version="2.5.6", org.springframework.web.context.support;version="2.5.6" Require-Bundle: org.springframework.osgi.core;bundle-version="1.2.0", org.springframework.osgi.io;bundle-version="1.2.0", org.springframework.beans;bundle-version="2.5.6", org.springframework.context;bundle-version="2.5.6", org.springframework.core;bundle-version="2.5.6" DynamicImport-Package: org.springframework.osgi.web.context.support.*, org.springframework.web.context.*

gradle打包android程序时,如何修改java文件中的属性值

工程有个文件例如1.java文件:其中有个public final static String URL = "/www.baidu.com"; 现在的问题是如何在用gradle打包的时候可以更换1.java文件中的URL? ant打包就可以写不同的build.xml,在build.xml中更换URL的字符串,在利用ant构建的时候通过编译不同的build.xml来达到更换URL的目的。 现在不知道gradle是否也可以在构建的时候修改java文件中的内容呢? (例如gradle1.properties、gradle2.properties) 根据不同的编译选项打包出不同的apk,而这些apk的唯一不同就是1.java文件中的URL换掉了。

java.lang.NullPointerException

package cn.dl; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; /** * @author n *二维码玩玩 */ public class Qrcode { /** * @title: * @Description:二维码生成 * @param content * @param imgPath */ public static void getQrcodeImg(String content,String imgPath) { //实例化Qrcode对象 Qrcode qrcode = new Qrcode(); qrcode.setQrcodeErrorCorrect('M'); qrcode.setQrcodeEncodeMode('B'); qrcode.setQrcodeVersion(15); int width = 235; int height = 235; BufferedImage image = new BufferedImage(width,height,BufferedImage.TYPE_INT_BGR); Graphics2D gs = image.createGraphics(); gs.setBackground(Color.white); gs.clearRect(0, 0, width, height); gs.setColor(Color.black); try { byte[] codeOut; codeOut = content.getBytes("utf-8"); ** boolean[][] code = qrcode.calQrcode(codeOut);** for (int i = 0; i< code.length; i++) { for (int j = 0; j < code.length; j++) { if (code[j][i]) { gs.fillRect(j*3+2, i*3+2, 3, 3); } } } gs.dispose(); image.flush(); //保存 ImageIO.write(image, "png", new File(imgPath)); System.out.println("我的二维码在哪里"); } catch (Exception e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } private boolean[][] calQrcode(byte[] codeOut) { // TODO 自动生成的方法存根 return null; } private void setQrcodeVersion(int i) { // TODO 自动生成的方法存根 } private void setQrcodeEncodeMode(char c) { // TODO 自动生成的方法存根 } private void setQrcodeErrorCorrect(char c) { // TODO 自动生成的方法存根 } public static void main(String[] args) { // TODO 自动生成的方法存根 **getQrcodeImg("我爱我们","D:/Lin/JavaText/cn.dl/lin.png"); ** } }

java JCO 可以调用 SAP 的 changing 么 ??

如题,java jco 怎样调用 Sap 的 changing 属性 [img]http://dl2.iteye.com/upload/attachment/0088/8949/9354ae4e-d99c-3631-92b5-fa5d11660d99.gif[/img]

JAVA如何做一个简单的网址导航

只是几固定的网址而已了,刚开始学JAVA想让自己桌面上有个自己写的东东了。呵呵。自己硬着头皮写了一个,请您看看看得清晰不? 如何才能让他更简便了。谢谢 [code="java"]package wangzhi; import java.awt.*; import java.io.IOException; import java.net.URISyntaxException; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Main{ public static void main(String []args){ JFrame jf=new JFrame("苏戈斯网址"); JPanel jp=new JPanel(new GridLayout(3,3)); JButton jb1=new JButton("百度一下"); jb1.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb2=new JButton("京东商城"); jb2.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb3=new JButton("卓越商城"); jb3.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb4=new JButton("Ajava"); jb4.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb5=new JButton("Google"); jb5.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb6=new JButton("JavaEye"); jb6.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb7=new JButton("名鞋库"); jb7.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb8=new JButton("五一社区"); jb8.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); JButton jb9=new JButton("果果博客"); jb9.addActionListener(new ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent e){ try { System.out.println("dda"); bactionPerformed(e); } catch (URISyntaxException e1) { e1.printStackTrace(); } } }); Toolkit kit=Toolkit.getDefaultToolkit(); Image image=kit.createImage("D:\\source\\image\\cat.png"); jf.setIconImage(image); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jp.add(jb1); jp.add(jb2); jp.add(jb3); jp.add(jb4); jp.add(jb5); jp.add(jb6); jp.add(jb7); jp.add(jb8); jp.add(jb9); jf.add(jp); jf.setSize(300,300); jf.setVisible(true); } public static void bactionPerformed(ActionEvent e) throws URISyntaxException{ java.net.URI uri = null; try { String a=e.getActionCommand(); String url=null; if(a.equals("百度一下")) url="http://baidu.com"; else if(a.equals("京东商城")) url="http://360buy.com"; else if(a.equals("卓越商城")) url="http://amazon.com.cn"; else if(a.equals("五一社区")) url="http://51.com"; else if(a.equals("Ajava")) url="http://ajava.org"; else if(a.equals("Google")) url="http://google.com"; else if(a.equals("名鞋库")) url="http://s.cn"; else if(a.equals("果果博客")) url="http://hi.baidu.com/guoguo6688/blog/"; else if(a.equals("JavaEye")) url="http://iteye.com"; uri = new java.net.URI(url); java.awt.Desktop.getDesktop().browse(uri); System.exit(0);//浏览网址并退出程序 } catch (IOException e1) { e1.printStackTrace(); } } } [/code] [img]http://dl.iteye.com/upload/attachment/452649/97a1e3bb-e240-3453-bb2f-47abacb8eafb.jpg[/img]

求,could not create the java virtual machine 解决方法。

当我使用tomcat7.0启动项目是,STS就弹出一个窗口,既could not create the java virtual machine [img]http://dl.iteye.com/upload/attachment/514357/e1cc4bc6-a0f8-3327-bb93-d37c4726444d.jpg[/img] 我的sts.ini配置如下 [img]http://dl.iteye.com/upload/attachment/514391/6e890cc3-a37e-3b76-b73a-37678b1ea981.jpg[/img] 还望大家指点迷津!!!!

关于java的UDP通信问题。。。。。。。

我建立了两个客户端和一个服务端,一个客户端发消息给服务器,然后服务器转发给另一个客户端。问题是这样的,客户端1发了一个消息1给服务器然后转发给客户端2,然后这时候要是客户端2要给客户端1发个消息2的话,客户端1却是收到刚刚发出去的消息1,客户端2再发消息的时候就正常了,消息2不知道哪里去了,调试的时候客户端2发的消息2是有传送到服务器的,可是服务器再发出去的时候就变了 ![图片说明](https://img-ask.csdn.net/upload/201711/26/1511695595_978945.png) 服务器程序: import java.net.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.*; import java.sql.*; public class UDPServerService { /** * @param args the command line arguments */ public static void main(String[] args) throws SQLException { // TODO code application logic here // if(args.length<1) // { // System.out.println("请输入用于mail服务的本地端口号"); // System.exit(0); // } int i=8000; // String s=Integer.toString(i); UDPServerThread myUDPServer=new UDPServerThread(8000);//创建邮件服务器监听线程 myUDPServer.init(); Thread th=new Thread(myUDPServer); th.start(); } } class UDPServerThread extends Frame implements Runnable { private DatagramSocket UDPServerSocket=null,UDPServerSocket1=null; PreparedStatement ps; TextArea ta=new TextArea(10,50); JButton close; Connection con; Statement stmt; ResultSet rs; String sql; int flag=0; int ports; void init(){ close=new JButton("close"); setTitle("服务监听器"); setSize(400,300); setLayout(new FlowLayout()); add("center",ta); add(close); close.addActionListener(new Close()); setVisible(true); } UDPServerThread(int Port){ ports=Port; try{ UDPServerSocket=new DatagramSocket(Port); UDPServerSocket1=new DatagramSocket(Port+1); ta.append("邮件服务监听器在端口"+UDPServerSocket.getLocalPort()+"\n"); }catch(Exception e){ System.err.println(e); } } public void run(){ if(UDPServerSocket==null) return; while(true){ try{ byte[] dataBuf=new byte[512]; DatagramPacket ServerPacket; InetAddress remoteHost; int remotePort; String datagram,s; ServerPacket =new DatagramPacket(dataBuf,512); UDPServerSocket.receive(ServerPacket);//接受 remoteHost=ServerPacket.getAddress(); remotePort=ServerPacket.getPort(); datagram=new String(ServerPacket.getData()); String sql="SELECT * FROM biao1"; try{ Class.forName("net.ucanaccess.jdbc.UcanaccessDriver"); con=DriverManager.getConnection("jdbc:ucanaccess://D:\\access\\db1.mdb","",""); stmt=con.createStatement(); rs=stmt.executeQuery(sql); }catch(Exception e1){ e1.printStackTrace(); } if(datagram.contains("#dl#")){ while(rs.next()){ //验证帐号密码是否正确 if((datagram.indexOf(rs.getString("username"))!=-1)&&(datagram.indexOf(rs.getString("password")))!=-1){ String pass="connect"; dataBuf=pass.getBytes(); ServerPacket=new DatagramPacket(dataBuf,dataBuf.length,remoteHost,remotePort); UDPServerSocket.send(ServerPacket); ta.append("用户"+remoteHost+"已登录"+'\n'); flag=1; sql="UPDATE biao1 SET connection=? WHERE username=?"; ps=con.prepareStatement(sql); ps.setInt(1,1); ps.setString(2, rs.getString("username")); ps.executeUpdate(); //表1中设置该用户为在线状态 sql="UPDATE biao1 SET remoteHost=? WHERE username=?"; ps=con.prepareStatement(sql); ps.setString(1,remoteHost.toString()); ps.setString(2, rs.getString("username")); ps.executeUpdate(); sql="UPDATE biao1 SET remotePort=? WHERE username=?"; ps=con.prepareStatement(sql); ps.setInt(1, remotePort); ps.setString(2, rs.getString("username")); ps.executeUpdate(); //修改表中用户的登录地址,登录端口 con.commit(); con.close(); } } if(flag==0){ String lost="lost"; dataBuf=lost.getBytes(); ServerPacket=new DatagramPacket(dataBuf,dataBuf.length,remoteHost,remotePort); UDPServerSocket.send(ServerPacket); } } else{ sql="SELECT * FROM biao1"; ResultSet rt; rt=stmt.executeQuery(sql); int port=0; //ta.append('\n'+"收到如下主机发来的邮件"+remoteHost.getHostName()+":\n"+datagram); while(rt.next()){ if(datagram.indexOf(rt.getString("username"))!=-1){ if(rt.getString("connection").indexOf("1")!=-1){ InetAddress remoteHost1=InetAddress.getByName(rt.getString("remoteHost").substring(1)); int remotePort1=rt.getInt("remotePort"); port=remotePort1+1; dataBuf=new byte[512]; dataBuf=datagram.getBytes(); System.out.print(datagram); ServerPacket=new DatagramPacket(dataBuf,dataBuf.length,remoteHost1,port); UDPServerSocket1.send(ServerPacket); } else{ datagram=new String("unconnect."); dataBuf=new byte[512]; //remoteHost=InetAddress.getByName("QH-20150828KDPO"); dataBuf=datagram.getBytes(); ServerPacket=new DatagramPacket(dataBuf,dataBuf.length,remoteHost,remotePort); UDPServerSocket.send(ServerPacket); } } } } }catch(Exception e){ System.err.println(e); } } } protected void finalize(){ if(UDPServerSocket!=null){ UDPServerSocket.close(); UDPServerSocket=null; ta.append("关闭服务器端的数据报连接!"); } } } class Close implements ActionListener{ public void actionPerformed(ActionEvent e){ System.exit(0); } } 客户端程序: import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import static java.lang.Thread.sleep; import java.util.Scanner; import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; public class UDPClientService1 { /** * @param args the command line arguments */ public static void main(String[] args){ // TODO code application logic here Dl d=new Dl(args); } } class UDPClientService extends Frame implements ActionListener,Runnable{ DatagramSocket UDPClientSocket; DatagramPacket ClientPacket; InetAddress remoteHost; int remotePort; byte[] dataBuf; String datagram; private String send=""; String args[]=new String[3]; Scanner in; TextArea ta_receive=new TextArea(10,60),ta_send=new TextArea(5,60); JButton ok=new JButton("ok"),close =new JButton("close"),test=new JButton("test"); JPanel p3=new JPanel(),p1=new JPanel(),p2=new JPanel(); void Init_Frame(){ setTitle("服务器端口1"); setSize(500,450); setLayout(new BorderLayout()); ta_receive.setEditable(false); ta_send.requestFocus(); add(p1,BorderLayout.NORTH); add(p2,BorderLayout.CENTER); add(p3,BorderLayout.SOUTH); p1.add(ta_receive); p2.add(ta_send); p3.add(ok); p3.add(close); p3.add(test); ok.addActionListener(this); close.addActionListener(this); test.addActionListener(this); setVisible(true); } void Init(String args[]){ this.args=args; if(args.length<3){ ta_receive.append("请输入本地端口号,远程服务器主机号及端口名"); System.exit(0); } try{ UDPClientSocket =new DatagramSocket(Integer.valueOf(args[0])+1); remoteHost=InetAddress.getByName(args[1]); remotePort=Integer.parseInt(args[2]); }catch(Exception e){ System.err.println(e); } } public void run(){ while(true){ try { dataBuf=new byte[512]; ClientPacket=new DatagramPacket(dataBuf,512); UDPClientSocket.receive(ClientPacket);//接受 datagram=new String(ClientPacket.getData()); System.out.print(datagram); ta_receive.append('\n'+"Server:"+'\n'); ta_receive.append(" "+datagram+'\n'); } catch (IOException ex) { Logger.getLogger(UDPClientService.class.getName()).log(Level.SEVERE, null, ex); } } } public void actionPerformed(ActionEvent e){ if(e.getSource()==ok){ try{ in=new Scanner(ta_send.getText()); //int port=Integer.valueOf(args[0])+2; ta_receive.append('\n'+"Client:"+'\n'+""+ta_send.getText()+'\n'+'\n'); // UDPClientSocket1 =new DatagramSocket(port); datagram=send+in.nextLine(); dataBuf=datagram.getBytes(); ClientPacket=new DatagramPacket(dataBuf,dataBuf.length,remoteHost,remotePort); UDPClientSocket.send(ClientPacket);//发送 ta_send.setText(""); }catch(IOException e1){ System.err.println(e1); } } else if(e.getSource()==close){ dispose(); System.exit(0); } else if(e.getSource()==test){ send="lijing"; } } } class Dl extends Frame implements ActionListener{ JTextField t1=new JTextField(10),t2=new JTextField(10); JButton ok=new JButton("ok"),close=new JButton("close"); JLabel l=new JLabel("tips"),username1=new JLabel("username"),password1=new JLabel("password"); String args[]=new String[3]; Panel p1=new Panel(),p2=new Panel(),p3=new Panel(),p4=new Panel(); private String name,password,s; DatagramSocket UDPClientSocket; DatagramPacket ClientPacket; InetAddress remoteHost; int remotePort; byte[] dataBuf; String datagram; String flags="#dl#"; Dl(String args[]){ this.args=args; try{ UDPClientSocket =new DatagramSocket(Integer.parseInt(args[0])); remoteHost=InetAddress.getByName(args[1]); remotePort=Integer.parseInt(args[2]); }catch(Exception e){ System.err.println(e); } setLayout(new BorderLayout()); setSize(200,150); p1.add(username1); p1.add(t1); p1.add(password1); p1.add(t2); p1.add(ok); p1.add(close); p2.add(l); add(p1,BorderLayout.CENTER); add(p2,BorderLayout.SOUTH); ok.addActionListener(this); close.addActionListener(this); setVisible(true); } public void actionPerformed(ActionEvent e){ if(e.getSource()==ok){ try{ name=t1.getText(); password=t2.getText(); s=flags+name+password; dataBuf=s.getBytes(); ClientPacket=new DatagramPacket(dataBuf,dataBuf.length,remoteHost,remotePort); UDPClientSocket.send(ClientPacket);//发送 dataBuf=new byte[512]; ClientPacket=new DatagramPacket(dataBuf,512); UDPClientSocket.receive(ClientPacket);//接受 datagram=new String(ClientPacket.getData()); if(datagram.contains("connect")){ UDPClientService ucs=new UDPClientService(); ucs.Init_Frame(); ucs.Init(args); setVisible(false); Thread th=new Thread(ucs); th.start(); } else{ l.setText("error!!"); } }catch(IOException e1){ System.err.println(e1); } } else if(e.getSource()==close){ dispose(); System.exit(0); } } }

Android代码Value of type java.lang.String cannot be converted to JSONObject

在创建jsonObject对象时报错,result是发送poast请求返回的json内容 JSONObject jsonObject = new JSONObject(result); 试了网上说的什么UTF-8 BOM头的问题的方法还是不行, 哪位大神帮忙看一下 W/System.err: org.json.JSONException: Value {"mid":"004YVmzL0O67WR","m4a":"http:\/\/dl.stream.mmmusic.gg.com\/C400004YVmzL0O67WR.m4a?guid=2095717240&skey=CC1743DB70C0AFD81B6CD9A4826F619D0A60FBF859D5238D87EEA2DDEB50D1D6BF1732FDFB30E6C70648F4A57CBC2BAC740D22E1F7D2ED88&uin=0&fromtag=38","mp3_l":"http:\/\/dl.stream.mmmusic.gg.com\/M500004YVmzL0O67WR.mp3?guid=2095717240&skey=CC1743DB70C0AFD81B6CD9A4826F619D0A60FBF859D5238D87EEA2DDEB50D1D6BF1732FDFB30E6C70648F4A57CBC2BAC740D22E1F7D2ED88&uin=0&fromtag=53","mp3_h":"http:\/\/dl.stream.mmmusic.gg.com\/M800004YVmzL0O67WR.mp3?guid=2095717240&skey=CC1743DB70C0AFD81B6CD9A4826F619D0A60FBF859D5238D87EEA2DDEB50D1D6BF1732FDFB30E6C70648F4A57CBC2BAC740D22E1F7D2ED88&uin=0&fromtag=53","ape":"http:\/\/dl.stream.mmmusic.gg.com\/A000004YVmzL0O67WR.ape?guid=2095717240&skey=CC1743DB70C0AFD81B6CD9A4826F619D0A60FBF859D5238D87EEA2DDEB50D1D6BF1732FDFB30E6C70648F4A57CBC2BAC740D22E1F7D2ED88&uin=0&fromtag=53","flac":"http:\/\/dl.stream.mmmusic.gg.com\/F000004YVmzL0O67WR.flac?guid=2095717240&skey=CC1743DB70C0AFD81B6CD9A4826F619D0A60FBF859D5238D87EEA2DDEB50D1D6BF1732FDFB30E6C70648F4A57CBC2BAC740D22E1F7D2ED88&uin=0&fromtag=53","songname":"\u7ae5\u8bdd\u9547","albumname":"\u7ae5\u8bdd\u9547","singername":"\u8bb8\u5a1c","pic":"https:\/\/y.gtimg.cn\/music\/photo_new\/T002R300x300M000000fglnt1hPvpJ.jpg?max_age=2592000"} of type java.lang.String cannot be converted to JSONObject W/System.err: at org.json.JSON.typeMismatch(JSON.java:112) at org.json.JSONObject.<init>(JSONObject.java:163) at org.json.JSONObject.<init>(JSONObject.java:176)

eclipse里java文件里的字全是黑色

<p><br><img src="http://dl.iteye.com/upload/attachment/450451/112c3d81-0f3c-37ff-8bd4-1df8d6b763c3.png" alt=""></p> <p> </p> <p>语法高亮没有了,在一个变量或类上按住Ctrl键也不会出现连接。图片里左上角,java文件的图标也不正常了。</p> <p>其他的文件还好,就是java文件出现这种问题,求解。。。。。。。。。。。。。。。。。。。。。。。。。。。</p>

刚学习JSF,出现java.lang.ClassNotFoundException的异常

<p> </p> <pre name="code" class="web.xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt; &lt;servlet&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;0&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; </pre> <p> 而且lib 也导入这些依赖包</p> <p><br><img src="http://dl.iteye.com/upload/attachment/0079/2244/98bef91e-2269-30e7-b458-66f4e95a4b88.jpg" alt=""></p> <p>但项目运行的时候都会出现下面的异常,包括复制别人的项目</p> <p> </p> <p>异常如下:<br>java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet</p> <p> <span style="white-space: pre;"> </span>at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1136)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)</p> <p><span style="white-space: pre;"> </span>at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)</p> <p><span style="white-space: pre;"> </span>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)</p> <p><span style="white-space: pre;"> </span>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)</p> <p><span style="white-space: pre;"> </span>at java.util.concurrent.FutureTask.run(FutureTask.java:138)</p> <p><span style="white-space: pre;"> </span>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)</p> <p><span style="white-space: pre;"> </span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)</p> <p><span style="white-space: pre;"> </span>at java.lang.Thread.run(Thread.java:619)</p> <p> </p>

java web怎样实现商品分类显示

自己写了一个小的javaweb项目,用的jsp+servlet。 想实现商品的分类显示,但是不知道怎样从jsp页面传值给dao层,以及查询语句怎么写? 求大神帮助。 这是jsp页面: ``` <%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%> <%@ page import="cn.edu.qust.bookcitys.entity.Items"%> <%@ page import="cn.edu.qust.bookcitys.dao.ItemsDao"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>展示</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/common.css" rel="stylesheet"> <link href="css/show.css" rel="stylesheet"> </head> <body> <header> <!-- logo --> <div class="index-header-top"> <img src="images/logo.png" class="logo"> </div> <!--导航栏--> <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <ul class="nav navbar-nav"> <li><a href="index.jsp">首页</a></li> <li class="active"><a href="show.jsp" target="_self">展示</a></li> <li><a href="cart.jsp" target="_self">购物车</a></li> <li><a href="login.jsp" target="_self">登录</a></li> </ul> </div> </nav> </header> <div class="details_container"> <div class="details_left"> <dl> <dt class="book"> <a href="show.jsp?sort=1">文学</a> </dt> <dd> <a href="#">作品集</a> </dd> <dd> <a href="#">名著</a> </dd> <dd> <a href="#">小说</a> </dd> </dl> <dl> <dt class="xbook"> <a href="show.jsp?sort=2">青春</a> </dt> <dd> <a href="#">青春</a> </dd> <dd> <a href="#">励志</a> </dd> <dd> <a href="#">校园</a> </dd> </dl> <dl> <dt class="book"> <a href="show.jsp?sort=3">生活</a> </dt> <dd> <a href="#">作品集</a> </dd> <dd> <a href="#">名著</a> </dd> <dd> <a href="#">小说</a> </dd> </dl> </div> <div class="details_right"> <div style="width: 1000px;"> <% ItemsDao itemsDao = new ItemsDao(); String sort = request.getParameter("sort"); ArrayList<Items> list = itemsDao.getAllItems(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { Items item = list.get(i); request.setAttribute("item",item); %> <div style="width: 180px; height: 220px; float: left;"> <a href="details.jsp?id=${item.id }"><img style="float: left;" src="images/${item.picture }" width="170px" height="120px" border="1" /></a> <span style="float: left; margin: 5px 0px 0px 5px; color: blue">${item.name }</span> <span style="float: left; margin: 5px 0px 0px 5px; color: #000">作者:${item.author }&nbsp;&nbsp; 价格: ${item.price }¥ </span> </div> <% } } %> </div> </div> </div> <div class="details_bottom"> <footer> Copyright &copy; Made By 泥石流 </footer> </div> <!-- 如果要使用Bootstrap的js插件,必须先调入jQuery --> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.min.js"></script> <!-- 包括所有bootstrap的js插件或者可以根据需要使用的js插件调用 --> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> </body> </html> ``` ``` 这是dao层: package cn.edu.qust.bookcitys.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import cn.edu.qust.bookcitys.entity.Items; import cn.edu.qust.bookcitys.util.DBHelper; //商品的业务逻辑类 public class ItemsDao { //获得所有的商品信息 public ArrayList<Items> getAllItems(){ Connection conn = null; PreparedStatement stmt = null; ResultSet rs = null; ArrayList<Items> list = new ArrayList<Items>();//商品集合 try{ conn = DBHelper.getConnection(); // String sql = "select * from items where sort=?;";//sql语句 String sql = "select * from items ;";//sql语句 stmt = conn.prepareStatement(sql); // stmt.setInt(1, sort); rs = stmt.executeQuery(); while(rs.next()){ Items item = new Items(); item.setId(rs.getInt("id")); item.setName(rs.getString("name")); item.setAuthor(rs.getString("author")); item.setNumber(rs.getInt("number")); item.setPrice(rs.getInt("price")); item.setPicture(rs.getString("picture")); item.setSort(rs.getInt("sort")); list.add(item);//每次遍历把一个商品加入集合 } return list; } catch(Exception e){ e.printStackTrace(); return null; } finally{ //释放数据集对象 if(rs!=null){ try{ rs.close(); rs = null; } catch(Exception e){ e.printStackTrace(); } } //释放语句对象 if(stmt!=null){ try{ stmt.close(); stmt = null; } catch(Exception e){ e.printStackTrace(); } } } } //根据商品编号获得商品资料 public Items getItemsById(int id){ Connection conn = null; PreparedStatement stmt = null; ResultSet rs = null; try{ conn = DBHelper.getConnection(); String sql = "select * from items where id=?;";//sql语句 stmt = conn.prepareStatement(sql); stmt.setInt(1, id); rs = stmt.executeQuery(); if(rs.next()){ Items item = new Items(); item.setId(rs.getInt("id")); item.setName(rs.getString("name")); item.setAuthor(rs.getString("author")); item.setNumber(rs.getInt("number")); item.setPrice(rs.getInt("price"));; item.setPicture(rs.getString("picture")); item.setSort(rs.getInt("sort")); return item; } else{ return null; } } catch(Exception e){ e.printStackTrace(); return null; } finally{ //释放数据集对象 if(rs!=null){ try{ rs.close(); rs = null; } catch(Exception e){ e.printStackTrace(); } } //释放语句对象 if(stmt!=null){ try{ stmt.close(); stmt = null; } catch(Exception e){ e.printStackTrace(); } } } } //获取最近浏览的前3条信息 public ArrayList<Items> getViewList(String list){ System.out.println("list:"+list); ArrayList<Items> itemlist = new ArrayList<Items>(); int iCount = 3; if(list!=null&&list.length()>0){ String[] arr = list.split("#"); System.out.println("arr.length="+arr.length); //如果商品记录大于等于3条 if(arr.length>=3){ for(int i=arr.length-1;i>=arr.length-iCount;i--){ itemlist.add(getItemsById(Integer.parseInt(arr[i]))); } } else{ for(int i = arr.length-1;i>=0;i--){ itemlist.add(getItemsById(Integer.parseInt(arr[i]))); } } return itemlist; } else{ return null; } } } ``` ``` 想把sort的值传到dao层并实现分类显示。

无法获得Gomobile绑定以使用Java

<div class="post-text" itemprop="text"> <p><strong>Go version</strong>: 1.7.5</p> <p><strong>GOPATH</strong> = <em>D:/GoWork</em></p> <p><strong>React Native</strong> version 0.41</p> <p>Code below is the binding go package at <strong><em>D:\GoWork\src ngo ngo ngo.go</em></strong></p> <p>Very simple, just returning a string</p> <pre><code>package rngo // RNcall is used to bind with RN func RNcall() string { return "From Go platform" } </code></pre> <p>Running the below command from &gt; <strong><em>D:\GoWork\src ngo</em></strong></p> <pre><code>gomobile bind -target android -o rngo.aar -v . </code></pre> <p><em>Verbose Output below seems to be fine</em></p> <blockquote> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\classes.go</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\classes.h</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\classes.c</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gen\src\Java\interfaces.go rngo/rngo </p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\fakegopath\pkg\android_arm ngo ngo.a write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\go_rngomain.go</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\go_main.go</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\androidlib\main.go</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\android\src\main\java ngo\Rngo.java</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\java_rngo.c</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind ngo.h</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\android\src\main\java\go\Universe.java</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\android\src\main\java\go\error.java</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\java_universe.c</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\universe.h</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\seq_android.go</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\seq_android.c</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\seq.h</p> <p>write C:\Users\Minty\AppData\Local\Temp\gomobile-work-855641675\gomobile_bind\seq.go</p> <p>Java <em>/C</em>/Users/Minty/AppData/Local/Temp/gomobile-work-855641675/gomobile_bind command-line-arguments rngo/rngo Java</p> <p><em>/C</em>/Users/Minty/AppData/Local/Temp/gomobile-work-855641675/gomobile_bind command-line-arguments rngo/rngo Java</p> <p><em>/C</em>/Users/Minty/AppData/Local/Temp/gomobile-work-855641675/gomobile_bind command-line-arguments rngo/rngo Java</p> <p><em>/C</em>/Users/Minty/AppData/Local/Temp/gomobile-work-855641675/gomobile_bind</p> <p>/# <em>/C</em>/Users/Minty/AppData/Local/Temp/gomobile-work-855641675/gomobile_bind</p> <p>D:\Android\sdk dk-bundle\toolchains\x86_64-4.9\prebuilt\windows-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin\ld: warning: skipping incompatible D:\Android\sdk dk-bundle\platforms\android-21\arch-x86_64/usr/lib/liblog.so while searching for log</p> <p>D:\Android\sdk dk-bundle\toolchains\x86_64-4.9\prebuilt\windows-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin\ld: warning: skipping incompatible D:\Android\sdk dk-bundle\platforms\android-21\arch-x86_64/usr/lib/libdl.so while searching for dl</p> <p>D:\Android\sdk dk-bundle\toolchains\x86_64-4.9\prebuilt\windows-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin\ld: warning: skipping incompatible D:\Android\sdk dk-bundle\platforms\android-21\arch-x86_64/usr/lib/libc.so while searching for c</p> <p>D:\Android\sdk dk-bundle\toolchains\x86_64-4.9\prebuilt\windows-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin\ld: warning: skipping incompatible D:\Android\sdk dk-bundle\platforms\android-21\arch-x86_64/usr/lib/libdl.so while searching for dl</p> <p>command-line-arguments </p> <p>aar: AndroidManifest.xml </p> <p>aar: proguard.txt </p> <p>aar: classes.jar </p> <p>jar: META-INF/MANIFEST.MF </p> <p>jar: go/LoadJNI.class </p> <p>jar: go/Seq$GoObject.class </p> <p>jar: go/Seq$Proxy.class </p> <p>jar: go/Seq$Ref.class</p> <p>jar: go/Seq$RefMap.class </p> <p>jar: go/Seq$RefTracker.class </p> <p>jar: go/Seq.class jar: go/Universe$proxyerror.class jar: go/Universe.class</p> <p>jar: go/error.class </p> <p>jar: rngo/Rngo.class </p> <p>aar: jni/armeabi-v7a/libgojni.so </p> <p>aar: jni/arm64-v8a/libgojni.so </p> <p>aar: jni/x86/libgojni.so </p> <p>aar: jni/x86_64/libgojni.so </p> <p>aar: R.txt </p> <p>aar: res/</p> </blockquote> <p><strong>Successfully created</strong> rngo.aar since there is no error message and I can see that file at <strong><em>D:\GoWork\src ngo ngo.aar</em></strong></p> <p>I then manually import rngo.aar file into React Native project from android studio </p> <ol> <li><strong>File &gt; New &gt; New Module &gt; Import .aar/.jar Package &gt; #give the path to rngo.aar#</strong> </li> <li><strong>File &gt; Project Structure &gt; app &gt; Dependencies &gt; Module dependency &gt; rngo.aar</strong></li> </ol> <p>Inside IDE, in MainActivity.java I can successfully do <strong>'import go.rngo.*;'</strong>, but I cannot get <strong>'go.rngo.Rngo.RNcall()'</strong> or <strong>'go.rngo.Rngo;'</strong> to work</p> <p><a href="https://i.stack.imgur.com/4QHLT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4QHLT.jpg" alt="enter image description here"></a></p> <p>Building this android app throws error <strong>'cannot find symbol'</strong></p> <blockquote> <p><strong><em>D:\RN\gomobile\android\app\src\main\java\com\gomobile\RngoModule.java:10</em></strong>: error: cannot find symbol</p> <p>import go.rngo;<br> ^</p> <p>symbol: class rngo<br> location: package go<br> 1 error<br> :app:compileDebugJavaWithJavac FAILED</p> </blockquote> <p><a href="https://i.stack.imgur.com/vZA0h.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vZA0h.jpg" alt="enter image description here"></a></p> <p><strong>Conclusion</strong></p> <p>I am doing something horribly wrong, that I cannot get this simple thing to work. I wasted whole day on google but with no avail. Hence I need help getting this to work. All I need is a simple go code with that connects to react native hasselfree.</p> <p><strong><em>Thanks for reading all this. I appreciate it.</em></strong></p> </div>

使用youtube-dl时报错

youtube-dl报错使用youtube-dl下载视频时老是报错,请问有人知道怎么解决吗![图片说明](https://img-ask.csdn.net/upload/201712/05/1512479977_781742.jpg)

java 通过 xfire 调用金蝶K3 webservice接口 返回null

代码很简单如下 Client client = new Client(new URL("http://192.168.8.132/KDWEBSERVICE/Department.asmx?wsdl")); String strError =""; String strError1 =""; String strError2 =""; Object[] results = client.invoke("Query", new Object[]{4, "Administrator", "1111", 30, null, null}); System.out.println(results[0]); System.out.println(results[1]); System.out.println(results[2]); 地址用户名密码都正确没有问题 附件会放一个 金蝶自己的测试工具截图 上面代码 后台输出结果 [#document: null] 0x0000000000CA4B67 0x0000000000F75D2E 数据库中有数据 有知道的麻烦指点一下!!! [img]http://dl2.iteye.com/upload/attachment/0098/1910/ce85d64a-6613-3bc1-a4f4-49d6fae96298.jpg[/img]

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

差点跪了...

最近微信又搞出了一个大利器,甚至都上了热搜,当然消息最敏捷的自媒体人,纷纷都开通了自己的视频号。01 视频号是什么呢?视频号是微信体系内的短视频,它不同...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

Vue回炉重造之router路由(更新中)

你好,我是Vam的金豆之路,可以叫我豆哥。2019年年度博客之星、技术领域博客专家。主要领域:前端开发。我的微信是 maomin9761,有什么疑问可以加我哦,自己创建了一个微信技术交流群,可以加我邀请你一起交流学习。最后自己也创建了一个微信公众号,里面的文章是我自己精挑细选的文章,主要介绍各种IT新技术。欢迎关注哦,微信搜索:臻美IT,等你来。 欢迎阅读本博文,本博文主要讲述【】,文字通...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐