ozeki6 32 Share Posted February 25, 2020 https://gyazo.com/716fefcf2525f02dd9c04f47415a95ed It used to work but I didn't botted in a while and I don't know what updates were made to dreambot. Why is it not able to read those classes anymore? [ERROR]18:00:00: Error loading script class: C:\Users\george\DreamBot\Scripts\F2P AIO Dreambot.jar![org/apache/commons/logging/impl/ServletContextCleaner.class] [ERROR]18:00:00: Error loading script class: C:\Users\george\DreamBot\Scripts\F2P AIO Dreambot.jar![org/apache/http/osgi/impl/HttpProxyConfigurationActivator.class] [ERROR]18:01:33: Error loading script class: C:\Users\george\DreamBot\Scripts\F2P AIO Dreambot.jar![org/apache/commons/logging/impl/ServletContextCleaner.class] [ERROR]18:01:33: Error loading script class: C:\Users\george\DreamBot\Scripts\F2P AIO Dreambot.jar![org/apache/http/osgi/impl/HttpProxyConfigurationActivator.class] Link to comment Share on other sites More sharing options...
Nuclear Nezz 2062 Share Posted February 26, 2020 Sounds like you're missing some classes, make sure you have those libs with your scripts, or included in your libs folder. Link to comment Share on other sites More sharing options...
ozeki6 32 Author Share Posted February 27, 2020 On 2/26/2020 at 3:16 AM, Nuclear Nezz said: Sounds like you're missing some classes, make sure you have those libs with your scripts, or included in your libs folder. No. There is something wrong with Dreambot. What i've tried so far: I've used a very old version of the script that used to work but it gives the same error. I added a newer version of the library that contains the classes but still gives the same error I created a new script that does nothing but I included the libraries and it still gives the same error. I have 9 libraries but the error is directed to those 2 classes from 2 of the 9 libraries. As I said. I haven't changed anything in the script so I assume something changed about Dreambot. Edit: I mannaged to fix it by removing thhose 2 libraries. However, if If I actually needed them they wouldn't work. In case you were wondering the libraries are the following: http://www.java2s.com/Code/Jar/c/Downloadcommonslogging1211jar.htm [org/apache/commons/logging/impl/ServletContextCleaner.class] is from this library https://jar-download.com/artifacts/org.apache.httpcomponents/httpclient-osgi/4.5.2/source-code [org/apache/http/osgi/impl/HttpProxyConfigurationActivator.class] is from this library Link to comment Share on other sites More sharing options...
Nuclear Nezz 2062 Share Posted February 28, 2020 17 hours ago, ozeki6 said: No. There is something wrong with Dreambot. What i've tried so far: I've used a very old version of the script that used to work but it gives the same error. I added a newer version of the library that contains the classes but still gives the same error I created a new script that does nothing but I included the libraries and it still gives the same error. I have 9 libraries but the error is directed to those 2 classes from 2 of the 9 libraries. As I said. I haven't changed anything in the script so I assume something changed about Dreambot. Edit: I mannaged to fix it by removing thhose 2 libraries. However, if If I actually needed them they wouldn't work. In case you were wondering the libraries are the following: http://www.java2s.com/Code/Jar/c/Downloadcommonslogging1211jar.htm [org/apache/commons/logging/impl/ServletContextCleaner.class] is from this library https://jar-download.com/artifacts/org.apache.httpcomponents/httpclient-osgi/4.5.2/source-code [org/apache/http/osgi/impl/HttpProxyConfigurationActivator.class] is from this library How are you adding the libraries? Are you building them into the jar, the full sources? If yes, can you find those classes if you open your jar with bytecode viewer? Are you using them as libs with the new libs folder? If yes, did you include the necessary libs file in your jar build? Did you even read the update thread? The reason it may not work now is *because* I changed how the libraries work. If it used to work, but now doesn't, it means you're not adding the libraries in the ways that were suggested in the thread. Link to comment Share on other sites More sharing options...
ozeki6 32 Author Share Posted February 29, 2020 23 hours ago, Nuclear Nezz said: How are you adding the libraries? Are you building them into the jar, the full sources? If yes, can you find those classes if you open your jar with bytecode viewer? Are you using them as libs with the new libs folder? If yes, did you include the necessary libs file in your jar build? Did you even read the update thread? The reason it may not work now is *because* I changed how the libraries work. If it used to work, but now doesn't, it means you're not adding the libraries in the ways that were suggested in the thread. I added the libs into the new Libs folder located in the DreamBot folder but It doesn't work at all. It can't find the libraries. I read your thread and I basically removed the libraries that were build in my script and added the jar libraries in the DreamBot's Lib folder. The jar libraries are fine because I ran the script outside DreamBot and it works fine. Yes, most likely the error is caused due to your update in regards to how libraries work now but I either missed something or there is something wrong going on. Edit: I also used bytcode viewer on the libs and the calsses and methods were present. Link to comment Share on other sites More sharing options...
Nuclear Nezz 2062 Share Posted February 29, 2020 6 hours ago, ozeki6 said: I added the libs into the new Libs folder located in the DreamBot folder but It doesn't work at all. It can't find the libraries. I read your thread and I basically removed the libraries that were build in my script and added the jar libraries in the DreamBot's Lib folder. The jar libraries are fine because I ran the script outside DreamBot and it works fine. Yes, most likely the error is caused due to your update in regards to how libraries work now but I either missed something or there is something wrong going on. Edit: I also used bytcode viewer on the libs and the calsses and methods were present. If they were present then I"m not sure, are you sure you were running against the correct jar? With the libs, did you also include the libs file in your jar? It's not just adding jars to the libs folder, you still have to specify which ones you're using in your libs file, to prevent scripts from using conflicting libs. Link to comment Share on other sites More sharing options...
ozeki6 32 Author Share Posted February 29, 2020 3 hours ago, Nuclear Nezz said: If they were present then I"m not sure, are you sure you were running against the correct jar? With the libs, did you also include the libs file in your jar? It's not just adding jars to the libs folder, you still have to specify which ones you're using in your libs file, to prevent scripts from using conflicting libs. If I do that, since I do not add the libs to the jar buil myself, it does not even start the script. Libs included from dreambot Libs folder. https://gyazo.com/33306aa398f48b43eabd35a37c0a638c Script not starting : https://gyazo.com/79c1ae3168ab53fff403f3732210d741 Edit: So... if I extend AbstractScript to my main class even running a static main method doesn't work since it gives the same error as dreambot does. So, I assume that for some reasons dreambot just can't read those 2 classes Also, onStart method does not work either in those situation ... Link to comment Share on other sites More sharing options...
Nuclear Nezz 2062 Share Posted March 1, 2020 20 hours ago, ozeki6 said: If I do that, since I do not add the libs to the jar buil myself, it does not even start the script. Libs included from dreambot Libs folder. https://gyazo.com/33306aa398f48b43eabd35a37c0a638c Script not starting : https://gyazo.com/79c1ae3168ab53fff403f3732210d741 Edit: So... if I extend AbstractScript to my main class even running a static main method doesn't work since it gives the same error as dreambot does. So, I assume that for some reasons dreambot just can't read those 2 classes Also, onStart method does not work either in those situation ... Okay, so the libs folder, under DreamBot folder, if you're using that tactic to import jars, you need to also include a file called libs in your jar that states which libs you're using. Did you do that? Granted, if the files are showing up in your exported jar anyway, then it should be working fine. I'm not sure why it wouldn't be able to read those specific classes though. Link to comment Share on other sites More sharing options...
ozeki6 32 Author Share Posted March 1, 2020 1 hour ago, Nuclear Nezz said: Okay, so the libs folder, under DreamBot folder, if you're using that tactic to import jars, you need to also include a file called libs in your jar that states which libs you're using. Did you do that? Granted, if the files are showing up in your exported jar anyway, then it should be working fine. I'm not sure why it wouldn't be able to read those specific classes though. Importing libraries from drambot's folder does work and I do not need to export the libraries into the jar. But it beahves in the same way ... Doing this way doesn't show in the console that it can't read the 2 classes but it gets stuck at the same line so I assume it's the same problem. I did follow Defiled's tutorial if that's what you mean. Link to comment Share on other sites More sharing options...
yeeter 528 Share Posted March 1, 2020 If you know how to use Apache Maven you can package the libs in a shaded jar to assure they are all in the same file. This is how I am currently building a command and control center for my bots using a few different dependencies. Here is an example of a simple pom.xml to build a shaded jar. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.db.yeeter</groupId> <artifactId>yeetwarecnc</artifactId> <version>0.1</version> <name>dbcnc</name> <properties> <dreambot.folder.path>C:/Users/yeeter01/DreamBot</dreambot.folder.path> </properties> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>5.2.1.RELEASE</version> </dependency> <dependency> <groupId>org.zeromq</groupId> <artifactId>jeromq</artifactId> <version>0.5.1</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>3.11.0</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java-util</artifactId> <version>3.11.0</version> </dependency> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>dreambot</groupId> <artifactId>client</artifactId> <version>1.0.0</version> <scope>system</scope> <systemPath>${dreambot.folder.path}/BotData/client.jar</systemPath> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.1</version> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>dep-included</shadedClassifierName> <outputDirectory>${dreambot.folder.path}/Scripts</outputDirectory> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.