Tag: illegalstateexception

Android GoogleMaps V2 MarkerDemo IllegalStateException没有包括点

我正在为GoogleMaps V2创建MarkerDemo的自定义实现。 我有一个奇怪的错误,我将LatLng值提供给LatLngBounds.Builder实例,然后将其作为变量传递给.build。 当我通过Eclipse在调试模式下运行应用程序时,Map会加载。 当我通过Eclipse正常运行时,会抛出一个带有“no included points”的IllegalStateException作为消息。 有人可以帮忙吗? 这是一些协助的代码。 public class MyActivity extends android.support.v4.app.FragmentActivity implements OnMarkerClickListener, OnInfoWindowClickListener, OnMarkerDragListener { private HashMap<DataItem, ArrayList> mUserLocations = new HashMap<DataItem, ArrayList>(); private ArrayList mFeedData; private NetworkingHandler mHandler = new NetworkingHandler(“tag”); private GoogleMap mMap; private final String DOWNLOAD_USER_LOCATIONS_URL = “http://www.myfeedurllocation.com/page.php”; @Override public void onCreate(Bundle savedBundleInstance) { super.onCreate(savedBundleInstance); setContentView(R.layout.activity_myactivitylayout); downloadUserLocations(); setUpMapIfNeeded(); […]

什么是IllegalStateException?

我正在尝试使用以下Fastload API 连接…等是完美的。 我确切地知道它失败了 ……….. System.out.println(” Streaming ” + dataFile); pstmtFld.setAsciiStream(1, dataStream, -1); // This line fails System.out.println(“check the above line”); // This does not go to console ……….. 例外是 Exception in thread “main” java.lang.IllegalStateException: Sample failed. [ODBC Teradata Driver] Invalid precision: cbColDef value out of range 这是我要上传的表格。 它是.csv格式,当我通过记事本打开它时,它看起来像这样 1,9,Win 2,9,Winc 3,9,Wi 为什么我会得到这个例外? 我怎样才能改进它? 据我所知,问题是pstmtFld.setAsciiStream(1, […]

更清洁的方式来获得原型的自动assembly字段的新实例

我遇到了这个问题,同时尝试自动运行一个可运行的类,并在不同的调用中创建它的不同实例并将其保存在数组中。 xml配置是: 在我的代码中,我正在尝试这样的事情: public class ThreadHandler{ @Autowired private ABC threadName; //getter ABC getThreadName(){ return threadName; } public void someFunction(){ List abc = new ArrayList(ABC>(); for (int i=0;i<SOME_CONST;i++){ ABC tName = getThreadName(); abc.add(tName); tName.start(); } } } 让ABC成为一个Thread/Runnable/Callable 。 这样,它抛出java.lang.IllegalThreadStateException 。 但是,它工作正常,如果我使用ABC tName =appContext.getBean(“threadName”,ABC.class); 为什么会这样? 在尝试从getMethod获取对象时,我们不会获得新实例吗?

Google Play游戏

今天是个好日子。 我正在尝试在我正在开发的游戏中实现成就。 我已经在google play console上设置了所有内容,获得了app-id,将清单放入以下内容中 并编写了以下方法 GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance(); int temp = googleApiAvailability.isGooglePlayServicesAvailable(this); if ( temp != 0) return; GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN) .requestEmail() .build(); GoogleSignIn.getClient(this, gso); GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this); PlayersClient player = Games.getPlayersClient(this, account); 当我运行它时,我得到了我的帐户,但是当它运行Games.getPlayersClient(this, account); 我收到以下错误: java.lang.IllegalStateException:游戏API需要https://www.googleapis.com/auth/games_litefunction。 任何人都知道什么可能是错的? 提前致谢。

无法在活动类中找到方法sendMessage(View)

MainActivity.java package com.example.myfirstapp; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.widget.EditText; import android.content.Intent; public class MainActivity extends Activity { public final static String EXTRA_MESSAGE = “com.example.myfirstapp.MESSAGE”; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is […]

Tomcat未能部署.war

我正在尝试按照本教程创建一个简单的REST Web服务,但是我会在tomcat上部署它并抛出exception: FAIL – Application at context path /restful could not be started FAIL – Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/restful]] 我已经四处寻找解决方案并找到了这个问题而且这个问题他们让我觉得这是一个servlet映射问题但是我不确定如何修复它! 这是我的日志文件: 18/12/2012 9:57:16 AM org.apache.catalina.startup.HostConfig deployWAR SEVERE: Error deploying web application archive /opt/tomcat7/webapps/restful.war java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/restful]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977) at […]

当使用Apache-POI库获取单元格内容时,我得到“无法从文本单元格中获取数值”,反之亦然。 我如何解决它?

我意识到这个问题有点令人困惑,但我不知道怎么说它。 无论如何,这是原始代码: private void readFile(String excelFileName) throws FileNotFoundException, IOException { XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(excelFileName)); if (workbook.getNumberOfSheets() > 1){ System.out.println(“Please make sure there is only one sheet in the excel workbook.”); } XSSFSheet sheet = workbook.getSheetAt(0); int numOfPhysRows = sheet.getPhysicalNumberOfRows(); XSSFRow row; XSSFCell num; for(int y = 1;y < numOfPhysRows;y++){ //start at the 2nd […]

严重:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:无法启动错误

当我尝试在Tomcat中运行我的应用程序时遇到此错误。 我已经检查过tomcat和java home的版本。 两者都使用java 6。 有丢失的jar子吗? 或者是我的web xml? 我没有使用任何maven工具。 SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ICard]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:650) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1582) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: javax/xml/rpc/handler/soap/SOAPMessageContext at java.lang.ClassLoader.defineClass1(Native Method) […]

创建新的Bufferstrategy时出现非法状态exception

当我试图找出如何使用buffers策略时,总体上只是改进了我编写代码和清理的方法。 当我运行以下代码时,我在“createBufferStrategy(3)”时出错 package Game1Test; import java.awt.Canvas; import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferStrategy; import java.io.IOException; import javax.swing.*; public class Base extends Canvas implements Runnable{ private static final long serialVersionUID = 1L; private boolean running = false; int ticks = 0; public Base(JFrame f) { setSize(f.getWidth(),f.getHeight()); start(); } public void start(){ running = true; new Thread(this).start(); } […]

如何计算Firestore中集合下的文档数量?

我正在尝试获取Cloud Firestore上存在的CollectionReference计数,我试图通过以下方式获取它: FirebaseFirestore db = FirebaseFirestore.getInstance(); final CollectionReference postsCollection = db.collection(“Posts”); final TaskCompletionSource source = new TaskCompletionSource(); new Thread(new Runnable() { @Override public void run() { int fromWhereToStart = postsCollection.get().getResult().size(); source.setResult(fromWhereToStart); } }).start(); Task task = source.getTask(); task.addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { Log.e(“Z_fromWhereToStart”, “= ” + task.getResult()); } }); 但不幸的是,我得到了: […]