Run as 找不到 Java Application 已经配置main 5C

图片说明

0

2个回答

通常这种情况是因为编译器原因,你找到菜单栏的project,然后clean一下,如果是maven的话,右键项目,选择maven,然后选择update project。
还有就是把你的项目拿到命令行去编译执行,如果通过,那就绝逼是编译器问题了。如果不通过,你要检查自己的代码

0

右击一个项目,点击properties--project facets--convert to faceted

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
点击run as却找不到java application问题
我的代码如下:package test; public class PrintNumber implements Runnable { int num = 1; @Override public void run() { synchronized (this) { while (num <= 100) { notify(); try { Thr...
run as java application 与 tomcat
同样的代码,我通过main方法直接执行没问题,但是适用tomcat服务器通过请求访问 却不成功,一般这种问题从哪方面思路考虑啊?一样一样的代码
找不到主函数main,但是还能run,怎么回事
网上下了个程序,VC的,找不到主函数main,只找到这个rnrn不知道是主函数吗?没有main怎么还能run出现控制台rnrnint _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
run as java application和run as swt application 有什么区别呢?
我用swt designer4.1.1,可是run的时候,用run as swt application就可以,用run as java application,就会报错,但别人那里是可以的,不知怎么回事,望解答,谢谢,我的eclipse是3.1.1rnException in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3139 in java.library.pathrn at java.lang.ClassLoader.loadLibrary(Unknown Source)rn at java.lang.Runtime.loadLibrary0(Unknown Source)rn at java.lang.System.loadLibrary(Unknown Source)rn at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)rn at org.eclipse.swt.internal.win32.OS.(OS.java:18)rn at org.eclipse.swt.widgets.Display.(Display.java:125)rn at sfd.main(sfd.java:13)
run configuration找不到启动配置了
exception: A 'Java Application' configuration with this name already exists 是不是工程关掉了,在run configuration中,过滤列表不选Filter Closed Project
run as java application 和run as java bean的区别!求教
import javax.swing.JFrame;rnrnclass Test extends JFramern public Test() rn super();rn initialize();rn rn private void initialize() rn this.setTitle("JFrame");rn this.setSize(400, 400); rn this.setLocationRelativeTo(null);rn this.setVisible(true);rn rn public static void main(String args[])rn new Test();rn rnrn用eclipsernrun as java application能够在屏幕中央显示JFramernrun as java bean却不能rn为什么?rn怎么才能run as java bean也能中央显示JFrame
Java多线程---main与子线程 start与run
假设有个PureThread,继承了Thread,定义如下:public class PureThread extends Thread { public void run() { System. out .println(Thread.currentThread().getName()+ ” r1” ); } }我们现在来写个测试类测试: 测试1: p
eclipse运行java找不到main
报的错误是:rnjava.lang.NoClassDefFoundError: com/ListDbrnException in thread "main"rn源文件:rnpackage com;rnrnimport java.sql.*;rnimport java.util.*;rnpublic class ListDbrn //定义操作数据库变量、数据库驱动、数据库路径rn private static Connection conn=null;rn private static ResultSet oRs=null;rn private static String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";rn private static String url="jdbc:microsoft:sqlserver://127.0.0.1:1433;user=sa;password=sa;databaseName=trade";rn //private static Statement stmt=null;rn rn //加载驱动rn public ListDb()rn tryrn Class.forName(driver);rn catch(Exception e)rn System.out.println("加载驱动出错:"+e.getMessage());rn rn rn rn //获取连接rn public Connection getConn()rn tryrn conn=DriverManager.getConnection(url);rn catch(SQLException e)rn System.out.println("连接出错:"+e.getMessage());rn rn return conn;rn rn rn //关闭数据库rn public String closeConn()rn String sErr="";rn tryrn if(conn!=null)rn conn.close();rn conn=null;rn rn catch(Exception e)rn sErr=e.getMessage();rn rn return sErr;rn rn public static void main(String args[])rn ListDb db=new ListDb();rn rn rn这里不是有main吗?为什么还会找不到呢?rn请高手帮一下啊...谢谢
关于找不到java main class
[code=Java]package com.sise.test;rnrnimport java.util.List;rnimport org.springframework.context.ApplicationContext;rnimport org.springframework.context.support.ClassPathXmlApplicationContext;rnimport com.sise.po.Person;rnimport com.sise.service.PersonService;rnrnpublic class SpringTest rn static ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");rn static PersonService personservice=(PersonService)ctx.getBean("personService");rn rn public static void main(String[] args) rn add();rn findAll();rn //removeById();rn getPager(); rn rn rn public static void add()rn Person p1=new Person();rn p1.setName("钱六");rn p1.setAge(23);rn p1.setSno("软件系");rn personservice.add(p1);rn Person p2=new Person();rn p2.setName("张琪");rn p2.setAge(21);rn p2.setSno("国贸系");rn personservice.add(p2);rn rn rn public static void findAll()rn List persons=personservice.findAll();rn for(Person person:persons)rn System.out.println(person.getName());rn rn rn rn public static void findById()rn Person person=personservice.findById(3);rn System.out.println(person.getName());rn rn rn public static void removeById()rn personservice.remove(2);rn System.out.println("删除成功!");rn rn rn public static void getPager()rn String hql="from Person";rn int offset=0;rn int pageSize=3;rn //offset+=pageSize;rn List persons=personservice.getPager(hql, offset, pageSize);rn for(Person person:persons)rn System.out.println(person.getName());rn rn rn rnrnrn[/code]rnrnrn想运行,报错[code=Java]log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).rnlog4j:WARN Please initialize the log4j system properly.rnjava.lang.ExceptionInInitializerErrorrnCaused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.DriverDataSource] for bean with name 'dataSource' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DriverDataSourcern at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524)rn at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177)rn at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:758)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422)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.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at com.sise.test.SpringTest.(SpringTest.java:11)rnCaused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DriverDataSourcern at java.net.URLClassLoader$1.run(URLClassLoader.java:200)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:252)rn at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)rn at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385)rn at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)rn ... 9 morernException in thread "main" [/code]rnrnrn
运行run as application 然后出现searching for main types
运行run as application 然后出现searching for main types, 我应该选择哪个main types呢 求高手指教
找不到main
//. SwitchStudy.javarnpublic class SwitchStudy rn rn public static void main(String[] args)rn rnrn switch(5)rn rn case 1: prt("1");rn case 2: prt("2"); rn case 5: prt("5");break;rn default: break;rn rn rnrn rnrnrn static void prt(String str)rn rn System.out.println(str);rn rnrnrn运行报错:rnException in thread "main" java.lang.NoClassDefFoundError: SwitchStudy/classrnCaused by: java.lang.ClassNotFoundException: SwitchStudy.classrn at java.net.URLClassLoader$1.run(Unknown Source)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(Unknown Source)rn at java.lang.ClassLoader.loadClass(Unknown Source)rn at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)rn at java.lang.ClassLoader.loadClass(Unknown Source)rnCould not find the main class: SwitchStudy.class. Program will exit.
eclipse run as none application
代码如下 是书里的示例代码,没有报错,就是run as none application。 该怎么办???rnpackage buttonFrame;rnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnrn/**rn * A frame with a button panelrn */rnpublic class ButtonFrame extends JFramernrn private static final long serialVersionUID = 1L;rn private JPanel buttonPanel;rn private static final int DEFAULT_WIDTH = 300;rn private static final int DEFAULT_HEIGHT = 200;rnrn public ButtonFrame()rn rn setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);rnrn // create buttonsrn JButton yellowButton = new JButton("Yellow");rn JButton blueButton = new JButton("Blue");rn JButton redButton = new JButton("Red");rnrn buttonPanel = new JPanel();rnrn // add buttons to panelrn buttonPanel.add(yellowButton);rn buttonPanel.add(blueButton);rn buttonPanel.add(redButton);rnrn // add panel to framern add(buttonPanel);rnrn // create button actionsrn ColorAction yellowAction = new ColorAction(Color.YELLOW);rn ColorAction blueAction = new ColorAction(Color.BLUE);rn ColorAction redAction = new ColorAction(Color.RED);rnrn // associate actions with buttonsrn yellowButton.addActionListener(yellowAction);rn blueButton.addActionListener(blueAction);rn redButton.addActionListener(redAction);rn rnrn /**rn * An action listener that sets the panel's background color.rn */rn private class ColorAction implements ActionListenerrn rn private Color backgroundColor;rnrn public ColorAction(Color c)rn rn backgroundColor = c;rn rnrn public void actionPerformed(ActionEvent event)rn rn buttonPanel.setBackground(backgroundColor);rn rn rn
How to run java frame application on linux
我使用redhat 7.0rn我写了一个java Frame 应用程序,但是我用java MyFrame 命令rn在控制台上 报错说不能打开server windowrn在Xwindow上 没有反应。rn我的程序在window上是可以运行的rn我应该如何做?
java.lang.NoClassDefFoundError:run Exception in thread"main"”
在虚拟机的XP系统下安装vxworks6.5时会出现java.lang.NoClassDefFoundError:run Exception in thread"main"”,是什么意思啊?该怎么解决?我是新手,很多不懂得,请高手指点一二!!!!
windowXP "Run" 找不到了。
windowxp系统,安装完成后发现在“start”里面没有那个“run”选项了,请问如何恢复呢?谢谢。
为什么找不到main()
cygwin下开发的工程,但看了很久,到现在我还没找到main()呢rn难道程序的入口不是main()
找不到方法错误main
Exception in thread "main" java.lang.NoSuchMethodError: mainrnrn是什么原因呢rnrnrnpublic class Testrn rn rnpublic void main(String argv[])rnrn rnrn rn rn rnrnrn我的环境变量是%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\ProgramFiles\J2SE\bin;D:\ProgramFiles\UltraEdit;D:\ProgramFiles\MySQL\bin
新手 找不到 main 方法
我跟着视频教程一样的编辑的,为什么报错了。。。npackage com.imooc1;nnpublic class Demo npublic static void main(String[] args) n int score = 53; n int i=1;int j;n for( j=0;score+i>=60;j++)n n System.out.println(score);n System.out.println("60"+j);n nn报错:错误: 在类 com.imooc1.Demo 中找不到 main 方法, 请将 main 方法定义为:n public static void main(String[] args)n否则 JavaFX 应用程序类必须扩展javafx.application.Applicationn
找不到main class
今天在cmd中运行xx.java时出现了错误,报的是找不到main函数,但是我在窗口中运行java和javac命令时都是正确的显示,环境变量的配置应该没有错误的,之后我又把它单独在myeclipse中运行,能够正常运行,说明程序变得也没问题,为什么会在命令窗口中报错呢?
在eclipse中找不到main()
public class HelloWorldrn public static void main(String[] args)rn System.out.println("hello world")"rn rn rn 在运行这个文件时,报出 找不到 main.class 文件的错误,请高手指教~~~
找不到Sub Main
在我新建一个程式时,如果把Form1改为其它的名称,则会出现:rn在xx.form1中找不到Sub Mainrn在我把Form1改为其它名称后,有设它为启动项目.rn为何还出现这样的问题呢?rn请各位先进指点rn谢谢!!rn
"找不到sub Main"的错误
我手中有一本比较早的vb.net的书,按照书中的代码输入vs.net后编译时提示“找不到sub Main”,但程序中明明有“share SUB Main()...”的子程序,这是什么原因呢?请高手指教。
java命令运行java文件找不到main()方法
class Personrn private int age;rn private String name;rn public void setName(String Name)rn this.name=Name;rn rn public void setAge(int Age)rn this.age=Age;rn rn public String getName()rn return name;rn rn public int getAge()rn return age;rn rn public String getInfo()rn return "Name: '"+name+"\n"+"Age: "+age;rn rnrnclass Student extends Personrn private String school;rn public String getSchool()rn return school;rn rn public void setSchool(String School)rn this.school=School;rn rnrn public String getInfo()rn return "Name: '"+getName()+"\n"+"Age: "+getAge()+"\n"+"School: "+school;rn rnrnpublic class TestOverwritern public static void main(String[] args)rn Student student=new Student();rn Person person=new Person();rn person.setName("none");rn person.setAge(1000);rn student.setName("Jhon");rn student.setAge(18);rn student.setSchool("AHUT");rn System.out.println(person.getInfo());rn System.out.println(student.getInfo());rn rn文件名与类名一致,但是java命令运行时找不到main方法rn[img=https://img-bbs.csdn.net/upload/201902/12/1549963401_934291.png][/img]rn求大佬帮忙解释一下,,小白挣扎的很痛苦
关于命令行运行java,找不到main的问题
我写了一个helloworld程序。在命令行中可以编译出.class文件。但是java helloworld 提示 : could not find the main。。。 我在eclipse里面写了相同的内容,可以通过。问题在于:我用java命令 运行我用javac编译的.class文件提示如上错误,用java编译eclipse编译的.class文件就可以。我初步判断是储存格式的问题。请高手指教。
Application closed: Main CEcmtServer 3???
Application closed: Main CEcmtServer 3rn我在FP2的模拟器上使用正常,但是到了FP1的模拟器就会提示这个错误,请问是怎么回事???
java的web项目run的时候没有java application这个选项
版权声明:本文为博主原创文章,转载请标明作者和原链接 https://blog.csdn.net/qq_42239046/article/details/88683284 当在ecplise中创建了一个web项目,一般都可以run server,如果不能那就是tomcat没有安装好或这版本有问题或者jdk的版本有问题,其实web项目也可以运行Java application,但是这上面...
npm run eject 配置
此处的配置页分为eject过的项目和未eject的项目两种,后者antd逛网有详细描述可参考,此处只讲本项目中的配置方式,要用less,当然少不了安装less和less-loader了,运行安装
关于 Jbuilder2006 run配置
我今天新重装的JBuilder2006rn在进行RUN的时候出现了下面的提示rnrnCould not find the main class. Program will exitrn提示对RUN的main class进行配置 我不知道怎么配置的 请帮帮我...
初学JBUILDER:JBUILDER9的run怎么使用,configuration已经配置了啊
我看得jbuilder9的英文官方文档,一步一步照着做的rnrn程序可以run using defaultrnrn就是不能直接用我工具栏上的runrnrnconfiguration里面已经设置了主类rnrn可是就是显示,can‘t find main class,什么的。
我怎么找不到main()函数
我在VC6中创建了一个MFC AppWizard(EXE)工程,为什么在这个工程里找不到main()函数呢,我要接收命令行参数该怎么接收?
jar包运行找不到main class?
请大家帮帮忙,我的main class是放好的,但就是说找不到。。。rnrnMANIFEST.MF:rnManifest-Version: 1.0rnAnt-Version: Apache Ant 1.7.1rnCreated-By: 14.3-b01 (Sun Microsystems Inc.)rnMain-Class: de.tu_darmstadt.es.integrator.IntegratorrnClass-Path: ...很长,就不写了rnrn我用winrar打开jar包看,里面是这样子的:rnde文件夹:顺着这个路径找下去,是有那个Integrator.class存在的rnMETA-INF文件夹:下面是MANIFEST.MFrnrn为什么还是说这不到呢?rn这个是用别人的一个程序,是用ANT打包的。不知道为什么,就是运行不起来唉。。。
为什么提示找不到"main class"
今天我照着的p594页做了以下程序,编译时突然就弹出一个"rnjava virtual machine launcher"的对话框,内容为:"could not find the main class.program well exit" 但是编译其他的java文件就没事,对了,我用的编译器为eclipse,在command中用javac命令也是出现同样的提示,诧异中........rnrnrnimport java.io.*;rnpublic class IOStreamDemo rn // throw exceptions to console:rn public static void main(String[] args) throws IOException rn // 1. reading input by lines:rn BufferedReader in = new BufferedReader(rn new FileReader("IOStreamDemo.java"));rn String s, s2 = new String();rn while((s = in.readLine()) != null);rn s2 += s + "\n";rn in.close();rn rn // 1b. reading standard input:rn BufferedReader stdin = new BufferedReader(rn new InputStreamReader(System.in));rn System.out.print("Enter a line:");rn System.out.println(stdin.readLine());rn rn // 2. Input from memory:rn StringReader in2 = new StringReader(s2);rn int c;rn while((c = in2.read()) != -1);rn System.out.print((char)c);rn rn // 3. format memory input:rn try rn DataInputStream in3 = new DataInputStream(rn new ByteArrayInputStream(s2.getBytes()));rn while(true)rn System.out.print((char)in3.readByte());rn catch(EOFException e) rn System.err.println("End of Stream");rn rn rn // 4. file output:rn try rn BufferedReader in4 = new BufferedReader(rn new StringReader(s2));rn PrintWriter out1 = new PrintWriter(rn new BufferedWriter(rn new FileWriter("IODemo.out")));rn int lineCount = 1;rn while((s = in4.readLine()) != null)rn out1.println(lineCount++ + ": " + s);rn out1.close();rn catch(EOFException e) rn System.err.println("End of stream");rn rn rn // 5. storing & recovering datarn try rn DataOutputStream out2 = new DataOutputStream(rn new BufferedOutputStream(rn new FileOutputStream("Data.txt")));rn out2.writeDouble(3.14159);rn out2.writeChars("that was pi\n");rn out2.writeBytes("that was pi\n");rn out2.close();rn DataInputStream in5 = new DataInputStream(rn new BufferedInputStream(rn new FileInputStream("Data.txt")));rn BufferedReader in5br = new BufferedReader(rn new InputStreamReader(in5));rn // must use DataInputStream for data:rn System.out.println(in5.readDouble());rn // can now use the "proper" readLine():rn System.out.println(in5br.readLine());rn // but the line comes out funny.rn // the one created with writeBytes is ok:rn System.out.println(in5br.readLine());rn catch(EOFException e) rn System.err.println("end of stream");rn rn rn // 6. reading/writing random access filesrn RandomAccessFile rf = new RandomAccessFile("rtest.dat","rw");rn for(int i = 0; i < 10; i++)rn rf.writeDouble(i*1.414);rn rf.close();rn rn rf = new RandomAccessFile("rtest.dat","rw");rn rf.seek(5*8);rn rf.writeDouble(47.0001);rn rf.close();rn rn rf = new RandomAccessFile("rtest.dat","rw");rn for(int i = 0; i < 10; i++)rn System.out.println("Value" + i + ": " + rf.readDouble());rn rf.close();rn rnrn
Eclipse右键Run as Java application 错误: 找不到或无法加载主类 问题解决方案
1、问题描述经常遇到一个问题,在java类里新建一个main函数,然后右击,Run|Debug as Java application时,居然报这个错误:“错误: 找不到或无法加载主类”。 2、常规解决方法一般人都会百度,找各种各样的方法。什么解决这个问题的N和方法,包括:检查环境变量 刷新目录 重新构建 检查是否有引入错误的依赖 重启Eclipse 创建一个新的项目,把工作文件复制过去 等等等待要
java main
刚学c的时候,老师连main的参数都没有介绍rn只有main()rnrn后来见到rnmain(int argc, char *argv[])这就是最常见的了rnrnmain(int argc)发现也是合法的,rnrnmain(int argc, char *argv[], char *env[])石最后才知道的rnrn现在java中:rnrn多数都是public static void main(String[] args)rn也有守旧派:public static void main(String args[])rnrn我那时比较疑惑,但是两个又都对??????????rnrnString [] int args?rn出错。。。。。。。。rnrn仔细想想后发现:java的main中只有一个参数!!!!!!!!!!!!rnString [] args rn由于java的数组的写法特殊:String [] args OR String[] args OR String args[]都对rn看了好多国内国外的书都没有特别提示这个方面~~~~~~rnrn建议以后csdn里的牛人再出书的时候把这个加到数组的内容中去。。。。。。
myeclipse中右击Run as的时候,不出现java application 怎么办?
该程序没有定义main函数,或者定义的main函数不对,比如:没有写static 正确的定义方式: public static void main(String[] args){ }
Run as Java Application的快捷键是啥?怎么Alt+shit+X没用?埃
Run as Java Application的快捷键是啥?怎么Alt+shit+X没用?埃
run()过后如何知道RUN的程序已经结束
用RUN运行一段语句rnFOR i = 1 to somevaluern//写如input.txt新的SQL语句rnrnrun("c:\program files\microsoft\sql server\bin\isqlw.exe -S server -d DB -U sa -P pass -i input.txt -o output.txt")rnrn//some testrnrnNEXTrnrn运行上面这段语句,需要在RUN之后检测isqlw进程是否执行完,执行完才能接着运行下一个循环中的RUN,否则input.txt中的SQL语句无法完全执行。rn请问这种情况该怎么处理?
MessageBrokerServlet in application 'undefined' failed to initialize due to run
2-30 22:52:46 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn22:54:11,342 WARN Oracle9Dialect:37 - The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect insteadrn**** MessageBrokerServlet in application 'undefined' failed to initialize due to runtime exception: Exception: flex.messaging.MessageException: Cannot create class of type 'flex.samples.DatabaseCheckService'. Type 'flex.samples.DatabaseCheckService' not found.rn at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)rn at flex.messaging.MessageBroker.createService(MessageBroker.java:969)rn at flex.messaging.config.MessagingConfiguration.createServices(MessagingConfiguration.java:358)rn at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:117)rn at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:132)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)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(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnrn2011-12-30 22:54:30 org.apache.catalina.core.StandardContext loadOnStartuprn严重: Servlet /tomorrow threw load() exceptionrnflex.messaging.MessageException: Cannot create class of type 'flex.samples.DatabaseCheckService'. Type 'flex.samples.DatabaseCheckService' not found.rn at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)rn at flex.messaging.MessageBroker.createService(MessageBroker.java:969)rn at flex.messaging.config.MessagingConfiguration.createServices(MessagingConfiguration.java:358)rn at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:117)rn at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:132)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)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(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rn2011-12-30 22:54:34 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContext
关于Application的run和exit,理解不能
Application.Run(new FormA());rnApplication.Exit();rnApplication.Run(new FormB());rnrn到了FormB的时候屏幕只是一闪而过(环境为WinCE,不过我觉得这一点应该和环境无关)rnrn查看MSDN:rnApplication.Run 方法 (Form)rn在当前线程上开始运行标准应用程序消息循环,并使指定窗体可见。rnrnApplication.Exit 方法 ()rn通知所有消息泵必须终止,并且在处理了消息以后关闭所有应用程序窗口。rnrn为什么消息循环一旦结束了就不能再开始(莫非是里面用了类似于单例模式的实现?),如何重新启用?Application.Exit的“通知所有消息泵必须终止”是指其实可以存在多个消息循环,比如是在多线程环境下?然后某一处调用Application.Exit就全部中止?rnrn求解惑
请问Application::Run如何取得窗口的句柄
大家好,新学MFC的窗口,碰到不少初级问题. rnrn我想在一个线程里用Application::Run显示窗口,另一个线程在后台处理业务,并且会根据运算结果作用于窗口.也就是说,我需要在业务线程里取得对窗口的控制. rnrnVS2008的窗口导向做出来的窗口是public ref class MyWindow : public System::Windows::Forms::Form rnrn我在窗口线程用: rnMyWindow ^ thewin= gcnew MyWindow(); rnApplication::Run( thewin ); rn可以成功显示窗口. rnrn但是不知道怎样取得这个窗口的控制.听说是通过句柄来实现,查了一下. rnMyWindow ^ thewin= gcnew MyWindow(); rnHWND hwg; rnint error = 111; //随便给个值 rnhwg = ::FindWindow(Null,"LoginServerWindow" ); //LoginServerWindow是MyWindow的Name rnerror = ::GetLastError(); rnrn通过断点,发现hwg的值是"未定义的值",但error为0. rnrn不知道出了什么问题,盼望有心人解答.还想问问,在窗口线程得到了hwg并传给工作线程以后,在工作线程如何利用hwg来控制窗口? rn rn rn